如何修改apache的默认web端口

如题所述

方法很简单:
1、修改
/etc/apache2/ports.conf将
NameVirtualHost
*:80和Listen
80修改为自己需要的端口,例如:
NameVirtualHost
*:1000
Listen
1000
2、修改/etc/apache2/sites-available/default
将第一行的
VirtualHost
:80
改为自己需要的端口VirtualHost
:1000
3、修改
/etc/init.d/apache2/httpd.conf
添加Servername
localhost,否则重启时会报如下错误
*
Restarting
web
server
apache2apache2:
Could
not
reliably
determine
the
server's
fully
qualified
domain
name,
using
127.0.1.1
for
ServerName
...
waiting
apache2:
Could
not
reliably
determine
the
server's
fully
qualified
domain
name,
using
127.0.1.1
forServerNam
4.重启apache
sudo
/etc/init.d/apache2
restart
端口修改完毕。apache的端口修改为1000了。
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网