LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 11-12-2008, 03:07 PM   #1
philwynk
Member
 
Registered: Sep 2007
Posts: 84

Rep: Reputation: 15
Can't reach restored apache server on Fedora 9


Hi, all,

I wound up installing Fedora 9 fresh to a clean filesystem and I'm attempting to configure the web server from a backup created under Fedora 8.

I restored /etc/httpd, installed mysql and mysql-server, restored the web server's database to /var/lib/mysql, restored all the php code to /var/www/html, chowned everything to the right names (apache.web, mysql.mysql, and apache.web owns the html tree.) Then I fired up apache and mysql, and they seem to be running ok.

However, the web site does not respond when I type it into the URL bar. It hangs 90 seconds and then times out.

I noticed on a reboot that when starting the httpd, I get a message that reads something like:

Quote:
Could not reliably determine host's fully qualified domain name, using 127.0.0.1...
... but it flies by too fast for me to read what it's using 127.0.0.1 for.

Mind you, this is the same httpd.conf I was using under Fedora 8. Apparently I had some error in there that Fedora 9's apache likes less than Fedora 8's did; either that, or I made some error when setting up the network for the new environment.

Network details: My host is simply localhost.localdomain. I accept an address from a DHCP server, which happens to be a dinky little router in my living room. The router, in turn, accepts a DHCP address from Comcast, my ISP, and also bounces his address off to DynDNS, which performs dynamic DNS services and updates the name servers around the world with the new location of my domain. The router also forwards http requests to port 80 on the IP address it assigned me.

Any ideas why my apache server can't resolve his own name?

Thanks in advance.
 
Old 11-13-2008, 01:15 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Hmm I seem to remember experiencing something similar when I started playing with LAMP a while ago.

This is for Apache 2.0.54 which I'm running with MySQL 4.1.12 and PHP5.

Have you checked that your httpd.conf contains this:

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
#ServerName www.example.com:80
ServerName yourdomain.com:80

#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName On

?

Then again, it might just be better to install from scratch, rather then from a backup, especially as regards the applicatons themselves. I have done exactly what you have done a few times (i. e. upgraded from an older RedHat version to Fedora and between Fedora versions) and I usually do it by:

1. Clean installing the new Linux version.
2. Clean compiling and installing Apache, MySQL and PHP
3. Only then copying html and php into the relevant directories from backup
 
Old 11-14-2008, 05:56 AM   #3
philwynk
Member
 
Registered: Sep 2007
Posts: 84

Original Poster
Rep: Reputation: 15
Quote:
Have you checked that your httpd.conf contains this:

ServerName yourdomain.com:80
UseCanonicalName On
It did not, and I've never needed it before.

However, I just made those changes at your suggestion, and restarted clean. It made no difference. I've gotten rid of the startup error message, but when I try to access the web site, I time out.

Here's what shows up in the httpd access_log when I try to reach the site:

127.0.0.1 - - [14/Nov/2008:06:42:56 -0500] "GET / HTTP/1.1" 301 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.2) Gecko/2008092318 Fedora/3.0.2-1.fc9 Firefox/3.0.2"

Does that tell you anything? I'm clueless.


Quote:
I usually do it by:

1. Clean installing the new Linux version.
2. Clean compiling and installing Apache, MySQL and PHP
3. Only then copying html and php into the relevant directories from backup
That's pretty much what I did, too, only I don't compile, I let yum do the install. I've found the whole "make" process arcane and unmanageable, since I've never programmed in the UNIX environment apart from scripting (PERL and the Korn shell) and I haven't got all the concepts to understand what "make" is looking for.

Apache and PHP are already installed in Fedora 9, so I reinstalled mysql:

yum install mysql mysql-server mysql-administrator

Then I reinstalled the relevant directories: specifically, I restored the wordpress code from /var/www/html down, and I restored /var/lib/mysql, where all the data from the existing web site reside. I also restored /etc/httpd/conf and /etc/httpd/conf.d. Then I chown'd everything to the right user and group, made sure httpd and mysql were running, and opened ports 80 and 443 on the firewall. In the past, that's all I needed.

That's where I am now, and my web site has been down for 3 days solid. This is a f***ing disaster. My readers are emailing me asking where I've gone. My readership will be down more than half when I get back up. Help!

Oh, for the record:

mysql Ver 14.12 Distrib 5.0.51a, for redhat-linux-gnu (i386)
Server version: Apache/2.2.9 (Unix)
PHP 5.2.6

Last edited by philwynk; 11-14-2008 at 06:06 AM.
 
Old 11-20-2008, 12:03 AM   #4
yzhong
Member
 
Registered: Jun 2007
Location: sydney
Distribution: redhat , ubuntu, centos
Posts: 56

Rep: Reputation: 16
1.Do you check the label is correct? (Normally error in /var/log/messages)
2.Assume you don't use iptables or didn't block port 80
 
Old 11-20-2008, 01:19 AM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Let's see the results of:
  • # netstat -ltn | grep ':80\>'
  • # grep '^Listen' /etc/httpd/conf/httpd.conf
  • # httpd -v

It sounds like Apache web server is listening only on your loopback interface.

[ By the way, this will be a lesson you should not forget. You need a test server for testing upgrades. ]
 
Old 11-21-2008, 07:15 AM   #6
philwynk
Member
 
Registered: Sep 2007
Posts: 84

Original Poster
Rep: Reputation: 15
My apology for not posting the resolution of this issue.

It turned out that there were two problems:

1) I had neglected to open the http ports in the firewall.

2) I had thought I had assigned a static IP address in the installation process, but in fact it was only a temporary address and the machine was booting off the DHCP server. The router was forwarding port 80 traffic to a host with a static address that did not exist.

Once I got the fundamental IP things right, everything worked fine. Thanks for your help, everybody.
 
  


Reply

Tags
apache, domain



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
Can a crashed server be restored? Frankc22 Linux - Security 12 04-13-2007 05:22 PM
LXer: Debian Server restored after Compromise LXer Syndicated Linux News 0 07-14-2006 02:54 AM
can't reach new server wedgeworth Linux - Software 2 03-18-2004 02:39 PM
Reach web page from Apache Red Hat Server zeljka Red Hat 1 01-06-2004 12:19 PM

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

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

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