【修改首页内容】[root@chaogelinux ~]# vim /var/www/html/index.html[root@chaogelinux ~]# curl 127.0.0.1meta charset=utf8超哥带你学apache【修改网页资源目录路径】1.修改配置文件如下,两处修改[root@chaog...

【修改首页内容】
[root@chaogelinux ~]# vim /var/www/html/index.html
[root@chaogelinux ~]# curl 127.0.0.1
<meta charset=utf8>
超哥带你学apache
【修改网页资源目录路径】
1.修改配置文件如下,两处修改
[root@chaogelinux ~]# cat /etc/httpd/conf/httpd.conf
DocumentRoot "/www/html"
<Directory "/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
2.创建资源目录,创建html文件
mkdir -p /www/html/
[root@chaogelinux conf]# cat /www/html/index.html
<meta charset=utf8>
我是新的首页,你好兄弟们
3.修改了配置文件,还得重启http服务才能生效
systemctl restart httpd
4.注意关闭防火墙和selinux,影响实验
[root@chaogelinux conf]# systemctl stop firewalld
[root@chaogelinux conf]# systemctl disable firewalld
[root@chaogelinux conf]# iptables -F
[root@chaogelinux conf]# setenforce 0 #临时关闭selinux
[root@chaogelinux conf]# grep -i ‘^selinux‘ /etc/selinux/config
SELINUX=disabled #永久关闭selinux,重启机器生效
SELINUXTYPE=targeted
5.此时可以访问新的页面了
[root@chaogelinux conf]# curl 127.0.0.1
<meta charset=utf8>
我是新的首页,你好兄弟们
【修改监听端口】
[root@chaogelinux ~]# grep -i "^listen" /etc/httpd/conf/httpd.conf
Listen 85
访问效果
[root@chaogelinux ~]# curl 127.0.0.1:85
<meta charset=utf8>
我是新的首页,你好兄弟们
原文:https://www.cnblogs.com/wzj0015/p/13170338.html
本文标题为:apache常用工能


基础教程推荐
- Docker容器操作方法详解 2022-11-13
- 通过StatefulSet部署有状态服务应用实现方式 2022-10-01
- windows环境下apache-apollo服务器搭建 2023-09-10
- RFO SIG之openEuler AWS AMI 制作详解 2022-12-28
- Centos 安装Django2.1 2023-09-24
- Apache CarbonData 1.0.0发布及其新特性介绍 2023-09-11
- Apache Kafka 2.5 稳定版发布,新特性抢先看 2023-09-11
- P3 利用Vulnhub复现漏洞 - Apache SSI 远程命令执行漏洞 2023-09-10
- 为Win2003服务器打造铜墙铁壁的方法步骤 2022-09-01
- Centos7 nginx的安装以及开机自启动的设置 2023-09-22