What I Want
To get a direct access to the website, instead of the apache welcome page when access to a IP address.
To change this :
Ubuntu
In Ubuntu, the apache server is changed and different from the original one.
vim /etc/apache2/apache2.conf
1 | # Include of directories ignores editors' and dpkg's backup files, |
ServerName
The ServerName
directive sets the request scheme, hostname and port that the server uses to identify itself. In the context of virtual hosts, the ServerName specifies what hostname must appear in the request’s Host: header to match this virtual host. For the default virtual host (this file) this value is not decisive as it is used as a last resort host regardless. However, you must set it for any further virtual host explicitly.
Domain name matches IP, to find your server, but the serverName will match the website(sub path in you server) domain name.
Website Configuration
1 | if($_SERVER['HTTP_HOST'] == "192.168.1.105"){ |
Default Configuration
The default config file - 000-default.conf
allows every sub folder of /var/www/http
can be accessed by using url like IP/{folder-name}
.
1 | <Directory /var/www/html> |