Linux下源码安装Nginx

1.yum下载安装gcc、zip、openssl、openssl--devel、pcre

yum install -y gcc zip openssl openssl--devel pcre

2.下载安装nginx

下载地址:http://nginx.org/download/

./configure --sbin-path=/usr/local/nginx \
--conf-path=/usr/local/nginx/nginx.conf \
--pid-path=/usr/local/nginx/nginx.pid \
--with-http_ssl_module\ #开启ssl模块
--with-http_stub_status_module \#启用监控nginx的当前状态
--user=nginx

make && make install

启动服务

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

停止服务

kill -9 pid

打开nginx.conf
修改

server {
    server_name xxxx;#域名
}

重启命令

/usr/local/nginx/nginx -s reload

2016/12/4 18:12:07

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容