Score:0

Virtual host in Apache redirects to internet ( 301 error)

de flag

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

in flag
Many browsers will cache DNS lookups, which may cause this sort of issue if you have visited the main domain in the past. If you change the virtual host to `.local` instead of `.com`, you should see the correct page. Alternatively, you may want to set up a second browser that is used only for learning purposes
Eduardo Gutiérrez avatar
de flag
Id try..we are using Firefox, maybe its a setting to reset this cache DNS ? CLear cache perhaps ? This site is very strange and i doubt anybody has gone there in the past. Its a personal site of someone not popular. How to setup a second brwoser ? You mean install a new browser ? Thanks
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.