Linux – Apache 2.4 vhost not working

apache-http-servercentoslinux

We have a new Centos server installed with Apache 2.4.9. I'm trying to get the vhost working. DNS resolves to the right machine, and I can see the default Apache page, so it's not a firewall issue and Apache runs.

/etc/httpd/conf/httpd.conf

Include conf.d/*.conf

/etc/httpd/conf.d/vhosts.conf

<VirtualHost *>
    ServerName www.abctest.com
    DocumentRoot /websites/abctest.com/htdocs    
    <Directory /websites/abctest.com/htdocs/public>
            AllowOverride All
    </Directory>
</VirtualHost>

ls /etc/httpd/modules

modules/mod_vhost_alias.so

website

In /websites/abctest.com/htdocs is an index.php file with helloworld in it. After restarting httpd, I still get the Apache page, not the helloworld text.

How can I get this working?

Best Answer

Try putting a specific ip and port in each of your VirtualHost blocks. So put:

<VirtualHost 127.0.0.1:80>
Related Question