Httpd – Unable to change Apache http server port in unix

apache-2.2httpdhttpd.conf

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?

Best Answer

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.