2.ps -ef | grep apache2可以看到如下信息
root 2657 1 0 11:54 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 2658 2657 0 11:54 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 2659 2657 0 11:54 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 2690 2657 0 11:54 ? 00:00:00 /usr/sbin/apache2 -k start
3.在浏览器中输入
http://localhost/
成功的话,会出现It,works!
4.apache2的配置文件为
/etc/apache2/apache2.conf
修改端口可在/etc/apache2/ports.conf
修改Listen 8082
注意配置文件中有说明:
- # If you just change the port or add more ports here, you will likely also
- # have to change the VirtualHost statement in
- # /etc/apache2/sites-enabled/000-default
- NameVirtualHost *:80
Listen 8082
/etc/apache2/sites-enabled/000-default
中的8082>
5.重新加载配置文件
sudo service apache2 reload
6.在浏览器中输入http://localhost:8082/会出现测试的主页