LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-09-2008, 04:03 AM   #1
M_C
LQ Newbie
 
Registered: Mar 2007
Posts: 26

Rep: Reputation: 15
website Server Alias


hey!
could some one help troubleshoot
i need to be able to open my website without necessarily placing a www. in the address bar
configs below


@ IN SOA ns1.m.com. admin.m.com. (

20070932 ;
3h ;
1h ;
1w ;
10h ) ;

IN NS ns1.m.com.
IN NS ns2.m.com.

IN MX 10 smtp.m.com.


IN A 1.1.1.1 ****is this the problem ? what does this acheive?

ns1 IN A 1.1.1.1
ns2 IN A 2.2.2.2


www IN A 3.3.3.3
smtp IN A 4.4.4.4
ns1 IN A 1.1.1.1
ns2 IN A 2.2.2.2




my vhosts file for the website is as follows

<VirtualHost 3.3.3.3:80>
ServerAdmin admin@m.com
ServerName www.m.com
ServerAlias m.com
DocumentRoot /www//html
ScriptAlias /cgi-bin/ /www//html/cgi-bin/
ErrorLog /www//logs/error_log
</VirtualHost>


if i ping m.com it resolves to ns1.m.com
if i put www.m.com the website site opens
however i would like to be able to put m.com in the address bar without the www and have it resolve the to the website.


thanks

Last edited by M_C; 09-09-2008 at 04:09 AM.
 
Old 09-09-2008, 04:10 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
You should add
Code:
@ IN A 3.3.3.3
in the zone file, increase serial and reload zone. From the apache part you're OK.

Regards
 
Old 09-09-2008, 06:03 AM   #3
M_C
LQ Newbie
 
Registered: Mar 2007
Posts: 26

Original Poster
Rep: Reputation: 15
thanks for the quick response
adding 3.3.3.3 allows me to resolve *.m.com e.g m.m.com however it does not resolve for m.com without the anything before the m, any more suggestions

thanks
 
Old 09-09-2008, 06:33 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
@ is the origin record and it should be the same as the domain name. You can use
Code:
m.com. IN A 3.3.3.3
to achieve the same result. You have to remove "IN A 1.1.1.1" if you want your domain to resolve in 3.3.3.3 as your www
 
Old 09-09-2008, 09:19 AM   #5
M_C
LQ Newbie
 
Registered: Mar 2007
Posts: 26

Original Poster
Rep: Reputation: 15
i'm thinking the problem is with the alias,
here's why : - i have several vhosts files and even after removing IN A 1.1.1.1 it will still resolve *.m.com and not m.com
any other ideas

thanks
 
Old 09-09-2008, 09:34 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
The ServerAlias in your vhost is correct. What is the output of:
Code:
nslookup m.com
nslookup www.m.com
 
Old 09-09-2008, 12:36 PM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Also I always make the ServerAlias in the httpd.conf file as the www or *.domain.com like:

Code:
<VirtualHost 3.3.3.3:80>
ServerAdmin admin@m.com
ServerName m.com
ServerAlias www.m.com
DocumentRoot /www//html
ScriptAlias /cgi-bin/ /www//html/cgi-bin/
ErrorLog /www//logs/error_log
</VirtualHost>
 
Old 09-10-2008, 03:03 AM   #8
M_C
LQ Newbie
 
Registered: Mar 2007
Posts: 26

Original Poster
Rep: Reputation: 15
here's the output
a ping will use round robin and to resolve *.m.com but not m.com neither will the page load
m.com
i'll need to look into this closer away from the production server


[root@webs vhosts]# nslookup m.com
Server: 2.2.2.2
Address: 1.1.1.1#53

Name: m.com
Address: 2.2.2.2



[root@webs vhosts]# nslookup www.m.com
Server: 2.2.2.2
Address: 1.1.1.1#53

Name: m.com
Address: 2.2.2.2
 
Old 09-17-2008, 07:55 AM   #9
M_C
LQ Newbie
 
Registered: Mar 2007
Posts: 26

Original Poster
Rep: Reputation: 15
is it possible to ping a server alias ?
how do i go about testing this ?
 
Old 09-17-2008, 08:20 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Of course you can ping a server alias, since it resolves to a valid IP address.
What I don't understand is the output of the nslookup commands in your previous post. How can "Server" and "Address" be different? How about running nslookup using the dns IP:
Code:
nslookup m.com 1.1.1.1
nslookup www.m.com 1.1.1.1
 
  


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
Disable mail server and allow alias to work? Tony414 Linux - Networking 4 08-22-2008 01:01 PM
How do I create a website alias in Apache? Sysop1911 Linux - Software 8 01-17-2008 07:43 AM
Sendmail Server Alias Problem kaplan71 Linux - Software 0 04-25-2007 07:42 AM
Alias for local web server nrambeck Linux - Networking 6 02-09-2005 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration