python之day8(Apache服务搭建)

apacha服务部署步骤(linux)

1、准备环境

关闭防火墙:sevices iptalbes stop(chkconfig iptables off)

关闭selinux:

vim etc/httpd/conf/httpd.conf  (apache的配置文件)

SELINUXM=disabled

配置IP地址 ipconfig

1、安装Apache

yum install httpd -y

2、修改配置文件

vim etc/httpd/conf/httpd.conf  (apache的配置文件)

DocumentRoot(修改默认路径)

Listen(修改端口号)

3、重启服务

service https restart

4、测试

在默认路径下放一个文件a.txt(哈哈哈),设置端口号8080 

 echo  'test' -> /var/www/index.html

 echo  '哈哈哈' -> /var/www/a.txt

浏览器输入 http://ip:8080/a.txt 

2、在默认路径下创建echo “默认页面 ” -> index.html

浏览器访问http://ip:8080/index.html

 

posted @ 2021-12-24 17:14  小青~  阅读(74)  评论(0编辑  收藏  举报