Answer the question
In order to leave comments, you need to log in
Apache2 virtual host why not redirect?
Good day.
There is a VPS, the domain is delegated, DNS is configured and working.
Created my own virtual hosts config in /etc/apache2/sites-available/site.ru.conf folder Site
directory /var/www/site.ru
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName site.ru
ServerAlias www.site.ru
DocumentRoot /var/www/site.ru
ErrorLog /var/log/apache2/site/error.log
CustomLog /var/log/apache2/site/access.log combined
<Directory /var/www/site.ru>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
apache2ctl configtest && apache2ctl graceful
??
Have you restarted Apache? Is site.ru mentioned anywhere else in the configs?
first compare the address from nslookup site.ru and apache2ctl -S with the IP hosting the virtualhost
Yuriy romy4
Config test OK, rebooted, ip matches
apache2ctl -S
VirtualHost configuration:
*:80 is a NameVirtualHost
default server site.ru (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost site.ru (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost site.ru (/etc/apache2/sites-enabled/site.ru.conf:1)
alias www.site.ru
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question