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'm having a bit of trouble getting a subdomain activated on my local dev server. The server's name is janemba and I access it by going to http://janemba. I'd like to be able to have domain.janemba, but I can't seem to get it to work.

This is the VirtualHost I have:

<VirtualHost *:80>
        ServerName domain.janemba
        ServerAdmin admin@janemba
        DocumentRoot /var/www/domain

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I've also tried making it domain.example.com and setting my hosts file to make example.com point to my local dev server. Example.com loads fine, but subdomains will not.

share|improve this question
1  
ubuntuforums.org/showthread.php?t=3407 - Check this. The system should be able to resolve the domain.janemba first, then Apache will handle it. –  Rolice Aug 16 at 11:42
    
The host shouldn't be the issue here. I guess I should mention that I'm trying to access this from a separate computer on the same network. –  Atrox Aug 16 at 12:13
1  
Then certainly you have to add such record to the other machine I suppose. You are not creating hostname there, you mark the domain to be resolved to the host IP or name. –  Rolice Aug 16 at 13:56
    
The host file is set up on the other machine, as stated in the question (albeit not very clearly). –  Atrox Aug 16 at 17:02
    
As I read it you have set it up on the local machine, but not visitor's one. You can ping and traceroute to check for the results. –  Rolice Aug 17 at 8:26

2 Answers 2

I think it's a DNS problem, you can test this in dos / cmd prompt by doing ping domain.janemba and see what you get as compared to ping janemba

Do you have DNS set up? I think you need to either have an internal private dNS server with zone files including records for the subdomains you want, or you need to enter those subdomains into your client computer's hosts file.

update: just noticed you are using your 'hosts' file - just add a new line for each subdomain record.

Once your computer is looking to the correct ip address of the server, the subdomains should work.

share|improve this answer
    
Tried doing this but it doesn't point to the web root of the subdomain. I can go to the subdomain URL, but I just see the main root. –  Atrox Aug 16 at 17:03

Maybe you have forgotten to enable Virtual Hosts? Do you have:

NameVirtualHost *:80

somewhere in your httpd.conf or included conf files?

share|improve this answer

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.