Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

failed to start `/usr/sbin/apache2' [solved]

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
samo
Guru
Guru
Posts: 489
Joined: Sat Mar 13, 2004 5:02 pm

failed to start `/usr/sbin/apache2' [solved]

  • Quote

Post by samo » Wed Feb 20, 2013 9:41 pm

Hi,
rc.log shows the following error:

Code: Select all

 * Starting D-BUS system messagebus ... [ ok ]
 * Starting syslog-ng ... [ ok ]
 * Starting ConsoleKit daemon ... [ ok ]
 * Setting console font [lat9w-16] ... [ ok ]
 * Bringing up interface wlp0s2f2u5
 *   Starting wpa_supplicant on wlp0s2f2u5 ... [ ok ]
 *   Starting wpa_cli on wlp0s2f2u5 ... [ ok ]
 *   Backgrounding ... ...
 * WARNING: net.wlp0s2f2u5 has started, but is inactive
 * WARNING: netmount is scheduled to start when net.wlp0s2f2u5 has started
 * Setting up kdm ... [ ok ]
 * Starting mysql ... [ ok ]
 * Starting apache2 ...
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
 * start-stop-daemon: failed to start `/usr/sbin/apache2' [ ok ]
netstat shows nothing interesting

Code: Select all

netstat -tulpn| grep :80
Does someone know what's wrong?
Last edited by samo on Fri Feb 22, 2013 9:07 pm, edited 1 time in total.
Top
christofdeluca
n00b
n00b
Posts: 34
Joined: Sat Mar 19, 2005 6:01 pm

  • Quote

Post by christofdeluca » Thu Feb 21, 2013 6:35 am

Please post config file
Top
samo
Guru
Guru
Posts: 489
Joined: Sat Mar 13, 2004 5:02 pm

  • Quote

Post by samo » Thu Feb 21, 2013 7:30 pm

The config file looks as follows:

Code: Select all

# cat /etc/conf.d/apache2 
# /etc/conf.d/apache2: config file for /etc/init.d/apache2

# When you install a module it is easy to activate or deactivate the modules
# and other features of apache using the APACHE2_OPTS line. Every module should
# install a configuration in /etc/apache2/modules.d. In that file will have an
# <IfDefine NNN> directive where NNN is the option to enable that module.
#
# Here are the options available in the default configuration:
#
#  AUTH_DIGEST  Enables mod_auth_digest
#  AUTHNZ_LDAP  Enables authentication through mod_ldap (available if USE=ldap)
#  CACHE        Enables mod_cache
#  DAV          Enables mod_dav
#  ERRORDOCS    Enables default error documents for many languages.
#  INFO         Enables mod_info, a useful module for debugging
#  LANGUAGE     Enables content-negotiation based on language and charset.
#  LDAP         Enables mod_ldap (available if USE=ldap)
#  MANUAL       Enables /manual/ to be the apache manual (available if USE=docs)
#  MEM_CACHE    Enables default configuration mod_mem_cache
#  PROXY        Enables mod_proxy
#  SSL          Enables SSL (available if USE=ssl)
#  STATUS       Enabled mod_status, a useful module for statistics
#  SUEXEC       Enables running CGI scripts (in USERDIR) through suexec.
#  USERDIR      Enables /~username mapping to /home/username/public_html
#
#
# The following two options provide the default virtual host for the HTTP and
# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache
# will not listen for incomming connections on the approriate port.
#
#  DEFAULT_VHOST      Enables name-based virtual hosts, with the default
#                     virtual host being in /var/www/localhost/htdocs
#  SSL_DEFAULT_VHOST  Enables default vhost for SSL (you should enable this
#                     when you enable SSL)
#                                                                                                                   
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D PHP5"                                         
                                                                                                                    
# Extended options for advanced uses of Apache ONLY                                                                 
# You don't need to edit these unless you are doing crazy Apache stuff                                              
# As not having them set correctly, or feeding in an incorrect configuration                                        
# via them will result in Apache failing to start                                                                   
# YOU HAVE BEEN WARNED.                                                                                             
                                                                                                                    
# PID file                                                                                                          
#PIDFILE=/var/run/apache2.pid                                                                                       
                                                                                                                    
# timeout for startup/shutdown checks                                                                               
#TIMEOUT=10                                                                                                         
                                                                                                                    
# ServerRoot setting                                                                                                
#SERVERROOT=/usr/lib/apache2                                                                                        
                                                                                                                    
# Configuration file location                                                                                       
# - If this does NOT start with a '/', then it is treated relative to                                               
# $SERVERROOT by Apache                                                                                             
#CONFIGFILE=/etc/apache2/httpd.conf                                                                                 
                                                                                                                    
# Location to log startup errors to                                                                                 
# They are normally dumped to your terminal.                                                                        
#STARTUPERRORLOG="/var/log/apache2/startuperror.log"                                                                

# A command that outputs a formatted text version of the HTML at the URL
# of the command line. Designed for lynx, however other programs may work.
#LYNX="lynx -dump"

# The URL to your server's mod_status status page.
# Required for status and fullstatus
#STATUSURL="http://localhost/server-status"

# Method to use when reloading the server
# Valid options are 'restart' and 'graceful'
# See http://httpd.apache.org/docs/2.2/stopping.html for information on
# what they do and how they differ.
#RELOAD_TYPE="graceful"
Top
JROCK2004
Guru
Guru
User avatar
Posts: 450
Joined: Tue Mar 02, 2004 5:31 am
Location: PA
Contact:
Contact JROCK2004
Website

  • Quote

Post by JROCK2004 » Thu Feb 21, 2013 8:26 pm

If you are trying to start apache, this is how I do it and sure if this would work for you

Code: Select all

/etc/init.d/apache2 start
Top
samo
Guru
Guru
Posts: 489
Joined: Sat Mar 13, 2004 5:02 pm

  • Quote

Post by samo » Thu Feb 21, 2013 8:56 pm

I get the following results:

Code: Select all

# /etc/init.d/apache2 start 
 * WARNING: apache2 has already been started

Code: Select all

# /etc/init.d/apache2 restart
 * apache2 not running (no pid file)
 * Starting apache2 ...
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
 * start-stop-daemon: failed to start `/usr/sbin/apache2'
Top
Telamon
Tux's lil' helper
Tux's lil' helper
Posts: 129
Joined: Mon Dec 29, 2003 5:58 pm

Check netstat

  • Quote

Post by Telamon » Thu Feb 21, 2013 9:14 pm

Try running "netstat -lnp |grep :80" as root. It will show you what the program is that is currently bound to port 80. It might be that you have a copy of apache running that Gentoo's init system doesn't know about. To fix that, stop apache (apache2ctl stop), reset the init settings (/etc/init.d/apache2 zap) and try restarting it (/etc/init.d/apache2 start)
Top
samo
Guru
Guru
Posts: 489
Joined: Sat Mar 13, 2004 5:02 pm

  • Quote

Post by samo » Thu Feb 21, 2013 9:29 pm

When running netstat -lnp |grep :80 as root it returns nothing (see above).
The result of the other commands looks as follows:

Code: Select all

# apache2ctl stop
 * WARNING: apache2 is already stopped
# /etc/init.d/apache2 zap
 * Manually resetting apache2 to stopped state
# /etc/init.d/apache2 start
 * Starting apache2 ...
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
 * start-stop-daemon: failed to start `/usr/sbin/apache2'
Top
christofdeluca
n00b
n00b
Posts: 34
Joined: Sat Mar 19, 2005 6:01 pm

  • Quote

Post by christofdeluca » Fri Feb 22, 2013 12:31 pm

Check all the config files and make sure you don't have multiple "Listen 80" lines.
Top
samo
Guru
Guru
Posts: 489
Joined: Sat Mar 13, 2004 5:02 pm

  • Quote

Post by samo » Fri Feb 22, 2013 9:07 pm

Thanks, the hint was very helpful

Code: Select all

# grep -r "Listen 80" /etc
apache2/vhosts.d/10_myweb_vhost.conf:Listen 80
apache2/vhosts.d/00_default_vhost.conf:Listen 80
After removing the second line in 10_myweb_vhost.conf apache could be started correctly.
Top
christofdeluca
n00b
n00b
Posts: 34
Joined: Sat Mar 19, 2005 6:01 pm

  • Quote

Post by christofdeluca » Sat Feb 23, 2013 2:46 pm

No problem. I pulled my hair out at that too. Can't bind more than one host to port 80!
Top
Post Reply

10 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic