Change Listen Port on httpd config for Varnish Con

2019-06-07 04:05发布

问题:

I installed Varnish Cache my CentOS server.I try the do configuration correctly but as I read many document say to me change apache port Listen 80 to Listen 8080. But I couldn't find any Listen 80 line on my server /etc/httpd/conf/httpd.conf but i found 0.0.0.0:80 line. Is it same thing ? If those are same thinhgs, when i change my sites not working.

I know that I make huge logical mistake but i can't understand.

Thanks

回答1:

In this file /etc/httpd/conf/httpd.conf there should be a line: ServerRoot "/etc/httpd" Below this line there is Listen 80 Change this to Listen 8080 and restart apache

Restarting with command: /etc/init.d/httpd restart

I also found this:-> http://updatedlinux.wordpress.com/2011/04/29/how-to-change-the-default-port-number-for-apache-http-server/

Possible that this will help!



回答2:

To me it looks like SELinux is standing in the way and is prohibiting the use of your custom port.

So the solution should be one of these:

  • a) disable SELinux (if your scenario allows it and you don't need it)
  • b) set SELinux permissive
  • c) configure SELinux to allow your custom port for the httpd service

see /etc/sysconfig/selinux for a) and b)

use semanage for c)

HTH