nginx下部署showdoc

1. 安裝nginx服務器sudo apt-get install nginx -y

2. 啓動服務sudo service nginx start

3. 安裝php環境

sudo apt-get install -y php7.1 php7.1-fpm php7.1-gd php7.1-mcrypt php7.1-mbstring php7.1-mysql php7.1-pdo  php7.1-sqlite

4. 配置nginx

  • 編輯php.conf文件sudo vim /etc/nginx/conf.d/php.conf新增下邊內容
server {
    listen 80;
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    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;
    }
}
  • 編輯default文件vim /etc/nginx/sites-available/default去掉下邊這個配置的註解
location ~ \.php$ {
       include snippets/fastcgi-php.conf;
       fastcgi_pass unix:/var/run/php7.1-fpm.sock;
}

5. 刷新配置sudo service nginx reload

6. rz命令上傳代碼到/var/www/html

7. 給showdoc賦權限chmod -R 777 showdoc

8. 訪問xx.com/showdoc/web/#/


相關文章
相關標籤/搜索