麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 網站 > Nginx > 正文

CentOS 7下編譯安裝Nginx 1.11.10教程

2024-08-30 12:28:43
字體:
來源:轉載
供稿:網友

前言

之前分享過一篇 CentOS下編譯安裝nginx及配置縮略圖插件的方法教程,當時的環境是 CentOS 6.x 和 Nginx 1.9.x 。 本次安裝的環境為 CentOS 7.2 和 Nginx 1.11.10, 有些配置以前自啟動的方式發生了變化, 這里再記錄一下。

安裝編譯安裝依賴的類庫和包

yum install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre-devel

下載和解壓 Nginx 1.11.10

wget http://nginx.org/download/nginx-1.11.10.tar.gztar -xzvf nginx-1.11.10.tar.gzcd nginx-1.11.10

配置 Nginx 安裝選項

這里編譯了插件 http_image_filter_module, 來實現圖片的處理,采用默認的安裝路徑進行安裝。

./configure/ --with-http_ssl_module/ --with-http_v2_module/ --with-http_realip_module/ --with-http_addition_module/ --with-http_xslt_module/ --with-http_image_filter_module/ --with-http_sub_module/ --with-http_auth_request_module/ --with-http_stub_status_module/ --with-http_gzip_static_module

運行結果如下

[root@xx nginx-1.11.10]# ./configure/> --with-http_ssl_module/> --with-http_v2_module/> --with-http_realip_module/> --with-http_addition_module/> --with-http_xslt_module/> --with-http_image_filter_module/> --with-http_sub_module/> --with-http_auth_request_module/> --with-http_stub_status_module/> --with-http_gzip_static_modulechecking for OS + Linux 3.10.0-327.22.2.el7.x86_64 x86_64checking for C compiler ... found + using GNU C compiler + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) checking for gcc -pipe switch ... foundchecking for -Wl,-E switch ... foundchecking for gcc builtin atomic operations ... foundchecking for C99 variadic macros ... foundchecking for gcc variadic macros ... foundchecking for gcc builtin 64 bit byteswap ... foundchecking for unistd.h ... foundchecking for inttypes.h ... foundchecking for limits.h ... foundchecking for sys/filio.h ... not foundchecking for sys/param.h ... foundchecking for sys/mount.h ... foundchecking for sys/statvfs.h ... foundchecking for crypt.h ... foundchecking for Linux specific featureschecking for epoll ... foundchecking for EPOLLRDHUP ... foundchecking for EPOLLEXCLUSIVE ... not foundchecking for O_PATH ... foundchecking for sendfile() ... foundchecking for sendfile64() ... foundchecking for sys/prctl.h ... foundchecking for prctl(PR_SET_DUMPABLE) ... foundchecking for sched_setaffinity() ... foundchecking for crypt_r() ... foundchecking for sys/vfs.h ... foundchecking for poll() ... foundchecking for /dev/poll ... not foundchecking for kqueue ... not foundchecking for crypt() ... not foundchecking for crypt() in libcrypt ... foundchecking for F_READAHEAD ... not foundchecking for posix_fadvise() ... foundchecking for O_DIRECT ... foundchecking for F_NOCACHE ... not foundchecking for directio() ... not foundchecking for statfs() ... foundchecking for statvfs() ... foundchecking for dlopen() ... not foundchecking for dlopen() in libdl ... foundchecking for sched_yield() ... foundchecking for SO_SETFIB ... not foundchecking for SO_REUSEPORT ... foundchecking for SO_ACCEPTFILTER ... not foundchecking for SO_BINDANY ... not foundchecking for IP_BIND_ADDRESS_NO_PORT ... not foundchecking for IP_TRANSPARENT ... foundchecking for IP_BINDANY ... not foundchecking for IP_RECVDSTADDR ... not foundchecking for IP_PKTINFO ... foundchecking for IPV6_RECVPKTINFO ... foundchecking for TCP_DEFER_ACCEPT ... foundchecking for TCP_KEEPIDLE ... foundchecking for TCP_FASTOPEN ... foundchecking for TCP_INFO ... foundchecking for accept4() ... foundchecking for eventfd() ... foundchecking for int size ... 4 byteschecking for long size ... 8 byteschecking for long long size ... 8 byteschecking for void * size ... 8 byteschecking for uint32_t ... foundchecking for uint64_t ... foundchecking for sig_atomic_t ... foundchecking for sig_atomic_t size ... 4 byteschecking for socklen_t ... foundchecking for in_addr_t ... foundchecking for in_port_t ... foundchecking for rlim_t ... foundchecking for uintptr_t ... uintptr_t foundchecking for system byte ordering ... little endianchecking for size_t size ... 8 byteschecking for off_t size ... 8 byteschecking for time_t size ... 8 byteschecking for AF_INET6 ... foundchecking for setproctitle() ... not foundchecking for pread() ... foundchecking for pwrite() ... foundchecking for pwritev() ... foundchecking for sys_nerr ... foundchecking for localtime_r() ... foundchecking for posix_memalign() ... foundchecking for memalign() ... foundchecking for mmap(MAP_ANON|MAP_SHARED) ... foundchecking for mmap("/dev/zero", MAP_SHARED) ... foundchecking for System V shared memory ... foundchecking for POSIX semaphores ... not foundchecking for POSIX semaphores in libpthread ... foundchecking for struct msghdr.msg_control ... foundchecking for ioctl(FIONBIO) ... foundchecking for struct tm.tm_gmtoff ... foundchecking for struct dirent.d_namlen ... not foundchecking for struct dirent.d_type ... foundchecking for sysconf(_SC_NPROCESSORS_ONLN) ... foundchecking for openat(), fstatat() ... foundchecking for getaddrinfo() ... foundchecking for PCRE library ... foundchecking for PCRE JIT support ... foundchecking for OpenSSL library ... foundchecking for zlib library ... foundchecking for libxslt ... foundchecking for libexslt ... foundchecking for GD library ... foundchecking for GD WebP support ... not foundcreating objs/MakefileConfiguration summary + using system PCRE library + using system OpenSSL library + using system zlib library nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/sbin/nginx" nginx modules path: "/usr/local/nginx/modules" nginx configuration prefix: "/usr/local/nginx/conf" nginx configuration file: "/usr/local/nginx/conf/nginx.conf" nginx pid file: "/usr/local/nginx/logs/nginx.pid" nginx error log file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp"

最后的幾行是配置的結果, 注意這里的 pid file 那一行,后面配置服務的時候,需要用的到。

安裝 Nginx

使用如下命令來安裝 nginx 。

make && make install

配置 systemd Nginx 服務和設置 Nginx 自啟動

centos 7 中采用 systemd 來管理系統,我們來為 nginx 創建服務文件,來實現通過 systemd 來管理 nginx 。

創建 systemd 服務文件: /lib/systemd/system/nginx.service,內容如下:

[Unit]Description=The NGINX HTTP and reverse proxy serverAfter=syslog.target network.target remote-fs.target nss-lookup.target[Service]Type=forkingPIDFile=/usr/local/nginx/logs/nginx.pidExecStartPre=/usr/local/nginx/sbin/nginx -tExecStart=/usr/local/nginx/sbin/nginxExecReload=/bin/kill -s HUP $MAINPIDExecStop=/bin/kill -s QUIT $MAINPIDPrivateTmp=true[Install]WantedBy=multi-user.target

這里的 PIDFile 的配置要和前面的 配置保持一致。

設置自啟動

systemctl enable nginx

通過 systemd 管理 nginx

systemctl start nginxsystemctl stop nginxsystemctl restart nginxsystemctl reload nginx

總結

好了,打完收工。以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對VEVB武林網的支持。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 亚洲一区二区三区视频免费 | 欧美一极视频 | 日韩黄色片免费看 | av手机在线免费播放 | 久久精品一二三区白丝高潮 | 欧美一级特黄aaaaaa在线看首页 | 美女久久| 欧美一级不卡视频 | 91成人在线免费视频 | 成年人黄色片视频 | 欧美特级黄色 | 日本黄色一级视频 | 国产18视频 | 免费午夜视频在线观看 | 精品国产看高清国产毛片 | 第四色成人网 | 99在线在线视频免费视频观看 | 久久不射电影网 | 欧美一级高潮 | 久久成人在线观看 | 欧美老外a级毛片 | 欧美日韩大片在线观看 | 九九精品在线观看视频 | 亚洲精品 欧美 | 久久综合色区 | 黄污网站在线观看 | 久久精品视频免费观看 | 亚洲网站在线播放 | 一级大黄毛片 | 一级大黄毛片免费观看 | 中文字幕涩涩久久乱小说 | 中文字幕亚洲情99在线 | 天天夜干 | 毛片大全| 精品国产91久久久久久久 | 成人福利网 | 日韩黄色片免费看 | 欧美一级高潮片免费的 | 一区二区三区视频在线观看 | 一级毛片在线免费播放 | 久久精品中文字幕一区二区三区 |