CentOS 安装 Nginx
软件小窝
2023-08-25 23:11:042.38k 字预计阅读时长 4 分钟
yum install gcc
yum install pcre pcre-devel
yum install openssl openssl-devel
yum install zlib zlib-devel
yum -y install libxml2 libxml2-dev
yum -y install libxslt-devel
yum install gd gd-devel
Tips:如果不指定 --prefix 目录,默认安装到 `/usr/local/nginx`
./configure --prefix=xxx --with-select_module --with-poll_module --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_xslt_module=dynamic --with-http_image_filter_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-stream --with-stream=dynamic --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module --with-compat
./configure --prefix=xxxx
--with-select_module
--with-poll_module
--with-threads
--with-file-aio
--with-http_ssl_module
--with-http_v2_module
--with-http_realip_module
--with-http_addition_module
--with-http_xslt_module
--with-http_xslt_module=dynamic
--with-http_image_filter_module
--with-http_image_filter_module=dynamic
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_auth_request_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_degradation_module
--with-http_slice_module
--with-http_stub_status_module
--with-stream
--with-stream=dynamic
--with-stream_ssl_module
--with-stream_realip_module
--with-stream_ssl_preread_module
--with-compat
make
make install
启动
xxx/xxx/sbin/nginx
重载
xxx/xxx/sbin/nginx -s reload
停止
xxx/xxx/sbin/nginx -s stop