1

I set up a web server on an internal network, running on CentOS 5.5 with the typical LAMP setup. When I'm in my browser and point it toward http://mailroom/ the webpage comes up no problem. However, when I try to go to a subdirectory, I get the 403 error. So, I tried setting up virtual hosts to point to subdomain.mailroom. When I hit the subdomain, the browser tries to add on a www even though my .htaccess says not to. So my question is...
1. Does Apache even recognize anything without a TLD?
2. If it needs a TLD, how would I go about setting up a fake one, like xxxxx.foo?

3 Answers 3

1

Note that a 403 error is usually due to misconfigured file/directory permissions. Apache tries to load/serve a file but can't read it. See here for a good list of other things to check related to a 403.

0
1
  1. Yes
  2. Is better to set up a virtual domain

Just for development use:

On Server:

  1. Set Your virtual host for domain www.example.com (I presume you know how)
  2. add in /etc/hosts

    111.222.333.444 www.example.com www

Restart apache

On your workstation For windows:

in %SystemRoot%\system32\drivers\etc\hosts add:

111.222.333.444        www.example.com

For Linux :

in /etc/hosts add:

111.222.333.444        www.example.com

Restart your browser.

Where 111.222.333.444 is the IP address of your server (mailroom)

Regards

P.S. 403 error you get it because of some permission related problem as uesp specified

1
  • The only problem with that is everyone on the network would potentially need to access this site, and that's a lot of host files to change. But the permissions fixed the issue of the 403 error. I would vote this up, but I don't have access to that feature... Thanks for the input, though!
    – werm
    Mar 18, 2011 at 14:34
0

You need to set up either a DNS server or a host file for that to work. When you're trying to access the subdomain, the client thinks that "mailroom" is the TLD, and searches the DNS root zones for it.

If you want to just do that one server with DNS, you can get away with just making a zone called "mailserver", making the default A record for it go to the actual server, and specify an A record for "subdomain" pointing to the same IP.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .