I'm setting up a server with centos 7 and I have already installed Apache and php. I have tried to set-up a virtual-host to avoid "localhost/xxx.xxx", but now I cannot access to local-host any more. But, if I write the website that I set for the virtual-host and then I go back to the previous page Apache work and it open the php page that I was trying to open. I have tried to delete the virtual host that I have set but I don't remember how to do this.
This is normal if you see it. Since it is the first virtual host entry it will show local host.
but still you can set that up in
<VirtualHost localhost:80> ServerAdmin localhost DocumentRoot /path/to/htdocs/ ServerName localhost </VirtualHost>
To run projects like
<VirtualHost somewebsite.com:80> ServerAdmin firstname.lastname@example.org DocumentRoot /path/to/htdocs/yourwebsiteFolder ServerName www.yourwebsite.com ServerAlias yourwebsite.com </VirtualHost>
then restart httpd daemon using
sudo systemctl restart httpd.service
VirtualHost Examples will help you more.