Simon Suh Simon Suh - 1 month ago 13
Apache Configuration Question

Why won't apache start again when I add a new nameserver in httpd-vhosts.conf file?

I am trying to change my localhost nameservers and I have added the following code to the C:\Windows\System32\drivers\etc\hosts file

127.0.0.1 testingdomainhello.com
127.0.0.1 www.testingdomainhello.com


and I have added the following code to the C:\xampp\apacheconf\extra\httpd-vhosts.conf file

<VirtualHost *:80>
ServerName www.testingdomainhello.com
ServerAlias testingdomainhello.com
DocumentRoot c:/xampp/htdocs/sites/directory
</VirtualHost *:80>


When I add the bit however and try to restart Apache in Xampp, it won't restart, and I'm assuming it's something to do with the port being blocked. How do I solve this so that Apache starts again?

Answer

Bingo that broke it when I used...

</VirtualHost *:80>

So just end your virtual hosts with the tag...

</VirtualHost>
Comments