【修改首页内容】[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.conf(centos7 1.14)主配置文件修改 2023-09-23
- linux下安装apache与php;Apache+PHP+MySQL配置攻略 2023-08-07
- Apache Hudi数据布局黑科技降低一半查询时间 2022-10-06
- 服务器添加git钩子的步骤 2022-12-12
- apache和nginx结合使用 2023-09-10
- 实战Nginx_取代Apache的高性能Web服务器 2023-09-29
- centos 7 安装及配置zabbix agent 2023-09-24
- linux之conda环境安装全过程 2023-07-11
- Apache服务器配置攻略3 2022-09-01
- IIS 6 的 PHP 最佳配置方法 2022-09-01