新疆铁路公安工资待遇:如何修改apache的默认web端口

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 00:28:10
如题

1.找到Apache安装目录下conf目录下的httpd.conf文件(即d:\Apache\conf\httpd.conf)。打开它。
2.找到“Listen80”,紧接着Listen的数字就是端口号,我们改为“Listen 8080”。 修改为其它未使用的端口号也行。
3. 重新启动Apache,使新的配置生效。可以使用右下角状态栏的“Apache Serive Monitor”启动apache。
也可以点击“开始”>"运行>输入cmd>回车>定位到apache安装目录下到bin目录,然后输入
“httpd–k start”。

方法很简单:
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了。

在apache的安装文件夹里搜索 httpd.conf 文件,用记事本打开,搜索 Listen 80 ,把80(默认端口)改为你想用的端口,保存,重新启动apache服务即可!

打开apache的配置文件httpd.conf.
找到Listen 80
修改成你想使用的端口