mkdir /usr/local/nginx
先安裝pcre,rewrite模組需要
新增啟動指令碼:vim /etc/init.d/nginx
啟動指令碼到這裡介紹。
開啟php支援,vim /usr/local/nginx/conf/nginx.conf
location /
//啟用下面的配置
location ~ \.php$
vim /etc/nginx/fastcgi_params,如果沒有或者是空白的話,查詢一下find / -name fastcgi_params,然後拷貝過來
fastcgi_param gateway_inte***ce cgi/1.1;
fastcgi_param server_software nginx;
fastcgi_param query_string $query_string;
fastcgi_param request_method $request_method;
fastcgi_param content_type $content_type;
fastcgi_param content_length $content_length;
fastcgi_param script_filename $document_root$fastcgi_script_name;
fastcgi_param script_name $fastcgi_script_name;
fastcgi_param request_uri $request_uri;
fastcgi_param document_uri $document_uri;
fastcgi_param document_root $document_root;
fastcgi_param server_protocol $server_protocol;
fastcgi_param remote_addr $remote_addr;
fastcgi_param remote_port $remote_port;
fastcgi_param server_addr $server_addr;
fastcgi_param server_port $server_port;
fastcgi_param server_name $server_name;
chmod +x /etc/init.d/nginx
chkconfig --add nginx
chkconfig nginx on
service nginx start
CentOS 通過原始碼編譯形式安裝 Nginx
本篇簡單說說在如何在 linux 系統上通過原始碼編譯的形式安裝 nginx,純屬筆記。linux 版本 centos6.9 x64 nginx 版本 nginx 1.19.6.tar.gz 關閉 linux 機器防火牆 上傳 nginx 安裝包 nginx 1.19.6.tar.gz,這裡上傳到 ...
centos7 4系統原始碼編譯安裝nginx
安裝環境依賴 解壓進入資料夾 編譯安裝 配置環境變數 開放centos埠 啟動nginx 配置nginx開啟自啟 新增如下兩行 path path usr local nginx sbin export path 環境變數生效 source etc profile firewall cmd zone...
centOS6上原始碼編譯方式安裝Nginx
2.安裝環境依賴。yum install gcc c yum y install zlib zlib developenssl openssl devel pcre pcre devel 或yum y install gcc zlib zlib devel pcre devel openssl op...