LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-25-2012, 05:30 AM   #1
KeithBoynton
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Rep: Reputation: Disabled
Problem starting Apache httpd


Hi folks,

I'm experiencing a really strange issue when trying to start apache on a CentOS virtual machine.

Installed Apache httpd is the latest version and I've configured it to Listen on 0.0.0.0:81, there are no VirtualHosts in the configuration. It's a fresh install of both the OS and Apache so it hasn't been upgraded.

I receive the following error when trying to start apache using "sudo apachectl -k start".
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:81
no listening sockets available, shutting down
Unable to open logs

I'm aware that root is required for port 81, hence the sudo however, I'm also logged in as root.

There is nothing already listening on port 81, confirmed by doing a fuser 81/tcp (or fuser 81/udp for that matter)

No logs are getting created which is making me suspicious that something more serious is the problem.

I'm really stuck and hope someone has some ideas that can help.
 
Old 07-25-2012, 05:57 AM   #2
rmugunthan
Member
 
Registered: Jan 2009
Location: Coimbatore, India
Distribution: rhel
Posts: 49

Rep: Reputation: 3
Instead of 0.0.0.0 try with the server IP Address or only mention port number.

Example :

Listen 81
(or)
Listen 192.168.0.1:81
 
Old 07-25-2012, 06:19 AM   #3
rosehosting.com
Member
 
Registered: Jun 2012
Location: Missouri, USA
Posts: 236

Rep: Reputation: 64
Open your Apache configuration file (/etc/httpd/conf/httpd.conf) in a text editor and add/modify the following line:

Listen 81

Then, restart your Apache service for the changes to take effect using the following command:

service httpd restart
 
Old 07-25-2012, 06:59 AM   #4
KeithBoynton
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks very much for the suggestions guys but I'd already tried that.

With just Listen 81

[root@teamsite-vm ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:81
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:81
no listening sockets available, shutting down
Unable to open logs
[FAILED]

With Listen 192.168.48.135:81

[root@teamsite-vm ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (13)Permission denied: make_sock: could not bind to address 192.168.48.135:81
no listening sockets available, shutting down
Unable to open logs
[FAILED]
 
Old 07-25-2012, 07:02 AM   #5
rosehosting.com
Member
 
Registered: Jun 2012
Location: Missouri, USA
Posts: 236

Rep: Reputation: 64
Execute the following command:

semanage port -a -t http_port_t -p tcp 81

Then, try to start your Apache service.
 
Old 07-25-2012, 08:02 AM   #6
KeithBoynton
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks again for the suggestions.

"semanage port -a -t http_port_t -p tcp 81" does indeed work, thanks for that. Do I need anything to persist that across reboots?
 
Old 07-25-2012, 08:21 AM   #7
rosehosting.com
Member
 
Registered: Jun 2012
Location: Missouri, USA
Posts: 236

Rep: Reputation: 64
The changes will still be active after a reboot.
 
Old 07-25-2012, 09:01 AM   #8
KeithBoynton
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks very much for your help, much appreciated!
 
  


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
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
Help me! Issues starting Apache httpd rdancy1 Linux - Newbie 1 04-05-2008 06:37 PM
Failed to start apache :Starting httpd: Syntax error on line 1027 of /etc/httpd/conf/ payjoe Linux - Newbie 3 09-21-2007 07:24 AM
I have an apache problem Starting httpd: (13)Permission denied: make_sock: could not LinuxCrazy Linux - Server 1 06-24-2007 05:24 PM
problem in starting httpd service!! mhmo Linux - Server 1 03-17-2007 07:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:19 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
Open Source Consulting | Domain Registration