首页 > Web开发 > 详细

apache常用工能

时间:2020-06-20 21:35:13      阅读:79      评论:0      收藏:0      [点我收藏+]

【修改首页内容】
[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>
我是新的首页,你好兄弟们

apache常用工能

原文:https://www.cnblogs.com/wzj0015/p/13170338.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!