【修改首页内容】[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常用工能


- nginx中封禁ip和允许内网ip访问的实现示例 2022-09-23
- 解决:apache24 安装后闪退和配置端口映射和连接超时设置 2023-09-11
- IIS搭建ftp服务器的详细教程 2022-11-15
- KVM虚拟化Linux Bridge环境部署的方法步骤 2023-07-11
- 利用Docker 运行 python 简单程序 2022-10-16
- 【转载】CentOS安装Tomcat 2023-09-24
- CentOS_mini下安装docker 之 安装docker CE 2023-09-23
- 阿里云ECS排查CPU数据分析 2022-10-06
- CentOS7安装GlusterFS集群的全过程 2022-10-10
- 教你在docker 中搭建 PHP8 + Apache 环境的过程 2022-10-06