4

I have to install and configure Apache in Debian, it all works fine, and in one point I have to use Lynx to show it works. I have edited the configuration page like this:

(VirtualHost *:80)
 ServerName page.com
 ServerAlias www.page.com
 DocumentRoot /var/www/page1

 ErrorLog /var/log/apache2/error_site_page
(/VirtualHost)

then I use Lynx to access www.page.com and it says Unable to access document. But if I try to access just page.com it works fine.

  • 2
    www.page.com needs to resolve to an IP address. Have you added www.page.com into your /etc/hosts file so that it resolves ? – steve Aug 5 '15 at 20:27
  • 1
    thank you so much, it was that! . I dont have a computer to work at the moment, just a couple of hours to work in my university so I couldnt have more time to think about it, thanks again! – lelp89 Aug 5 '15 at 20:31
1

Generally, allowing other systems to access the site under www.page.com requires it to be added to a DNS server telling that all traffic to www.page.com should go to page.com through a so called "alias". Generally you add that to the same DNS server that holds the " page.com" entry.

Note that adding "www.page.com" to you /etc/hosts (as suggested in the comments) will only fix accessing it from the system were you have added it. So if you add it to the hosts file of the system running the Apache instance, it will only work on that system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.