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
重啟機器即可