LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-10-2004, 11:28 PM   #1
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Rep: Reputation: 15
Domain resolves with no www...


Hi Everyone,

I am running SUSE 9.1 with apache2. I have my domain Liviam.ca registered and Public DNS has propagated it. Here is a partial of my zone file; notice that I have a www canonic record that points the the A record of Liviam.ca.

www CNAME 216.221.85.75
mail A 216.221.85.75
@ A 216.221.85.75

(there is more in the zone, but I only included a what was required for this post)

If I use a remote computer (outside of my private network) and type liviam.ca in the address bar, my browser navigates to the opening page. However, if I type www.liviam.ca then it can't find the opening page.

I have to date been using WebMin to administrate apache2 and have tried all sorts of different configurations to get this to work. Currently I have Liviam.ca set as my default site. here are some of the other settings:

Global Settings:

name virtual servers:
liviam.ca:80
liviam.com:80
liviam.ca

Listen on addresses ALL
Listen on port 80

Networking and Addresses for default server:

Server Hostname: liviam.ca

Document Options:

Document root: /srv/www/htdocs
User www directory /srv/www/htdocs

Directory Indexing for default server:

Directory index files:
Liviam_Construction.htm

I also have set Per-Directory Options:

Directory/
Directory /user/share/apache2/error
Directory /user/share/apache2/icons
Directory /srv/www/cgi-bin
Directory /srv/www/htdocs
Directory
/usr/share/apache2/manual
Files regexp ^\.ht

I am very new to apache as I spawned fro the IIS world Needless to say that I am stumped as to why the domain is resolving by name but not the canonic www + domain. I have checked the DNS to ensure that it is configured properly and it is. I only have one static IP so I am using port forwarding through my firewall, but if it can resolve liviam.ca then it should be able to resolve www.liviam.ca. - I don't think the firewall is having any effect. The only area of murkiness is apache2; therefore this is likely where the error is located.

I would really appreciate any suggestions you might have on how to troubleshoot or resolve this issue.

BTW: When I attempt to start apache2 using Webmin I get the following error:
' Failed to start apache :
Starting httpd2 (prefork) [warn]
NameVirtualHost liviam.ca:0 has no VirtualHosts
NameVirtualHost liviam:80 has no VirtualHosts
..done'

However when I open YaST and select /network services/HTTP Server it shows that the server is running. I restarted it here each time I made a configuration change in webmin - kinda a pain in the arse, but it seemed to work.

I also tried using an editor and changed: httpd.conf and then restarted the HTTP Server but again to no avail.

I hope that some of you have some suggestions that can help me get through this.

Truly,
ServerStorm

Last edited by ServerStorm; 11-11-2004 at 12:09 AM.
 
Old 11-11-2004, 12:12 AM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
The hostname www.liviam.ca resolves fine, so you may want to tweak your .conf to look something like this
Code:
<VirtualHost *:80>
ServerName liviam.ca
...
ServerAlias www.liviam.ca
</VirtualHost>
 
Old 11-11-2004, 12:16 AM   #3
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Original Poster
Rep: Reputation: 15
Thanks mcleodnine,

When you say
Quote:
tweak your .conf
do you mean the httpd.conf - there are a lot of .conf files some specific to the default server and the virtual servers?

Truly,
ServerStorm
 
Old 11-11-2004, 12:41 AM   #4
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Yes - httpd.conf is probably the file you want to edit.

Most configurations use '/etc/apache/httpd.conf' or /usr/local/apache/conf/httpd.conf, and you'll need to make sure you're editing the correct one (there can be more if you built from source and the install target is different than the one your particular distribution came with).

As well, if you're hosting a bunch of domains and virtual hosts, you _may_ find it easier to use separate files for each domain and use the apache Include directive. ie: you could create a file like mydomain.com.conf and then use 'Include /etc/apache/mydomain.com.conf' in your main httpd.conf file.
 
Old 11-11-2004, 12:45 AM   #5
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Original Poster
Rep: Reputation: 15
I added

Code:
<VirtualHost *:80>
ServerName liviam.ca
ServerAlias www.liviam.ca
</VirtualHost>
to the httpd.conf file but unfortunately it did not help. I know that it registered the change in the httpd.conf file as when I tried to restart apache2 if gave me an error ( I had mistakenly typed *.80 rather than *:80).

The suggestion seemed good; however is it likely that there is a setting somewhere that is over-riding the httpd.conf?

Truly,
ServerStorm
 
Old 11-11-2004, 12:48 AM   #6
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Heh... I wasn't being literal with my explanation

You really only need to add the ServerAlias to whatever virtualhost you have already setup for that domain. Creating a separate block for the same ServerName will confuse apache and make it cry.
 
Old 11-11-2004, 01:19 AM   #7
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Original Poster
Rep: Reputation: 15
I took your non-literal description and applied it as best as I could.

Midway down the httpd.conf in the Filesystem layout: I saw the following:

Code:
#  |-- listen.confmeVirtualHost liviam.ca:80
            ServerAlias www.liviam.ca
I then receive an error: Syntax error on line 65 of /etc/apache2/httpd.conf: ServerAlias on used in


That is it (not a very helpful error I might add )

I searched the entire httpd.conf file for instances of VirtualHost Liviam.ca and this was the only place. Under the ### Virtual server configuration ### section their is the listing:

Code:
Include /etc/apache2/vhosts.d/*.conf
ServerName liviam.ca
I dont know if I put what you suggested in the correct part, but obviously apache didn't like it.

Truly,
ServerStorm

Last edited by ServerStorm; 11-11-2004 at 01:20 AM.
 
Old 11-11-2004, 01:49 AM   #8
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Uhhh. OK. Let's take a step back here.

The first post in this thread - is that what you see in webmin or are you looking directly at the httpd.conf file?
 
Old 11-11-2004, 01:56 AM   #9
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Original Poster
Rep: Reputation: 15
The first post in the thread is what I saw in Webmin (minus a lot of details). The last post that I presented was looking directly at the httpd.conf file and editing with Kate.

From the second post on I have been editing the httpd.conf file directly and after every edit I have retarted apache2 with Yast.

Truly,
ServerStorm
 
Old 11-11-2004, 02:22 AM   #10
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
In your httpd.conf file you'll need something like this;

NameVirtualHost *

<VirtualHost *:80>
DocumentRoot /path/to/document/root
ServerName foo.com
ServerAlias www.foo.com
AccessLog /path/to/access.log # Optional
ErrorLog /path/to/error.log # Optional
</VirtualHost>

Note that the logging can be done for each domain or can be just whatever the default is in httpd.conf. As well you need only _one_ NameVirtualHost entry
 
Old 11-11-2004, 02:54 PM   #11
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Original Poster
Rep: Reputation: 15
Hi mcleodnine,

I followed your last instructions and it did not work. So then I tried creating a liviamCA.conf file. I included it in the httpd.conf file and I know that it was read as it gave some systax errors that I was able to correct. I also found out how to restart the httpd.conf for apache2 rather than using Yast. It was also good to learn this as
Code:
/usr/sbin/rcapache2
has several useful operators that I was able to see more of what is transpiring. I found errors in the httpd2.conf that I corrected. Once I corrected the errors I performed:
Code:
Code:
/usr/sbin/rcapache2  configtest
It gave me this warning two times:

Code:
[war] -default- VirtualHost overlap on port 80, the first has precedence
Followed by these 2 warnings:
Code:
[warn] namevirtualhost liviam.ca:0 has no VirtualHosts
I suppose that the last warning is because of the overlap Virtual Host error that proceeded it.

Tell me if I am wrong, but I think what is happening is that when the http request comes to apache2 it resolves to the default-VirtualHost and never makes its' way to the virtual server.

What is odd too me is that I removed all references to liviam.ca in the httpd.conf (these references included 192.168.0.10:80). One line I don't understand that is in the httpd.conf file and may be causing the overlap is the following:
Code:
#  |-- ssl-global.conf...meVirtualHost 191.168.0.10:80
# NameVirtualHost 192.168.0.10........ SSL conf that applies to default server_and all_ virtual hosts
Should I remove one or both of these, and if I do should I leave # |-- ssl-global.conf...me and delete VirtualHost 191.168.0.10:80, as well as leave # NameVirtualHost and delete 192.168.0.10? For example these two lines would look like this:
Code:
#  |-- ssl-global.conf...me
# NameVirtualHost ........ SSL conf that applies to default server_and all_ virtual hosts
I am interested in any and all of your suggestions. Thanks so much for the time already invested!

Truly,
ServerStorm
 
Old 11-11-2004, 09:37 PM   #12
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Original Poster
Rep: Reputation: 15
Hi,

I was able to resolve the errors that I wrote about in the last post. I then uninstalled and reinstalled Apache 2, so that I could get a clean set of .conf files (I didn't know how many .conf files there were so I thought this would be my fastest method of clean-up.

When I reinstalled and started appache when I typed Liviam.ca into an browser on a remote machine in the public domain, It resolved to the default apache pages "congratulations if you can see this page then you have successfully....". This means that the default site is working correctly.

Next, I went into the vhosts.d folder and opened the vhost.template and copied its' contents to a new file named liviamCA.conf. I edited this file to contain

Code:
<VirtualHost *:*>
	ServerAdmin mindit@liviam.ca
    
	ServerName liviam.ca
    
	ServerAlias www.liviam.ca mail.liviam.ca
    
	# DocumentRoot: The directory out of which you will serve your
    
	# documents. By default, all requests are taken from this directory, but
    
	# symbolic links and aliases may be used to point to other locations.
    

	DocumentRoot /srv/www/htdocs/Liviam

    

	# if not specified, the global error log is used
    
	ErrorLog /srv/www/htdocs/Liviam/liviam-error_log

    
        # don't loose time with IP address lookups
        HostnameLookups Off


         # needed for named virtual hosts
         UseCanonicalName Off


         # configures the footer on server-generated documents
         ServerSignature On

         #    
         # This should be changed to whatever you set DocumentRoot to.
    
         <Directory "/srv/www/htdocs/Liviam/">

                 #	
                 # Possible values for the Options directive are "None", "All",
                 # or any combination of:
	
                # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
	
                 #	
                 # Note that "MultiViews" must be named *explicitly* --- "Options All"
	         # doesn't give it to you.

                 #	
                 # The Options directive is both complicated and important.  Please see
	         # http://httpd.apache.org/docs-2.0/mod/core.html#options
                 # for more information.
	         #	
                  Options Indexes FollowSymLinks	

                 #	
                 # AllowOverride controls what directives may be placed in .htaccess files.
	
                 # It can be "All", "None", or any combination of the keywords:
                 #   Options FileInfo AuthConfig Limit
	         #	
                 AllowOverride None

                #
                # Controls who can get stuff from this server.
                #
                 Order allow,deny
                 Allow from all 
     </Directory>
	
     DirectoryIndex index.html index.html.var


</VirtualHost>
I then restarted httpd2 and used the remote browser to check if it worked. instead of getting the default Apache pages I got the Liviam home page. I had typed "liviam.com" into the address of the browser. So then I tried www.liviam.com and it did not resolve.

I then went into YaST and Http Server and checked what it had listed under hosts. It had everything that was listed in the liviamCA.conf file with the exception of the ServerAliases ?

I double checked the syntax again and it ran through the configtest again without errors. It does not seem that it recognizes the Server Alias.

Do any of you have an idea why the ServerAlias would not be recognized?

Your thoughts are most appreciated.

Truly,
ServerStorm (and geting more stormy by the day )
 
Old 11-11-2004, 10:10 PM   #13
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Looks like you have some internal resolver issues - www.liviam.com works fine from here.
 
Old 11-12-2004, 12:30 AM   #14
ServerStorm
Member
 
Registered: Oct 2004
Posts: 76

Original Poster
Rep: Reputation: 15
Hmmmm Interesting...

The why if I VNC to a computer that is absolutely not part of my private network and attempt to do www.liviam.ca do I receive the following message?:

Code:
http://sea.search.msn.com/dnserror.aspx?FORM=DNSAS&q=www.liviam.ca
We can't find "www.liviam.ca"

You can try again by typing the URL in the address bar above. 
Or, search the Web:  
   
Go to MSN Search to see complete results for "www.liviam.ca". 

   


Check availability or register the domain name 'www.liviam.ca'.
--------------------------------------------------------------------------------

More information about this error.
About Results

 Not satisfied with your results? Help us improve. 

Powered by  MSN Search
I think by manipulating another computer outside my own network I should be able to resolve the www.liviam.ca - wouldn't you think so?

Truly,
ServerStorm
 
Old 11-12-2004, 12:44 AM   #15
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
that's a search error. (MSN Search is really annoying)

Try 'http://www.liviam.ca' or use a less crappy search site
 
  


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
Email Domain Name Contains WWW CarolinaGal Linux - Newbie 1 11-30-2005 07:10 PM
Cant get entry in bind to work with domain.com instead of www.domain.com pxes351 Linux - Networking 12 05-09-2005 07:20 AM
www.domainduck.com - domain squatting WeNdeL General 20 10-22-2004 05:12 PM
having problems getting the www to work with my domain name slawrence Linux - Networking 2 07-04-2004 11:13 AM
The WWW part in my domain msditech Linux - Newbie 0 12-09-2001 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:30 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