There is a server in Ubunt in LAN, it has the name servername and there is an apache on the server, if you go to servername, you can see that the apache is working. I need virtual hosts to be available at url servername / sitename. This site-available code 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> 

If you do like this, then it is expected on the servername climber climbs.

 <VirtualHost *:80> ServerName servername DocumentRoot /var/www/sitename <Directory /var/www/sitename> Options Indexes FollowSymlinks AllowOverride All Allow from all Require all granted </Directory> 

Chyadt?

1 answer 1

Did I understand you correctly, that you want to access the site at the URL http: // servername / sitename ? If yes, then it would be more logical for you to do

 DocumentRoot /var/www/servername <Directory /var/www/servername/sitename> ... </Directory> 
  • one
    In general, yes, more correctly, but I needed this: <VirtualHost *: 80> ServerName servername Alias ​​"/ site" "/ var / www / site" DocumentRoot / var / www / <Directory / var / www / site> Options Indexes FollowSymlinks AllowOverride All Allow from All Require all granted </ Directory> </ VirtualHost> - qbudha
  • But once again thinking, I came to the conclusion that your answer in the context of the question is absolutely correct and the solution works. - qbudha