LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-08-2012, 10:10 PM   #1
B-Rye
LQ Newbie
 
Registered: Apr 2012
Posts: 14

Rep: Reputation: Disabled
site only works with www. in front of domain name


DOMAIN #1 setup and working when i took over the server
- works with and without www.
- /home/domain1/public_html

DOMAIN #2 just setup
- works with www.
- without the www. gives generic cgi - apache is working page urlshows up as domain2.com/cgi-sys/defaultwebpage.cgi
- /home/domain2/public_html



httpd.conf
----------


NameVirtualHost serverip:80


# THIS IS WORKING PERFECTLY BOTH WITH AND WITHOUT THE WWW.
# was adding by old IT guy
<VirtualHost serverip:80>
ServerName domain1.com
ServerAlias www.domain1.com
DocumentRoot /home/domain1/public_html
ServerAdmin admin@here.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/domain1.com combined
CustomLog /usr/local/apache/domlogs/domain1.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
<IfModule !mod_disable_suexec.c>
SuexecUserGroup domain1 domain1
</IfModule>
ScriptAlias /cgi-bin/ /home/domain1/public_html/cgi-bin/
</VirtualHost>


# WORKING WITH WWW. W/O GOES TO GENERIC CGI - APACHE IS WORKING PAGE
#added by me
<VirtualHost serverip:80>
ServerName www.domain2.com
ServerAlias domain2.com
DocumentRoot /home/domain2/public_html
ServerAdmin admin@here.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/domain2.com combined
CustomLog /usr/local/apache/domlogs/domain2.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
<IfModule !mod_disable_suexec.c>
SuexecUserGroup domain2 domain2
</IfModule>
ScriptAlias /cgi-bin/ /home/domain2/public_html/cgi-bin/
</VirtualHost>


I'm confused as to where to go from here.
 
Old 04-09-2012, 07:18 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
How did you configure the dns records ?
 
Old 04-09-2012, 08:19 AM   #3
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,352

Rep: Reputation: 773Reputation: 773Reputation: 773Reputation: 773Reputation: 773Reputation: 773Reputation: 773
I think you gave your ServerName ans ServerAlias mixed up for the second server.

Last edited by 273; 04-09-2012 at 08:21 AM.
 
Old 04-09-2012, 08:53 AM   #4
B-Rye
LQ Newbie
 
Registered: Apr 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
This is what he had for the working domain.
I just edited this file for the 2nd domain.




; cPanel first:11.30.6.6 (update_time):1333933079 Cpanel::ZoneFile::VERSION:1.3 hostname:ims.theplanet.com latest:11.30.6.6
; Zone file for domainhere.com
$TTL 14400
domainhere.com. 86400 IN SOA ns1.ournameserverhere.com. emailhere. (
2012040901 ;Serial Number
86400 ;refresh
7200 ;retry
3600000 ;expire
86400 ;minimum
)

domainhere.com. 86400 IN NS ns1.nameserver.com.
domainhere.com. 86400 IN NS ns2.nameserver.com.
domainhere.com. 86400 IN NS ns2.nameserver.com.
domainhere.com. 86400 IN NS ns1.nameserver.com.


domainhere.com. 14400 IN A ourip

localhost 14400 IN A 127.0.0.1

domainhere.com. 14400 IN MX 0 domainhere.com.

mail 14400 IN CNAME domainhere.com.
www 14400 IN CNAME domainhere.com.
ftp 14400 IN A iphere
test 14400 IN A iphere
www.test 14400 IN A iphere
cpanel 14400 IN A iphere
whm 14400 IN A iphere
webmail 14400 IN A iphere
webdisk 14400 IN A iphere
maintenance 14400 IN A iphere
www.maintenance 14400 IN A iphere
 
Old 04-09-2012, 08:55 AM   #5
B-Rye
LQ Newbie
 
Registered: Apr 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by 273 View Post
I think you gave your ServerName ans ServerAlias mixed up for the second server.
I was messing around to see if it reversed my problem. it does not seem to make a difference
 
Old 04-17-2012, 01:23 AM   #6
suj
Member
 
Registered: Dec 2009
Posts: 33

Rep: Reputation: 1
Hi,

Double check that you have specified same ip in <VirtualHost serverip:80> (in apache conf) and in your domain A record.

Create a test file in public_html directory and access it via web browser. Is it loading fine..?
 
Old 04-17-2012, 11:44 AM   #7
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 270

Rep: Reputation: 113Reputation: 113
Did you change the DNS entry for www.domain2.com recently? Your TTL seems to be 4 hours, so if this was changed more recently than that, you could still have an old old value cached by your client machine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind9 all *.domain.com reachable, only www.domain.com isn't TonyDeWittePony Linux - Server 1 07-14-2011 01:03 PM
Apache site redirects using what rule? foo.site.com -> www.site.com/foo LaughingBoy Linux - Server 2 04-16-2009 09:51 PM
DNS http:domain.com resolve to www.domain.com keysorsoze Linux - Networking 3 02-12-2007 03:03 AM
FC6 ping on terminal works with www.google.com, not with http://www.google.com pxumsgdxpcvjm Linux - Networking 4 12-27-2006 03:36 PM
Cant get entry in bind to work with domain.com instead of www.domain.com pxes351 Linux - Networking 12 05-09-2005 06:20 AM


All times are GMT -5. The time now is 11:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration