如何更改linux下的Apache http端口号
1个回答
展开全部
使用vim编辑Apache http的配置文件:
[root@Linuxprobe ~]# vim /etc/httpd/conf/httpd.conf
前文省略……………………………………
ServerRoot "/etc/httpd"
32
33 #
34 # Listen: Allows you to bind Apache to specific IP addresses and/or
35 # ports, instead of the default. See also the <VirtualHost>
36 # directive.
37 #
38 # Change this to Listen on specific IP addresses as shown below to
39 # prevent Apache from glomming onto all bound IP addresses.
40 #
41 #Listen 12.34.56.78:80
42 Listen 80 #这是Apache的默认监听端口,修改你想要修改的端口就可以了
43
44 #
45 # Dynamic Shared Object (DSO) Support
46 #
47 # To be able to use the functionality of a module which was built as a DSO you
:wq #退出并保存
2.使用重新启动httpd服务:systemctl restart httpd (PS:这里使用的是RHEL 7.0系统)如果是7以下的系统,这里有详细介绍Apache的配置服务http://www.linuxprobe.com/chapter-09/。或者可以使用service httpd restart重启即可。
[root@Linuxprobe ~]# systemctl restart httpd
[root@Linuxprobe ~]#
希望能够帮助到你,谢谢!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询