3
回答

今天按照教程上说的在centos7上配置tengine出错Starting nginx (via systemctl): Failed to issue method call: Unit nginx.service is masked. [失败] 在网上搜也没搜到
具体我的配置过程如下
- 把tengine放到/opt目录下 然后解压
- 安装依赖yum -y install gcc openssl-devel pcre-devel zlib-devel
- 编译三步走 进入解压好的tengine文件里 然后复制下面这一段执行
./configure \
--prefix=/opt/sxt/soft/tengine-2.1.0/ \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--http-scgi-temp-path=/var/tmp/nginx/scgi \
--with-pcre
make && make install
文件把里面的内容复制粘贴到/etc/init.d/下面创建的nginx文件里 然后编辑nginx文件
把nginx=后面改成/opt/sxt/soft/tengine-2.1.0/sbin/nginx
把NGINX_CONF_FILE=后面改成/opt/sxt/soft/tengine-2.1.0/conf/nginx.conf
chmod 755 nginx
chkconfig nginx on
最后service nginx start 出错 service nginx stop却不会出错