编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

Tengine-2.1.0的安装与配置(tengine lua)

wxchong 2024-08-16 05:50:19 开源技术 17 ℃ 0 评论

※依赖库:

PCRE

OpenSSL

Zlib

jemalloc

※安装方式:

Linux下解压,执行:

./configure

make

make install

一、库文件

tar -jxvfjemalloc-3.6.0.tar.bz2 -C /usr/local/src

sudo apt-get installopenssl libssl-dev

tar -jxvfpcre-8.36.tar.bz2 -C /usr/local/src

tar -xvfzlib-1.2.8.tar.gz -C /usr/local/src

wgethttp://tengine.taobao.org/download/tengine-2.1.0.tar.gz

tar -zxvftengine-2.1.0.tar.gz

cd tengine-2.1.0

二、tengine-2.1.0安装

在tengine-2.1.0根目录下执行:

./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/src/pcre-8.36--with-jemalloc=/usr/local/src/jemalloc-3.6.0 --with-http_gzip_static_module--with-http_realip_module --with-http_stub_status_module--with-http_concat_module --with-zlib=/usr/local/src/zlib-1.2.8 --user=elvis --group=elvis

’--user=elvis --group=elvis‘ 可不写

注意配置的时候–with-pcre、–with-openssl、–with-jemalloc、–with-zlib的路径为源文件的路径

make

make install

三、配置

打开nginx.conf配置文件后,最基础的需要做以下几个地方的修改(/usr/local/nginx/conf/nginx.conf)

[html] view plain copy

  1. --user=elvis
  2. #自动以CPU核心数启动相应数量的进程
  3. worker_processes auto;
  4. #全局的错误日志地址,方便调试
  5. error_log/home/jason/BigDisk/nginx/error.log;
  6. #开启gzip支持
  7. gzip on
  8. server {
  9. #设置默认访问的server(default是指通过ip或者servername未定义的域名进行访问时就走到这个server)
  10. listen 80 default;
  11. #默认访问的路径
  12. root /home/jason/Work/nginx-default;
  13. location / {
  14. index index.php index.html index.htm;
  15. }
  16. #默认错误页面
  17. error_page 500 502 503 504 /50x.html;
  18. location = /50x.html {
  19. root html;
  20. }
  21. #抓发到php-fpm
  22. location ~ \.php$ {
  23. fastcgi_pass unix:/var/run/php-fpm.socket;
  24. fastcgi_index index.php;
  25. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  26. include fastcgi_params;
  27. }
  28. }

#引用其他的vhost配置文件

include vhost/*.conf;四、启动

wget --no-check-certificate 'http://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx'-O /etc/init.d/nginx

chmod 777/etc/init.d/nginx

/etc/init.d/nginxstart

浏览器输入主机ip即可访问

中途出现问题,随时可以来问我。

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表