Ubuntu安装使用apache2

一、安装

sudo apt-get install apache2

二、Apache服务器启动管理

2.1运行状态检查

systemctl status apache2	  #Ubuntu
apachectl status   			  #所有系统

2.2设置开机时自启动

systemctl enable apache2

2.3启动关闭重启

systemctl start apache2
systemctl stop apache2
systemctl restart apache2

2.4检查配置文件语法是否正确

apache2 -t
apachectl configest         #所有系统

2.5查看已被编译道Apache中的模块

apache2 -l

三、Apache重要的文件夹

/var/www/html/

/var/log/apache2

/etc/apache2/
/var/www/html/为默认的html页面放置的目录,在/etc/apache2/目录下的配置文件可以重新配置

2)/var/log/apache2记录了apache2的运行日志
3)/etc/apache2/存放所有apache2的配置文件

发布了54 篇原创文章 · 获赞 17 · 访问量 9207

猜你喜欢

转载自blog.csdn.net/qq_41979513/article/details/98989463