I have one wm with ubuntu 18.04 and one network adapter set to NAT.
I have setup a virtualhost I created servidorweb.orange.sergitorres.com.conf in sites-avalaible and enabled using a2ensite.
Apache is running without problems.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName servidorweb.orange.sergitorres.com
DocumentRoot /var/www/html/
ErrorLog ${APACHE_LOG_DIR}/errorweb.log
CustomLog ${APACHE_LOG_DIR}/accesweb.log combined
</VirtualHost>
Also setup /etc/hosts:
127.0.0.1 servidorweb.orange.sergitorres.com
But when i type in Browser (Firefox):
127.0.0.1 -> it works -> shows default apache index.html
localhost -> it works showing default apache index.html
but when i type
servidorweb.orange.sergitorres.com, it goes to a site called www.sergitorres.com, outside in internet.
If i anlayse the http request it says: Error 301 moved permanently
Seems that header request is good with servidorweb.orange.sergitorres.com but response header comes from www.sergitorres.com.
i want to teach virtualhosts, and dont know why it goes outside internet ( www.sergitorres.com is an internet address not a local or virtual host).
Any help would be apreciated
pd: also changed the name of hostname to servidorweb.orange.sergitorres.com