Answer the question
In order to leave comments, you need to log in
How to host a site in the url subdirectory on a local server?
There is a server on ubunt in the LAN, it has the name servername and there is an apache on the server, if you go to servername , you can see that apache is running.
I need the virtual hosts to be accessible by url servername/sitename.
Here is the code in site-available that did not lead to this:
<VirtualHost *:80>
ServerName servername/sitename
ServerAlias /sitename
DocumentRoot /var/www/sitename
<Directory /var/www/sitename>
Options Indexes FollowSymlinks
AllowOverride All
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName servername
DocumentRoot /var/www/sitename
<Directory /var/www/sitename>
Options Indexes FollowSymlinks
AllowOverride All
Allow from all
Require all granted
</Directory>
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Here's what I needed:
<VirtualHost *:80>
ServerName servername
Alias "/sitename" "/var/www/sitename"
DocumentRoot /var/www/
<Directory /var/www/sitename>
Options Indexes FollowSymlinks
AllowOverride All
Allow from all
Require all granted
</Directory>
</VirtualHost>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question