1. 安装httpd服务
dnf install httpd -y
2. 管理httpd服务
启动服务:
systemctl start httpd
开机自启:
systemctl enable httpd
查看状态:
systemctl status httpd
停止服务:
systemctl stop httpd
禁用开机自启:
systemctl disable httpd
3. 配置文件管理
主配置文件:/etc/httpd/conf/httpd.conf
辅助配置目录:/etc/httpd/conf.d/
检查语法:
apachectl configtest
重启生效配置:
systemctl restart httpd
4. 加载asis模块
编辑配置文件:
vim /etc/httpd/conf.modules.d/00-optional.conf
取消注释行:
LoadModule asis_module modules/mod_asis.so
重启服务:
systemctl restart httpd
验证模块:
httpd -M | grep asis
5. 配置SSL支持
安装mod_ssl:
dnf install mod_ssl -y
重启服务:
systemctl restart httpd
验证SSL模块:
httpd -M | grep ssl
6. 验证服务
获取服务器IP:
ip a
Linux终端验证:
浏览器验证:访问http://192.168.183.131