从Nginx切换到Tengine的步骤分享

2019-10-17 21:10:29王冬梅


./configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.

这里提示XSLT模块不存在,在上面的编译脚本中搜索xslt,找到了--with-http_xslt_module,删除就可以了,同样注意前后的空格。

成功后提示如下(其中的路径是跟编译脚本有关的,所以可能会略有不同):


Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library

nginx path prefix: "/etc/nginx"
nginx binary file: "/etc/nginx/sbin/nginx"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/lib/nginx/body"
nginx dso module path: "/etc/nginx/modules"
nginx http proxy temporary files: "/var/lib/nginx/proxy"
nginx http fastcgi temporary files: "/var/lib/nginx/fastcgi"
nginx http uwsgi temporary files: "/var/lib/nginx/uwsgi"
nginx http scgi temporary files: "/var/lib/nginx/scgi"


6. 继续编译(make就可以了,不需要make install):

make

7. 到objs目录下编译好的nginx文件:

cd objs/

8. 停止nginx:

service nginx stop

9. 复制objs目录下的nginx文件到/usr/sbin/nginx目录,覆盖前记得备份原来文件:

cp /usr/sbin/nginx /usr/sbin/nginx.bak
cp nginx /usr/sbin/

9. 测试nginx是否正常(/user/sbin目录):
nginx -t
如果出现syntax is ok,test is successful表示成功:

the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful

10. 重新启动nginx

service nginx start


访问服务器上一个不存在的页面,查看服务器是否是Tengine

403 Forbidden
You don't have permission to access the URL on this server. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!

URL: http://10.20.131.181/doc
Server: ubuntu-bak
Date: 2012/10/06 17:54:53
Powered by Tengine/1.4.0


注意看最后一行:Powered by Tengine/1.4.0 表示我们已经成功从Nginx切换到了Tengine