Change Listen Port on httpd config for Varnish Configuration

眉间皱痕 提交于 2019-12-08 08:00:12

问题


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



来源:https://stackoverflow.com/questions/16477404/change-listen-port-on-httpd-config-for-varnish-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!