ubuntu的操作系统
apache2的配置路径:
/etc/apache2/sites-enabled
重启apache2命令:
sudo /etc/init.d/apache2 restart
启动apache2命令:
sudo /etc/init.d/apache2 start
停止apache2命令:
sudo /etc/init.d/apache2 stop
centos系统安装apache路径:
https://jingyan.baidu.com/article/c843ea0bb5ff3977931e4a14.html
查询apache2进程
ps -ef | grep apache2
lsof -i:80
安装命令:
yum install httpd
已经全部使用的端口情况:
netstat -nultp
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动
1, 修改 /etc/apache2/ports.conf 将
Listen 80
改为自己需要的端口,如
Listen 7779
2,修改/etc/apache2/sites-enabled/000-default.conf 将第一行的
<VirtualHost *:80>
改为自己需要的端口
<VirtualHost *:7779>
3 重启
service apache2 restart
或者
/etc/init.d/apache2 restart
4 打开浏览器验证
http://服务器ip:7779/
让别人知道你的网站目录结构直接查看你目录下的所有文件是很危险的一个事情。
下面介绍解决方法
apache/conf/http.conf
找到:
Options indexes FollowSymLinks
改为:
Options FollowSymLinks