LinuxQuestions.org
Visit Jeremy's Blog.
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-23-2007, 08:44 AM   #1
MJWhiteDerm
LQ Newbie
 
Registered: Mar 2007
Posts: 14

Rep: Reputation: 0
Apache2 under Ubuntu - Virtual Host error on restart


Hello all.

I'm running Apache2 under Ubuntu 7.04, FeistyFawn. I am fortunate to have fiber optic right to the house, and have a range of fixed IP addresses. I tried running several different web pages under Suse 10.1, with different external IP addresses. Now I'm trying to make Apache2 work on a single server and my router points all external port-80 calls to one box, which is the Ubuntu box in question.

When I do a sudo /etc/init.d/apache2 restart command, the following is the result:

michael@carolyn-ubuntu:~$ sudo /etc/init.d/apache2 restart
* Forcing reload of apache 2.0 web server... [Sun Sep 23 08:20:02 2007] [error] (EAI 2)Name or service not known: Cannot resolve host name cthia --- ignoring!
[Sun Sep 23 08:20:02 2007] [error] (EAI 2)Name or service not known: Cannot resolve host name rationaldruids --- ignoring!
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Sun Sep 23 08:20:02 2007] [error] (EAI 2)Name or service not known: Cannot resolve host name cthia --- ignoring!
[Sun Sep 23 08:20:02 2007] [error] (EAI 2)Name or service not known: Cannot resolve host name rationaldruids --- ignoring!
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Can anyone point me to which configuration file has a problem and what the nature of the problem may be?

In addition to here, my personal email is michael.white@gemair.com

In addition to running two boxes with Ubuntu 7.04, I'm also running a Xandros box and a Suse 10.1 box. I have played with RedHat 8.0 and Mandrake 8.1 before.

Michael
 
Old 09-23-2007, 09:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
well you've apparently used references to local machine names that don't exist within the DNS your server has access to... how did you make these changes? you sound like you're not sure what underlying files contain this config.. did you use some gui tool to do things? what did you do? what are you trying to achieve? your httpd.conf would be a good start if you want to get a good implementation working, but in terms of the errors listed there, they are not in DNS. you probably could just get away with adding the hostnames to /etc/hosts for a small implementation.
 
Old 09-23-2007, 09:27 AM   #3
MJWhiteDerm
LQ Newbie
 
Registered: Mar 2007
Posts: 14

Original Poster
Rep: Reputation: 0
more specifics

These are all directories on one machine.

Apache2 under unbuntu uses apache2.conf instead of httpd.conf .. and the latter file is kept merely for backwards compatibility.

Initially, I read Apache - The Definitive Guide, re: apache2 configuration, but the setup under ubuntu doesn't match the setup as written in the Guide. Then, the section on Apache in the Unbuntu Linux Bible and it sort of worked. That is, I could see a single web page from outside the firewall. But when I tried to add virtual host configuration files under sites-available, they would only be visible if I used http://64.91.78.105/laxlinux or 105/rationaldruids or 105/primumnonnocere (first, do no harm -- I'm a physician). So, I asked other people for advice, including on the ubuntu forums, and someone suggested using webmin, which I downloaded. It screwed things up, so I de-installed apache2 and reinstalled it. Now, from the lan, I can see each of the web pages, but again, I have to enter in the local lan address then the directory name. When I do the apache2 restart, I see the text I copied before. So webmin did something and I'm trying to figure out what.

My goal is to have this particular box (one of 8 in the house) serve as a web server for several different web pages I'm playing with. Most are just hobbies. I have a couple of more serious ones that I manage on servers elsewhere. My design skills are pretty weak, but I'm learning.

I also manage www.karhide.com www.dermeducation.com www.wisconsindermsociety.com or .org

So, do I need to run a DNS server? I don't think I had it running before I messed things up with webmin.

Thanks.

Michael
 
Old 09-23-2007, 09:38 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
well i'm not sure where these hostnames that aren't being resolved are coming into the equation in the first place... as above, please post the actual config.
 
Old 09-23-2007, 09:51 AM   #5
MJWhiteDerm
LQ Newbie
 
Registered: Mar 2007
Posts: 14

Original Poster
Rep: Reputation: 0
actual configuration

I think you mean the actual configuration files.

To be more specific, I have the following directories under /var/www :
michael@carolyn-ubuntu:/var/www$ ls
apache2-default cthia laxlinux primumnonnocere
apache2-default-modified-doesn't-work DermEducation MikhailBadenov rationaldruids
michael@carolyn-ubuntu:/var/www$

Within apache2-default, there is the usual "If you see this, Apache works" index.html ... and http://localhost calls that up.

There is an index page within each of the other directories, which is visible if I enter: http://localhost/cthia etc. From elsewhere on the lan, http://192.168.1.37/cthia calls it up. www.cthia.com should pull it up from outside. Likewise, www.primumnonnocere.org should pull up the correct page. nslookup will show 64.91.78.105 for www.cthia.com and .107 for laxlinux. I've asked my provider to move them all to 105 to solve some problems I have with my current Cisco router.

This is the content of httpd.conf :
" # This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so "

The default apache2.conf is lengthy. Do you need to see it?

Within /etc/apache2/sites-available/ there is a file for each website. The default file is:

"NameVirtualHost *
# This is the unmodified default file under /etc/apache2/sites-available
<VirtualHost *>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
RedirectMatch ^/$ /apache2-default/
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>


end of cut and paste

I hope I'm giving you the information you are looking for. I'm not trying to be obtuse.

Thanks.

Michael
 
Old 09-23-2007, 10:02 AM   #6
MJWhiteDerm
LQ Newbie
 
Registered: Mar 2007
Posts: 14

Original Poster
Rep: Reputation: 0
I asked a friend to check the sites from outside the firewall. www.cthia.com shows "If you see this, it means the installation of the Apache web server software on this computer was successful. You may now add content to this directory and replace this page." 64.91.78.105/cthia shows the intended page ... (despite the strange warning message). /laxlinux and /primumnonnocere and /rationaldruids show nothing .... so I have something screwed up in the virtual hosting files, I think.
 
Old 09-23-2007, 11:13 AM   #7
MJWhiteDerm
LQ Newbie
 
Registered: Mar 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Problem semi-fixed

Webmin had created some files within /etc/apache2/sites-enabled which had a name and no content. Once those were removed, some of the problems have now gone away.

I still get the following on apache2 restart:
" * Forcing reload of apache 2.0 web server... apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName "


Any idea in what config file the problem might be hiding?

Michael
 
Old 09-23-2007, 12:25 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
well that's just a harmless warning, not a problem. it's down to the machine not being able to find an fqdn for itself, if you run "hostname -f" you'll probaly only get "localhost" or "dave" or whatever your machine is called, not "dave.example.com" which would be an fqdn. if you define your hostname and a domain name correctly that will go away.
 
Old 09-23-2007, 12:30 PM   #9
MJWhiteDerm
LQ Newbie
 
Registered: Mar 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Problem Fixed

I found the answer in another thread, and just implemented it a few minutes ago. This is what I posted there:

As described above, I put in

ServerName cthia.com

as an uncommented line, in the top of apache2.conf

Now, when I force reboot apache2, I get:

michael@carolyn-ubuntu:/etc/apache2/sites-available$ sudo /etc/init.d/apache2 restart
Password:
* Forcing reload of apache 2.0 web server... [ ok ]
michael@carolyn-ubuntu:/etc/apache2/sites-available$

So, the solution, as suggested, works fine.

This is NOT covered in the Ubuntu Linux Bible, or in The Official Unbuntu Linux book.

Michael


Thanks, again.

Michael
 
Old 09-23-2007, 02:02 PM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
well yes you can manually force it, always nicer to have a technically correct solution really... that's nothing to do with Ubuntu though, so i wouldn't think about blaming their documentation for a subtlety of an unrelated package they have no control over.
 
Old 09-23-2007, 07:36 PM   #11
MJWhiteDerm
LQ Newbie
 
Registered: Mar 2007
Posts: 14

Original Poster
Rep: Reputation: 0
Ubuntu vs other versions

Actually, I wasn't meaning to assign "blame" ... not a word I like to use.
I think it does reflect a slightly different implemntation of apache2 under ubuntu than the version I downloaded (on another computer) directly from apache.org ... in that there are different configuration files. Since the stuff I read didn't mention the issues I discovered, either it isn't there, or I haven't yet read the right stuff. It's probably the latter case.

At any rate, it's nice to find part of the solutions. I'm still working on the rest. Another voyage of discovery. ;-)

Michael
 
  


Reply

Tags
apache2, apache2conf, ubuntu704, webserver


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
Apache2 virtual host. hgb Linux - Networking 10 01-24-2009 02:05 AM
Apache2 Virtual Host SSI problems superscrappy Linux - Software 1 08-30-2005 05:04 PM
apache2 help -Virtual Host- Fredstar *BSD 4 06-06-2005 01:09 PM
Can't do Apache2 virtual host different ports SK_pt Linux - Software 3 01-30-2005 07:04 PM
apache2, virtual host problems rjcrews Linux - Software 13 05-25-2004 08:16 PM


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