Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't start apache2, no errors but no serving[solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sat Nov 01, 2003 4:00 am    Post subject: Can't start apache2, no errors but no serving[solved] Reply with quote

I just emerged apache2 on a soon-to-be server, and it simply refuses to start. Typing /usr/sbin/Apache2 doesn't seem to do anything...no errors, no confirmations, nothing. /etc/init.d/apache2 gives me the following:

Code:
 * Starting apache2...                                                      [ !! ]


It still doesn't start, an lsof -i shows that nothing is listening on port 80.

/etc/apache2/conf/apache2.conf:
Code:
### /etc/apache2/conf/apache2.conf
### $Id: apache2.conf,v 1.3 2003/09/25 02:20:48 woodchip Exp $
###
### Main Configuration Section
### You really shouldn't change these settings unless you're a guru
###
ServerRoot /etc/apache2
ServerName fileserver
#LockFile /etc/apache2/apache2.lock
PidFile /var/run/apache2.pid
ErrorLog logs/error_log
LogLevel warn
DocumentRoot /home/httpd/htdocs

### Dynamic Shared Object (DSO) Support
###
### You should always leave these 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 include_module                modules/mod_include.so
LoadModule log_config_module             modules/mod_log_config.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 proxy_module                  modules/mod_proxy.so
LoadModule proxy_connect_module          modules/mod_proxy_connect.so
LoadModule proxy_ftp_module              modules/mod_proxy_ftp.so
LoadModule proxy_http_module             modules/mod_proxy_http.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

###
### New Modules for 2.0 (some are experimental)
###
LoadModule file_cache_module             modules/mod_file_cache.so
LoadModule echo_module                   modules/mod_echo.so
LoadModule charset_lite_module           modules/mod_charset_lite.so
LoadModule cache_module                  modules/mod_cache.so
LoadModule disk_cache_module             modules/mod_disk_cache.so
LoadModule mem_cache_module              modules/mod_mem_cache.so
LoadModule ext_filter_module             modules/mod_ext_filter.so
LoadModule case_filter_module            modules/mod_case_filter.so
LoadModule case_filter_in_module         modules/mod_case_filter_in.so
LoadModule deflate_module                modules/mod_deflate.so
#LoadModule optional_hook_export_module   modules/mod_optional_hook_export.so
#LoadModule optional_hook_import_module   modules/mod_optional_hook_import.so
#LoadModule optional_fn_import_module     modules/mod_optional_fn_import.so
#LoadModule optional_fn_export_module     modules/mod_optional_fn_export.so
#LoadModule bucketeer_module              modules/mod_bucketeer.so
LoadModule logio_module                  modules/mod_logio.so

###
### Global Configuration
###
# Splitting up apache2.conf into two files makes it easier to support
# multiple configurations on the same serer.  In commonapache2.conf
# you keep directives that apply to all implementations and in this
# file you keep server-specific directives.  While we don't yet have
# multiple configurations out-of-the-box, this allows us to do that
# in the future easily.  (PERLPROXIED *ahem*)
#
# For Apache2 we load all conf files in conf/modules.d
Include conf/modules.d/*.conf
Include conf/commonapache2.conf

###
### IP Address/Port
###
#BindAddress *
Listen 0.0.0.0:80

###
### 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/vhosts.conf, we use this entry
#CustomLog "|/usr/sbin/apache2splitlogfile" 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/dynamic-vhosts.conf
#Include conf/vhosts/virtual-homepages.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.
#

#
# 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>


As you can see, I haven't done too much to my conf file, other than a few changes to fix errors. These were in other threads and worked for other people, so I would guess they are correct.


Last edited by Lews_Therin on Mon Nov 03, 2003 12:43 am; edited 1 time in total
Back to top
View user's profile Send private message
mattsteven
Apprentice
Apprentice


Joined: 27 Oct 2003
Posts: 240
Location: Your Planet

PostPosted: Sat Nov 01, 2003 8:33 am    Post subject: Reply with quote

With apache it's a lot quicker to just telnet to port 80 than use lsof.

Try "apache2ctl configtest" and it should give you useful clues.
_________________
Matthew Steven
Linux-only desktop since 1998
Graying hair since 2006
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sat Nov 01, 2003 9:50 am    Post subject: Reply with quote

apache2ctl configtest only says Syntax OK

I haven't emerged telnet on that server yet, and using putty on a seperate comp gives me a "connection refused" error. Do you think I should emerge -u?[/code]
Back to top
View user's profile Send private message
StinkingMonkey
Apprentice
Apprentice


Joined: 24 May 2003
Posts: 183
Location: UK

PostPosted: Sat Nov 01, 2003 1:45 pm    Post subject: Reply with quote

ok im using apache 2.0.48 and was getting problems too, after i upgraded to 2.0.48 i got the following error after trying /etc/init.d/apache2 start

env : start-stop-deamon : no such file or directory

i asked some questions on irc, but didnt get an answer to it so i re-emerged apache2, this time apache2 starts. There was a difference in the init files.

first version :

start() {
ebegin "Starting apache2"
[ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
env -i start-stop-daemon --quiet --start --startas /usr/sbin/apache2 \
--pidfile /var/run/apache2.pid -- -k start ${APACHE2_OPTS}
eend $?
}

second version :

start() {
ebegin "Starting apache2"
[ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
env -i PATH=$PATH /sbin/start-stop-daemon --quiet \
--start --startas /usr/sbin/apache2 \
--pidfile /var/run/apache2.pid -- -k start ${APACHE2_OPTS}
eend $?
}


also Lews_Therin its /usr/sbin/apache2 -k start, my apache starts fine when i issue that command
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sat Nov 01, 2003 5:40 pm    Post subject: Reply with quote

I've tried /usr/sbin/apache2 -k start to, didn't work either...I've rsynced, and am emerging -u -k right now, so hopefully that will fix the problem.
Back to top
View user's profile Send private message
PT_LAmb
Guru
Guru


Joined: 22 Apr 2002
Posts: 332
Location: Lisboa (Lisbon), Portugal

PostPosted: Sun Nov 02, 2003 12:58 am    Post subject: Reply with quote

Due to the implementation of GLEP 11, on apache 2.0.48, the location of all webapps was moved.

I don't really know if it's only necessary to copy the htdocs directory to /var/www/... or if it's also necessary to change the configuration. Probably it's different on a case by case basis.

This change was noticed on GWN 20031027, and also on GLSA 200310-04

Good luck,
Ricardo Cordeiro
_________________
SETI@Home - http://setiathome.ssl.berkeley.edu/
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Nov 02, 2003 4:57 am    Post subject: Reply with quote

Actually, I don't have a /home/httpd directory. So I guess that idea is ruled out :?
Back to top
View user's profile Send private message
PT_LAmb
Guru
Guru


Joined: 22 Apr 2002
Posts: 332
Location: Lisboa (Lisbon), Portugal

PostPosted: Sun Nov 02, 2003 6:31 am    Post subject: Reply with quote

Ok. Here's what I did:
  • Copied all files from /home/httpd/htdocs to /var/www/localhost/htdocs
  • Edited all the conf files on /etc/apache2 and replace all paths starting with /home/httpd/htdocs to /var/www/localhost/htdocs (while running etc-update).
  • And Finally restarted the daemon /etc/init.d/apache2 restart and tested with a opera if everyting was functioning as it should.


One side note. I didn't have any vhost set, but if you do, you should follow the recommendation described on GLEP 11 and set the DocumentRoot of each vhost to /var/www/<domain_name>/htdocs.
Lews_Therin wrote:
Actually, I don't have a /home/httpd directory. So I guess that idea is ruled out :?
Then just start filling /var/www/localhost/htdocs with what you what to share with the world.

Good luck,
Ricardo Cordeiro
_________________
SETI@Home - http://setiathome.ssl.berkeley.edu/
Back to top
View user's profile Send private message
Ragnar
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2002
Posts: 92
Location: Faroe Islands

PostPosted: Sun Nov 02, 2003 4:59 pm    Post subject: Reply with quote

I had the same problem.

I had to add computer IP and name to /etc/hosts
_________________
hmmmmm, gentoo.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Nov 02, 2003 9:31 pm    Post subject: Reply with quote

Adding it to /etc/hosts worked, I am now a proud owner of a webserver! Thanks for your help everybody! :D
Back to top
View user's profile Send private message
Krenn
n00b
n00b


Joined: 11 Jan 2003
Posts: 24
Location: Austria

PostPosted: Wed Nov 26, 2003 9:36 am    Post subject: Reply with quote

Thanx for this help, now my server is running finally.
I just had to add
192.168.0.5 VrennsTreasury
to my webserver VrennsTreasury.

But is there a way to handle this a bit "dynamically" ?
( "localhost VrennsTreasury" in /etc/hosts didn'd work)

PS: a local DNS-Server is not an option fo a homeserver ;)
_________________
MfG
Vrenn/Krenn
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum