基于linux的APACHE(web服务,指定ip和指定用户访问,虚拟主机,https加密认证,网页重写),支持的语言(php,cgi),正向和反向代理

APACHE Web服务

yum install httpd -y   ###安装httpd
systemctl start httpd   ###打开httpd服务
/var/www/html ###apache默认配置目录
index.html  ###apache默认主配置文件
cd /var/www/html
vim index.html  ###apache默认主配置文件
写入:hello world
netstat -antlupe | grep httpd  ###查看httpd的端口
在网站进行测试172.25.254.117

这里写图片描述
这里写图片描述
这里写图片描述

netstat -antlupe | grep httpd  ###查看httpd的端口
vim /etc/http/conf/httpd.conf
将listen80改为listen8080
在网站测试172.25.254.117:8080

这里写图片描述
这里写图片描述
这里写图片描述

mkdir -p /westos/html
cd /westos/html
vim index.html
写入:westos'page

这里写图片描述

vim /etc/http/conf/httpd.conf119行,DocumentRoot "/var/www/html"注释掉
写入:从120行写入,DocumentRoot "/westos/html"
<Directory "/westos">
       require all granted
</Directory>
在网站进行测试172.25.254.101
上面配置写完后,系统只会读默认配置文件index.html,若想读test.html还需要在主配置文件中修改

这里写图片描述
这里写图片描述

vim test.html
写入:westos'test'page
vim /etc/http/conf/httpd.conf
systemctl restart httpd
在刚才写的加入一行:DirectoryIndex test.html
在网站进行测试172.25.254.117

这里写图片描述
这里写图片描述
这里写图片描述

mkdir /westos/html/linux
cd /westos/html/linux
vim index.html
写入:/westos/html/linux'page
vim /etc/http/conf/httpd.conf
写入:在DocumentRoot "/westos/html"下面
      <Directory "/westos/html/linux">
      DirectoryIndex index.html
      </Directory>
systemctl restart httpd
在网站进行测试172.25.254.117/linux

这里写图片描述
这里写图片描述
这里写图片描述
设定指定ip访问默认发布目录和文件

cd /var/www/html  
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值