Linux下的Nginx部署禪道
阿新 • • 發佈:2018-12-22
一、部署安裝好Nginx
二、可以在apache內也可以做該配置,也就是在apache內配置禪道:
apache其實也是一樣,但是要改配置檔案:
vi etc/httpd/conf/httpd.conf
改裡面的禪道路徑
# DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot"/usr/local/zentaopms/www" #
重啟apache:
service httpd restart
然後輸入apache的ip:port/index.php,就可以開始安裝禪道
安裝禪道的問題:可能會遇見session.save_path不存在不可用的問題
1、先修改這三個檔案的執行許可權
chmod o=rwx -R /opt/zentaopms/tmp/ chmod o=rwx -R /opt/zentaopms/www/data chmod o=rwx -R /var/lib/php/session
2、改php.ini配置檔案(改一個地方就ok,不要瞎改)
vi /etc/php.ini
; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. ; ; The path can be defined as: ; ; session.save_path = "N;/path" session.save_path= "/var/lib/php/session" ; where N is an integer. Instead of storing all the session files in ; /path, what this will do is use subdirectories N-levels deep, and ; store the session data in those directories. This is useful if ; your OS has problems with many files in one directory, and is ; a more efficient layout for servers that handle many sessions.
可以看到:server是apache
三、Nginx轉發php設定:
在配置檔案內更改:
vi /usr/local/nginx/conf/nginx.conf
server { listen 82; server_name localhost; location / { root /usr/local/zentaopms/www/; index index.php index.html index.htm; } location ~ .php$ { root /usr/local/zentaopms/www/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/zentaopms/www/$fastcgi_script_name; include fastcgi_params; } error_page 500 502 503 504 /50x.html; }
我的禪道原始碼放在哪裡?
在
/usr/local/zentaopms
將Nginx,reload一下
/usr/local/nginx/sbin/nginx -s reload
然後輸入Nginx的ip:port/index.php,就可以開始安裝禪道。
可以看到:server是nginx