D
D
David2016-07-25 15:35:07
Apache HTTP Server
David, 2016-07-25 15:35:07

Apache2 virtual host not working. Apache return start page?

Sorry if this topic is repeated, didn't google anything. After installing updates, virtual hosts stopped working. It's just that each host returns the apache start page. And if you add parameters, for example my-host.local/index - then nginx intercepts the work (although I don’t remember installing it at all).
Result sudo apache2ctl -S:

VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost grav.loc (/etc/apache2/sites-enabled/grav.loc.conf:1)
                 alias www.grav.loc
         port 80 namevhost local.node.js (/etc/apache2/sites-enabled/local.node.js.conf:1)
         port 80 namevhost lottery.loc (/etc/apache2/sites-enabled/lottery.loc.conf:1)
                 alias www.lottery.loc
         port 80 namevhost mirage.loc (/etc/apache2/sites-enabled/mirage.loc.conf:1)
                 alias www.mirage.loc
         port 80 namevhost prototype.loc (/etc/apache2/sites-enabled/prototype.loc.conf:1)
                 alias www.prototype.loc
         port 80 namevhost revol.loc (/etc/apache2/sites-enabled/revol.loc.conf:1)
         port 80 namevhost work.loc (/etc/apache2/sites-enabled/work.loc.conf:1)
                 alias www.work.loc
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex rewrite-map: using_defaults
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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Chudnovsky, 2016-07-25
@Frankenstine

You have only one site configured, what do you want?
Do everything according to the documentation, and everything will work as it should.
httpd.apache.org/docs/2.4/mod/core.html#virtualhost

A ServerName should be specified inside each block. If it is absent, the ServerName from the "main" server configuration will be inherited.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question