Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I downloaded Apache HTTP server, compiled it and installed it in a unix box.

I tried to start my Apache HTTP server in unix but got the below error so I thought of changing the port.

(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

I tried to change the listening port for my Apache HTTP server in UNIX by modifying the httpd.conf file (present under conf directory) but this doesn't seem to have any effect when I restart my server.

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80

Listen 82

I tried changing the port number to a value greater than 1024 (non privileged port numbers) but I am getting the same error as above(error still list port 80).

I am using httpd for starting the server. I even tried starting using the below command but I am still getting the same error..

apachectl -f ./conf/httpd.conf

Am I missing something?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

When you say you downloaded Apache and installed it on a "UNIX" box, what Operating System are you actually running? Are you running Linux? Solaris? FreeBSD? OpenBSD? Etc.?

Further, whatever system you are running should likely have Apache as a package to install from its package management utility.

Also, apachectl shouldn't likely take a configuration parameter. Can you try instead running...

# httpd -f ./conf/httpd.conf

Probably better if you use the full path and not relative just to make sure nothing is going wrong. Your best bet, though, is tell us what OS you are using and maybe get this installed with a more supportable way that has documentation behind it.

share|improve this answer
    
apachectl has a pass through mode so it just passes what it doesn't understand to httpd. –  Iain Mar 22 '13 at 14:30
add comment

Check that you're actually using the httpd.conf file that you're specifying on the command line, on the Centos System I have to hand specifying ./conf/httpd.conf still uses the /etc/httpd/conf/httpd.conf file (relative paths appear to be rooted at /etc/httpd).

Check also that you're not running up against SELinux which can be configured to only allow httpd to bind to certain ports, as root you can get the list with

semanage -port -l | grep http_port_t 
http_port_t                    tcp      80, 443, 488, 8008, 8009, 8443

You can add your own port using

 semanage port -d -t http_port_t -p tcp 1025

as root but if you don't have root access you'll have to choose one from the list above.

share|improve this answer
    
Its throwing the same error even if I try to bind the port with some value greater than 1024... –  Learner Mar 21 '13 at 18:36
    
@Learner: oops missed that bit, updates my answer with other possibilities, –  Iain Mar 21 '13 at 19:05
    
Using absolute path did the trick... –  Learner Mar 22 '13 at 19:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.