LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2013, 04:15 AM   #1
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Rep: Reputation: Disabled
httpd : no listening sockets available, shutting down


Hello,
I installed httpd, and evry thing was ok . now when i try to restart the httpd service , i have this error :

Code:
Stopping httpd:                                            [FAILED]
Starting httpd: no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]
Il y a rien qui ecoute sur le port 80 .

Elle donne rien cette commande
Code:
lsof -i :80
Je ne sais pas d'ou vient le problem .Aidez moi svp.
 
Old 04-08-2013, 05:14 AM   #2
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
I edit httpd.conf .
I added :
Code:
User apache
Listen 80
Now i can restart the apache service . But i can access anymore to my pages :

http://MyServerAdress/
http://MyServerAdress/nagios
http://MyServerAdress/centreon
 
Old 04-08-2013, 08:19 AM   #3
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
problem during restarting http

Hey ,
Evrything was ok, but when i have try to restart my apache , i get a error .
I edit the httpd.conf, i addes :
Code:
User apache
Listen 80
the service is start ,but I still have errors and i can't open my web page :
Code:
http://Adress 
http://Adress/centreon
http://Adress/Nagios
Those are the erros on my log file:

Code:
 File does not exist: /etc/httpd/htdocs
Help please
 
Old 04-08-2013, 08:20 AM   #4
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 54
Sounds like you changed the DocumentRoot to a location that doesn't exist.
 
Old 04-08-2013, 08:22 AM   #5
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
Thanks for the Quick answer .


Quote:
Originally Posted by YankeePride13 View Post
Sounds like you changed the DocumentRoot to a location that doesn't exist.
I don't have a DocumentRoot, I just have the ServerRoot on the httpd.conf

Code:
ServerRoot "/etc/httpd"
 
Old 04-08-2013, 08:26 AM   #6
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 54
Then you need to add the DocumentRoot directive and point it to the directory with your files that you want to be served up.
 
Old 04-08-2013, 08:35 AM   #7
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by YankeePride13 View Post
Then you need to add the DocumentRoot directive and point it to the directory with your files that you want to be served up.
I added this :

ServerRoot "/etc/httpd"
DocumentRoot "/usr/local/httpd/htdocs"

But i still have an error :

Attempt to serve directory: /usr/local/httpd/htdocs/


I don't think i removed DocumentRoot from my httpd.conf file before
 
Old 04-08-2013, 08:44 AM   #8
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 54
Quote:
Originally Posted by tissam89 View Post
I added this :

ServerRoot "/etc/httpd"
DocumentRoot "/usr/local/httpd/htdocs"

But i still have an error :

Attempt to serve directory: /usr/local/httpd/htdocs/


I don't think i removed DocumentRoot from my httpd.conf file before
There's more to it than just that...You need VirtualHost, DirectoryIndex and other directives. Since you do not have much apache administration experience, the easiest way to fix this is to just reinstall it and then place the files you want to serve up in the directory listed under the DocumentRoot directive (or change the directory to be whatever you want at that point) .
 
Old 04-08-2013, 08:54 AM   #9
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by YankeePride13 View Post
There's more to it than just that...You need VirtualHost, DirectoryIndex and other directives. Since you do not have much apache administration experience, the easiest way to fix this is to just reinstall it and then place the files you want to serve up in the directory listed under the DocumentRoot directive (or change the directory to be whatever you want at that point) .
I can't uninstall it , because it is needeed by another programs :
Code:
# rpm -e httpd-2.2.23-3.el5
error: Failed dependencies:
        httpd-mmn = 20051115 is needed by (installed) php-5.1.6-27.el5_5.3.x86_64
        httpd is needed by (installed) nagios-3.4.4-fan.1.x86_64
        httpd is needed by (installed) nagvis-1.7.6-fan.1.x86_64
        httpd is needed by (installed) centreon-www-2.4.1-fan.1.noarch
        httpd is needed by (installed) nrdp-1.2-fan.1.x86_64
        httpd is needed by (installed) fan-html-1.0-fan.1.noarch
 
Old 04-08-2013, 09:00 AM   #10
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 54
I doubt you have any useful nagios configs since you didn't get apache working, but I would save the nagios configs and reinstall nagios and php (both trivial).

Otherwise, here is the place that has all the answers :

http://httpd.apache.org/docs/
 
Old 04-08-2013, 09:17 AM   #11
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by YankeePride13 View Post
I doubt you have any useful nagios configs since you didn't get apache working, but I would save the nagios configs and reinstall nagios and php (both trivial).

Otherwise, here is the place that has all the answers :

http://httpd.apache.org/docs/
Ok ! I'll do it , and come back to tell yout the result .
Thank you
 
Old 04-08-2013, 10:01 AM   #12
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
I installed again ! and evrything was ok .
But when i added the user apache to soduers file,i have those errors when i restart apache :

Code:
# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address                       [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]
I realy don't understand why . Even if I remove the user apache from sudoers file, the issue persist .

I post it if it can help :
Code:
# netstat -lnp | grep :80
tcp        0      0 :::80                       :::*                        LIST                      EN      1115/nagios
 
Old 04-08-2013, 08:01 PM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
There should normally be no need to put Apache / httpd in the sudoers file.

Note that the httpd stop failed; that's the first thing you need to fix.
you need top be root to run that cmd and its possible that there is a lock file in eg /var/run/httpd from a previously crashed httpd.
Check there and the log files.
 
Old 04-09-2013, 02:58 AM   #14
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
There should normally be no need to put Apache / httpd in the sudoers file.

Note that the httpd stop failed; that's the first thing you need to fix.
you need top be root to run that cmd and its possible that there is a lock file in eg /var/run/httpd from a previously crashed httpd.
Check there and the log files.
when i try to generate the configuration from centreon to nagios, it doesn't work, but when i add apache user on sudoers it works. But after trying restart httpd, I get the error .

There is no /var/run/httpd directory.

I have nothing on httpd log file .

Please give me steps to resolve it
 
Old 04-09-2013, 03:24 AM   #15
tissam89
Member
 
Registered: Mar 2013
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tissam89 View Post
when i try to generate the configuration from centreon to nagios, it doesn't work, but when i add apache user on sudoers it works. But after trying restart httpd, I get the error .

There is no /var/run/httpd directory.

I have nothing on httpd log file .

Please give me steps to resolve it
I had to kill a processus already used the port 80 .

Thank you for your reply
 
  


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
Problem during restarting Apache tissam89 Linux - Newbie 3 04-04-2013 10:14 AM
Network restarting problem mystic drifter Linux - Newbie 4 08-12-2010 12:24 AM
problem restarting apache merrsh1 Debian 3 06-04-2007 06:44 AM
problem restarting linux enrico.pisoni Linux - General 6 01-16-2006 07:16 AM
Problem Restarting/Shutting Down minm Linux - Hardware 1 06-28-2003 09:05 PM


All times are GMT -5. The time now is 10:52 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration