Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
That part worked! Thank you! –  werm Mar 18 '11 at 14:34
add comment
  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

share|improve this answer
    
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 '11 at 14:34
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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