Create a new virtual host file, and setup like this:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerAlias 192.168.1.1
DocumentRoot /somewhere/public_html
<Directory /somewhere/public_html/>
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride Authconfig FileInfo
Require all granted
</Directory>
</VirtualHost>
" <http://162.243.93.216/info.php> then /var/www/html/info.php is opened "
I am assuming this already works (If not, uncomment the ServerAlias
line shown in the conf below)
You now want to map
http://162.243.93.216/projecta/
to /var/www/projectahttp://162.243.93.216/projectb/
to /var/www/projectb
For this you need to use the Apache Alias
directive.
000-default.conf
file to:<VirtualHost *:80>
# ServerAlias 162.243.93.216
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Alias /projecta /var/www/projecta
Alias /projectb /var/www/projectb
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>