最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

linux下本地包安裝nginx

2022-09-20 17:50 作者:限量版范兒  | 我要投稿

由于在做go-fastdfs集群的時候用到了nginx進行代理,然后直接用yum安裝的nginx,在這里掛個本地寶安裝方法當鏈接。

1.安裝依賴包

//一鍵安裝上面四個依賴yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

2.下載解壓軟件包

//創(chuàng)建一個文件夾cd /usr/local mkdir nginx cd nginx//下載tar包wget http://nginx.org/download/nginx-1.13.7.tar.gztar -xvf nginx-1.13.7.tar.gz

3.安裝nginx

//進入nginx目錄cd /usr/local/nginx//進入目錄cd nginx-1.13.7//執(zhí)行命令 考慮到后續(xù)安裝ssl證書 添加兩個模塊./configure //執(zhí)行make命令make//執(zhí)行make install命令make install

4.啟動nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

5.配置nginx

vi /usr/local/nginx/conf/nginx.conf

#user ?nobody; worker_processes ?1; #error_log ?logs/error.log; #error_log ?logs/error.log ?notice; #error_log ?logs/error.log ?info; #pid ? ? ? ?logs/nginx.pid; events { ? ?worker_connections ?1024; } http { ? ?include ? ? ? mime.types; ? ?default_type ?application/octet-stream; ? ?#log_format ?main ?'$remote_addr - $remote_user [$time_local] "$request" ' ? ?# ? ? ? ? ? ? ? ? ?'$status $body_bytes_sent "$http_referer" ' ? ?# ? ? ? ? ? ? ? ? ?'"$http_user_agent" "$http_x_forwarded_for"'; ? ?#access_log ?logs/access.log ?main; ? ?sendfile ? ? ? ?on; ? ?#tcp_nopush ? ? on; ? ?#keepalive_timeout ?0; ? ?keepalive_timeout ?65; ? ?#gzip ?on; ? ?server { ? ? ? ?listen ? ? ? 80; ? ? ? ?server_name ?localhost; ? ? ? ?#charset koi8-r; ? ? ? ?#access_log ?logs/host.access.log ?main; ? ? ? ?location / { ? ? ? ? ? ?root ? html; ? ? ? ? ? ?index ?index.html index.htm; ? ? ? ?} ? ? ? ?#error_page ?404 ? ? ? ? ? ? ?/404.html; ? ? ? ?# redirect server error pages to the static page /50x.html ? ? ? ?# ? ? ? ?error_page ? 500 502 503 504 ?/50x.html; ? ? ? ?location = /50x.html { ? ? ? ? ? ?root ? html; ? ? ? ?} ? ? ? ?# proxy the PHP scripts to Apache listening on 127.0.0.1:80 ? ? ? ?# ? ? ? ?#location ~ \.php$ { ? ? ? ?# ? ?proxy_pass ? http://127.0.0.1; ? ? ? ?#} ? ? ? ?# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 ? ? ? ?# ? ? ? ?#location ~ \.php$ { ? ? ? ?# ? ?root ? ? ? ? ? html; ? ? ? ?# ? ?fastcgi_pass ? 127.0.0.1:9000; ? ? ? ?# ? ?fastcgi_index ?index.php; ? ? ? ?# ? ?fastcgi_param ?SCRIPT_FILENAME ?/scripts$fastcgi_script_name; ? ? ? ?# ? ?include ? ? ? ?fastcgi_params; ? ? ? ?#} ? ? ? ?# deny access to .htaccess files, if Apache's document root ? ? ? ?# concurs with nginx's one ? ? ? ?# ? ? ? ?#location ~ /\.ht { ? ? ? ?# ? ?deny ?all; ? ? ? ?#} ? ?} ? ?# another virtual host using mix of IP-, name-, and port-based configuration ? ?# ? ?#server { ? ?# ? ?listen ? ? ? 8000; ? ?# ? ?listen ? ? ? somename:8080; ? ?# ? ?server_name ?somename ?alias ?another.alias; ? ?# ? ?location / { ? ?# ? ? ? ?root ? html; ? ?# ? ? ? ?index ?index.html index.htm; ? ?# ? ?} ? ?#} ? ?# HTTPS server ? ?# ? ?#server { ? ?# ? ?listen ? ? ? 443 ssl; ? ?# ? ?server_name ?localhost; ? ?# ? ?ssl_certificate ? ? ?cert.pem; ? ?# ? ?ssl_certificate_key ?cert.key; ? ?# ? ?ssl_session_cache ? ?shared:SSL:1m; ? ?# ? ?ssl_session_timeout ?5m; ? ?# ? ?ssl_ciphers ?HIGH:!aNULL:!MD5; ? ?# ? ?ssl_prefer_server_ciphers ?on; ? ?# ? ?location / { ? ?# ? ? ? ?root ? html; ? ?# ? ? ? ?index ?index.html index.htm; ? ?# ? ?} ? ?#} }

?

6.重啟nginx

/usr/local/nginx/sbin/nginx -s reload

7.關閉防火墻

setenforce 0systemctl stop firewalld

8.訪問nginx

?

安裝完成一般常用命令

進入安裝目錄中,

命令: cd /usr/local/nginx/sbin

啟動,關閉,重啟,命令:

./nginx 啟動

./nginx -s stop 關閉

./nginx -s reload 重啟

?鏈接:https://www.dianjilingqu.com/537686.html

linux下本地包安裝nginx的評論 (共 條)

分享到微博請遵守國家法律
塔城市| 罗平县| 石泉县| 昌江| 阿克陶县| 巴马| 普格县| 土默特左旗| 迁安市| 乐平市| 浦城县| 天峨县| 营口市| 邓州市| 玉林市| 简阳市| 都匀市| 蒲江县| 西畴县| 安康市| 尼玛县| 瓮安县| 周至县| 黎平县| 绥阳县| 台中市| 南城县| 旺苍县| 大理市| 琼海市| 宝丰县| 余姚市| 大姚县| 台北县| 乌鲁木齐县| 桂林市| 丽水市| 苏尼特右旗| 盐源县| 石阡县| 庐江县|