Linux 搭建http server

Linux 搭建http server

des : firefly 在Linux 上run, 跑出来的结果是HTML 格式的,需要把它放到 http server 上,在windows 机器上就可以查看report了。

https://www.cnblogs.com/zhuyeshen/p/11693362.html

1 yum install httpd 安装httpd
2 httpd的配置文件是/etc/httpd/conf/httpd.conf
3 安装好启动一下service httpd start 启动service httpd restart 重新启动service httpd stop 停止服务
4 关闭防火墙
systemctl stop firewalld


5 通过命令ln -s /home/dev/automation/report_archive report_archive 在/var/www/html/目录下创建了一个软连接。
在配置文件中可以发现,服务器默认的访问路径在/var/www/html目录下

6 删除/etc/httpd/conf.d/welcome.conf,

通过 IP 就可以访问了。

如果遇到 权限问题:
/home 目录有保护权限,需要设置Selinux 权限

https://blog.51cto.com/bguncle/957315


查看SELinux状态:

1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态

SELinux status: enabled

2、getenforce ##也可以用这个命令检查

关闭SELinux:
1、临时关闭(不用重启机器):

setenforce 0 ##设置SELinux 成为permissive模式

##setenforce 1 设置SELinux 成为enforcing模式
2、修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可

posted @ 2022-01-19 16:22  安小白learning  阅读(961)  评论(0编辑  收藏  举报