作者:Chancel, 更新:2018 Dec 28, 字数:1767, 已阅:673
yum install -y gcc gcc-c++
yum install -y pcre pcre-devel openssl openssl-devel zlib zlib-devel
useradd -s /sbin/nologin -M nginx
# 查看nginx的身份
id nginx
https://github.com/slact/nchan/archive/v1.1.14.tar.gz
tar -zxvf v1.1.14.tar.gz
wget https://github.com/nginx/nginx/archive/release-1.13.5.tar.gz
tar -zxvf release-1.13.5.tar.gz
. auto/configure \
--user=root \
--group=root \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-pcre \
--with-file-aio \
--with-http_realip_module \
--without-http_scgi_module \
--without-http_uwsgi_module \
--without-http_fastcgi_module \
--add-module=/home/nginx/nchan-1.1.14
make && make install
http {
server {
listen 80;
location = /sub {
nchan_subscriber;
nchan_channel_id foobar;
}
location = /pub {
nchan_publisher;
nchan_channel_id foobar;
}
}
}
# cent7 OS 需要关闭防火墙
systemctl stop firewalld
nginx -c /etc/nginx/nginx.conf