- 只要把
httpd
和nginx
的默认80
端口改为不一样的就可了,不能都为80。改完配置文件后,服务重启。 - 解决1:修改nginx监听端口
# 打开nginx配置文件
vi /etc/nginx/nginx.conf
# 修改服务server listen 为88
server {
listen 88 default_server;
listen [::]:88 default_server;
- 解决2:修改httpd监听端口
# 打开httpd配置文件
vi /etc/httpd/conf/httpd.conf
# 修改httpd服务的监听端口
# 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.
#
#Listen 12.34.56.78:80
Listen 88
- 重启服务
systemctl restart httpd
systemctl restart nginx