1

I am running httpd on CentOS 6.6. I've successfully set up a site on port 80, but now I wish to have the site on port 82, so when I type <myip>:82 in my browser I can view the site but not <myip>:80 or <myip>.

In my httpd.conf file I've changed Listen 192.168.1.18:80 to Listen 192.168.1.18:82, and I've forwarded port 82 on my router. But when I try to restart the process it gives the following error:

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

Do I have to change the port to 82 anywhere else in http.conf or somewhere else? Everything works fine on port 80. Sorry if I'm not being clear enough, I'll clarify more info if needed.

1 Answer 1

5

Changing the webserver port also requires changing the SELinux policy for the webserver which is well documented :

  1. Run the semanage port -a -t http_port_t -p tcp 82 command as the root user to add the port to SELinux policy configuration.
  2. Run the semanage port -l | grep -w http_port_t command as the root user to confirm the port is added...

Not relevant with regards to your error message, but don't forget adding port 82 to your firewall config as well.

1
  • 1
    Thank you! I ran both of these commands and updated my iptables config and it works.
    – vincebel
    Jul 22, 2016 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .