EMS

BANNED
May 10, 2003
250
0
166
Scenario: Customer creates a subdomain.

Problem: When navigating to the subdomain in a browser, the main domain is displayed, not the contents of maindomain/subdomain

I can navigate to the maindomain/subdomain folder - this has been created fine.

Whats wrong ?


Here is the httpd.conf entry for the subdomain...

<VirtualHost xx.xx.xx.xx>
ServerAlias www.SUBDOMAIN.MAINDOMAIN.com
ServerAdmin [email protected]
DocumentRoot /home/USERNAME/public_html/FOLDER
BytesLog domlogs/SUBDOMAIN.MAINDOMAIN.com-bytes_log
ServerName SUBDOMAIN.MAINDOMAIN.com

<IfModule mod_userdir.c>
Userdir disabled
Userdir enabled USERNAME
</IfModule>

<IfModule mod_php4.c>
php_admin_value open_basedir "/home/USERNAME:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/USERNAME:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>

User USERNAME
Group USERNAME
CustomLog /usr/local/apache/domlogs/SUBDOMAIN.MAINDOMAIN.com combined
ScriptAlias /cgi-bin/ /home/USERNAME/public_html/FOLDER/cgi-bin/
</VirtualHost>
 
Last edited:

webignition

Well-Known Member
Jan 22, 2005
1,876
1
166
Try changing:

Code:
ServerAlias www.SUBDOMAIN.MAINDOMAIN.com
to

Code:
ServerAlias SUBDOMAIN.MAINDOMAIN.com www.SUBDOMAIN.MAINDOMAIN.com
Also, if you have wildcard subdomains set up and the ServerAlias section of the VirtualHost was not set correctly, it's possible that you might encounter the problem you describe.
 

EMS

BANNED
May 10, 2003
250
0
166
Thanks for your help.

This still doesnt work.

I've removed the subdomains and added a new one test.maindomain.com then checked the httpd.conf - it looks fine. Ive even taken your suggestion and changed the serveralias - same thing. Any subdomain that is added simply displays the main domain.

This is driving me nuts.

Can anyone hlep !!
 
Last edited:

EMS

BANNED
May 10, 2003
250
0
166
Hi, If anyone has experienced this problem before or could shed some light on it for me I'd be very grateful.

I've done everything I can think of, including recompiling apache but any subdomains that get added just point to the main domain.


Additional info...

- Its just this one account with the problem.
- httpd.conf entry for this subdomain is fine - same as another that works ok
- this domain is on a fixed IP (could this be related somehow)
 
Last edited:

EMS

BANNED
May 10, 2003
250
0
166
mgsnnetworks said:
It sounds like a httpd problem try checking your httpd confıg for errors
Looks fine, what should I be looking for ?
 

elitewebninja

Active Member
Jan 2, 2004
43
0
156
Atlanta Ga!
Since the domain is on a fixed IP, YOU MUST have a NameVirtualHost entry for that IP address. Do you have a NameVirtualHost entry for that IP?

Make sure you have one... should look like this:

NameVirtualHost XXX.XXX.XXX.XXX:80

Replace the XXX.XXX.XXX.XXX with the ip of course. This can be anywhere in the httpd.conf file, but I usually put it above the first entry for the domain so I can keep track of it.

Here's an example of what it should look like:
***********************************************

NameVirtualHost XXX.XXX.XXX.XXX:80

<VirtualHost xx.xx.xx.xx>
ServerAlias www.SUBDOMAIN.MAINDOMAIN.com
ServerAdmin [email protected]
DocumentRoot /home/USERNAME/public_html/FOLDER
BytesLog domlogs/SUBDOMAIN.MAINDOMAIN.com-bytes_log
ServerName SUBDOMAIN.MAINDOMAIN.com

<IfModule mod_userdir.c>
Userdir disabled
Userdir enabled USERNAME
</IfModule>

<IfModule mod_php4.c>
php_admin_value open_basedir "/home/USERNAME:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/USERNAME:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>

User USERNAME
Group USERNAME
CustomLog /usr/local/apache/domlogs/SUBDOMAIN.MAINDOMAIN.com combined
ScriptAlias /cgi-bin/ /home/USERNAME/public_html/FOLDER/cgi-bin/
</VirtualHost>

***********************************************

I bet this is your problem... let us know if this fixes it :)
 
Last edited:

EMS

BANNED
May 10, 2003
250
0
166
You truly are an elite web ninja !

NameVirtualHost was missing - added it in, works fine now !

Thanks for your help !
 

RizyDeWino

Well-Known Member
Aug 1, 2005
74
0
156
Planet Earth
Thanks for the help !

Now I am only wishing that I should have searched the forum before spending hours to solve this issue. I tried dozens of solution but nothing worked.

NameVirtualHost was missing for only that spefic IP.
 

chodan

Registered
Nov 8, 2004
2
0
151
problem re-occurs

How do we keep this problem from re-occurring. I dont want to have to mannually edit the httpd.conf every time our web dev adds a subdomain. Is there any preventative measures to take? or a fix?