天天看點

showdoc架設

建立模拟器安裝的阿裡centos7 mini

安裝完後發現沒有可用ifconfig,查不到ip,網絡不可用

解決方案https://blog.csdn.net/koevas/article/details/97496394

安裝docker    解決方案  https://www.jianshu.com/p/c983b1ccbc27

安裝showdoc  解決方案 https://www.showdoc.cc/help?page_id=65610

以上安裝運作沒有問題了。

如需二次開發需

安裝Nginx + PHP

yum install nginx
           
yum install php php-gd php-fpm php-mcrypt php-mbstring php-mysql php-pdo

           

安裝完後,在

/etc/nginx/conf.d

建立檔案

127.0.0.1.conf

server {
        listen       80;
        server_name  127.0.0.1;
        root         /var/www/html;
        index index.php index.html;
        error_page  404              /404.html;
        location = /40x.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
        }
        location ~ \.php$ {
            root           /var/www/html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
        location ~ /\.ht {
            deny  all;
        }
    }
           

儲存。然後執行指令:

service nginx start
           
service php-fpm start
           
chkconfig php-fpm on
           
chkconfig nginx on
           

然後進入目錄

/var/www/html

(不存在則建立),将ShowDoc上傳并按照部署手冊

如啟動nginx之後80不能通路,需對防火牆進行配置

第一步,對80端口進行防火牆配置:

firewall-cmd --zone=public --add-port=80/tcp --permanent
           
第二步,重新開機防火牆服務:
           
systemctl restart firewalld.service
           
然後重新在浏覽器中通路你的ip,應該就可以通路了。
           

事後碰到個問題一直困擾我。怎麼修改檔案權限都不能開啟PHP的寫權限。因虛拟機使用,我将selinux給關了。

檢視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

重新開機機器即可

繼續閱讀