LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-20-2004, 10:23 AM   #1
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Rep: Reputation: 15
Unhappy Apache2 running but not?


Hello, I have a problem with apache. I recently installed Mandrake 9.2 and there is no localhost.localdomain or only localhost... Before, I had Mandrake 9.0 and it worked ok. If I understand good - Mandrake 9.2 uses apache2.
With apache2, I installed mysql and php if that makes any changes...

apachectl status
Code:
Apache is running.
httpd2: 3468 3467 3466 3465 3464 3462

Use /usr/sbin/apachectl extendedstatus for more information.
apachectl extendedstatus (after waiting for 1-2 minutes)
Code:
Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/server-status
I checked - status_module (mod_status.so) is not commented in httpd2.conf

After Googling didn't find anything.
Someone said how to check if apache is running:
netstat -ant|grep :80|grep LISTEN
That printed out what is supposed to be ok for apache running
Code:
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
Also other stuff:

apachectl configtest
Code:
Checking configuration sanity for Apache 2.0:                [  OK  ]
httpd2 -S
Code:
VirtualHost configuration:
Syntax OK
This probably isn't ok, the guy on the site had several lines like
"default server omega-fleet.homelinux.org (/etc/httpd/conf/httpd.conf:1219) "
and
"port 80 namevhost omega-fleet.homelinux.org (/etc/httpd/conf/httpd.conf:1219)"

ps aux (relevant
Code:
root      3462  0.0  0.9  4988 2216 ?        S    15:49   0:00 httpd2
apache    3464  0.0  1.0  5200 2320 ?        S    15:49   0:00 httpd2
apache    3465  0.0  1.0  5200 2320 ?        S    15:49   0:00 httpd2
apache    3466  0.0  1.0  5200 2320 ?        S    15:49   0:00 httpd2
apache    3467  0.0  1.0  5200 2320 ?        S    15:49   0:00 httpd2
apache    3468  0.0  1.0  5200 2320 ?        S    15:49   0:00 httpd2
telnet localhost 80
Code:
telnet: connect to address 127.0.0.1: Connection timed out
telnet: Unable to connect to remote host: Connection timed out
Thanks for your time
Relja Arandjelovic
P.S. Sorry for the long post
 
Old 03-20-2004, 02:21 PM   #2
atlesn
Member
 
Registered: Oct 2003
Location: Oslo, Norway
Distribution: RedHat 9.0, Fedora Core 1/2/3, Debian 3.0, Smoothwall
Posts: 110

Rep: Reputation: 15
Can you post the apache2 config-file here?

Last edited by atlesn; 03-20-2004 at 02:22 PM.
 
Old 03-21-2004, 05:20 AM   #3
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks for the answer.
Well, it's huge if I've got the right file (/etc/httpd/conf/httpd2.conf)
Code:
### Main Configuration Section
### You really shouldn't change these settings unless you're a guru
###
ServerRoot /etc/httpd/2.0
#ServerName localhost
#LockFile /etc/httpd/httpd.lock
PidFile /var/run/httpd.pid
ErrorLog logs/error_log
LogLevel warn
DocumentRoot /var/www/html


### Dynamic Shared Object (DSO) Support
### 
### You should always leave those three, as they are needed for 
### normal use.
### mod_access (Order, Allow, etc..)
### mod_log_config (Transferlog, etc..)
### mod_mime (AddType, etc...)

LoadModule access_module	modules/mod_access.so
LoadModule auth_module		modules/mod_auth.so
LoadModule auth_anon_module	modules/mod_auth_anon.so
##LoadModule auth_dbm_module	modules/mod_auth_dbm.so
LoadModule auth_digest_module	modules/mod_auth_digest.so
##LoadModule charset_lite_module	modules/mod_charset_lite.so
##LoadModule case_filter_module	modules/mod_case_filter.so
##LoadModule case_filter_in_module	modules/mod_case_filter_in.so
##LoadModule ext_filter_module	modules/mod_ext_filter.so
LoadModule include_module	modules/mod_include.so
LoadModule log_config_module	modules/mod_log_config.so
##LoadModule logio_module		modules/mod_logio.so
LoadModule env_module		modules/mod_env.so
##LoadModule mime_magic_module	modules/mod_mime_magic.so
##LoadModule cern_meta_module	modules/mod_cern_meta.so
LoadModule expires_module	modules/mod_expires.so
LoadModule headers_module	modules/mod_headers.so
LoadModule usertrack_module	modules/mod_usertrack.so
##LoadModule unique_id_module	modules/mod_unique_id.so
LoadModule setenvif_module	modules/mod_setenvif.so
LoadModule mime_module		modules/mod_mime.so
LoadModule status_module	modules/mod_status.so
LoadModule autoindex_module	modules/mod_autoindex.so
LoadModule asis_module		modules/mod_asis.so
LoadModule info_module		modules/mod_info.so
LoadModule cgi_module		modules/mod_cgi.so
##LoadModule cgid_module		modules/mod_cgid.so
LoadModule vhost_alias_module	modules/mod_vhost_alias.so
LoadModule negotiation_module	modules/mod_negotiation.so
LoadModule dir_module		modules/mod_dir.so
LoadModule imap_module		modules/mod_imap.so
LoadModule actions_module	modules/mod_actions.so
##LoadModule speling_module	modules/mod_speling.so
LoadModule userdir_module	modules/mod_userdir.so
LoadModule alias_module		modules/mod_alias.so
LoadModule rewrite_module	modules/mod_rewrite.so

###
### Global Configuration
###
# We now support multiple apache configurations on the same server. In 
# common.conf, we put all directives that are common to all implementations
# (httpd, httpd-perl, etc.)
# For Apache2 we load all conf files in conf.d
Include /etc/httpd/conf.d/*.conf
Include conf/commonhttpd.conf


###
### IP Address/Port and Proxied configuration section
###
# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
# the fast web server serves static content while Apache handles the 
# cgi or php files

#BindAddress *
<IfDefine APACHEPROXIED>
    Listen 8080
</IfDefine>
<IfDefine !APACHEPROXIED>
    Listen 80
</IfDefine>

# Likewise, we can set apache as the server by default and send perl
# requests via ProxyPass to apache-mod_perl. It increases performance
# since the perl interpreter is only used for perl and the standard apache
# does all the html and image files, with a smaller footprint.
#
# If you install apache and apache-mod_perl, this is the default config.
# If you don't want two web servers to use perl, uninstall apache, and
# apache-mod_perl will not be proxied.

<IfDefine PERLPROXIED>
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^proxy:.*  -  [F]
    RewriteRule ^(.*\/perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]
    RewriteRule ^(.*\/cgi-perl\/.*)$  http://%{HTTP_HOST}:8200$1 [P]
</IfModule>
</IfDefine>

###
### Log configuration Section
###

<IfModule mod_log_config.c>
#Single logfile with access, agent and referer information
#This is the default, if vlogs are not defined for the main server
CustomLog logs/access_log combined env=!VLOG
#If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry
CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG
</IfModule>

###
### Virtual Hosts 
###
# We include different templates for Virtual Hosting. Have a look in the 
# vhosts directory and modify to suit your needs.
Include conf/vhosts/Vhosts.conf
#Include conf/vhosts/DynamicVhosts.conf
#Include conf/vhosts/VirtualHomePages.conf


###
### Performance settings Section
###
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15


# prefork MPM [THIS IS THE DEFAULT]
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
MaxClients         150
MaxRequestsPerChild  0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

# perchild MPM
# NumServers: constant number of server processes
# StartThreads: initial number of worker threads in each server process
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# MaxThreadsPerChild: maximum number of worker threads in each server process
# MaxRequestsPerChild: maximum number of connections per server process
<IfModule perchild.c>
NumServers           5
StartThreads         5
MinSpareThreads      5
MaxSpareThreads     10
MaxThreadsPerChild  20
MaxRequestsPerChild  0
</IfModule>
 
Old 03-21-2004, 05:32 AM   #4
atlesn
Member
 
Registered: Oct 2003
Location: Oslo, Norway
Distribution: RedHat 9.0, Fedora Core 1/2/3, Debian 3.0, Smoothwall
Posts: 110

Rep: Reputation: 15
###
### IP Address/Port and Proxied configuration section
###
# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
# the fast web server serves static content while Apache handles the
# cgi or php files

#BindAddress *
<IfDefine APACHEPROXIED>
Listen 8080
</IfDefine>
<IfDefine !APACHEPROXIED>
Listen 80
</IfDefine>

This is not good. Replace all of this with

###
### IP Address/Port and Proxied configuration section
###
# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
# the fast web server serves static content while Apache handles the
# cgi or php files

#BindAddress *
#<IfDefine APACHEPROXIED>
# Listen 8080
#</IfDefine>
#<IfDefine !APACHEPROXIED>
# Listen 80
#</IfDefine>

Listen 80
 
Old 03-21-2004, 08:38 AM   #5
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Original Poster
Rep: Reputation: 15
Tried, restarted apache - nothing changed
 
Old 03-21-2004, 11:31 AM   #6
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
Since Apache seems OK, I wonder if the problem is at a lower level with the networking. If you haven't, it might be worth double-checking by running these at the command-line:

ping -a localhost
ping 127.0.0.1

If either fail then the issue is the network config. of the system. If both IP and DNS name both work you could try temporarily disabling the firewall to see if that is interfering with access.
 
Old 03-22-2004, 04:28 AM   #7
Relja
Member
 
Registered: Oct 2002
Location: Belgrade, Yugoslavia
Distribution: Linux Mandrake 10.0
Posts: 71

Original Poster
Rep: Reputation: 15
WORKING!! ping said "connect: Network is unreachable", disabling firewall didn't work. But in Mandrake Control Center->Network & Internet when I set DNS Server to 127.0.0.1 (before it wasn't set, value was ...2) and continued, it installed some new stuff and now it's working!
Onlt whn connecting to mysql server, I had to change localhost.localdomain->localhost and everything is fine.
Thanks everyone!
 
  


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
Apache2.0.52, t1lib-5.0.2, php-apache2-5.0.2 wizard7423 Slackware 2 04-04-2011 08:09 PM
apache2 not running mikolaj Slackware 10 09-26-2004 12:00 PM
Apache2 running but not serving any page Kerion Linux - Newbie 4 07-28-2004 05:16 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 11:46 AM
Problem running apache2 G24 Linux - Networking 7 01-01-2004 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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