1
2
3
4
5
6
7
8
9
10
11
12
|
# cd /usr/local/src
# wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
# tar -xzvf LuaJIT-2.0.2.tar.gz
# cd LuaJIT-2.0.2
# make
出现如下内容表示编译成功
OK Successfully built LuaJIT
make
[1]: Leaving directory `
/usr/local/src/LuaJIT-2
.0.2
/src
'
==== Successfully built LuaJIT 2.0.2 ====
# make install
出现如下内容,表示安装成功
==== Successfully installed LuaJIT 2.0.2 to
/usr/local
====
|
1
|
# cd /usr/local/src/nginx-
1.3
.
1
|
1
|
[root@vmware1 nginx-1.3.1]
# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
|
1
2
3
4
|
[root@vmware1 nginx-1.3.1]
# killall nginx
nginx: no process killed
[root@vmware1 nginx-1.3.1]
# cp ./objs/nginx /usr/local/nginx/sbin/
cp
: overwrite `
/usr/local/nginx/sbin/nginx
’?
yes
|
1
2
3
4
5
6
|
[root@vmware1 nginx-1.3.1]
# /usr/local/nginx/sbin/nginx -V
.
/objs/nginx
: error
while
loading shared libraries: libluajit-5.1.so.2: cannot
open
shared object
file
: No such
file
or directory
解决方法:
# ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2
或者:
#export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
1
2
3
4
|
[root@vmware1 nginx-
1.3
.
1
]# /usr/local/nginx/sbin/nginx -V
built by gcc
4.4
.
7
20120313
(Red Hat
4.4
.
7
-
4
) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --pid-path=/
var
/run/nginx.pid --lock-path=/
var
/lock/subsys/nginx --error-log-path=/
var
/log/httpd/error_log --http-log-path=/
var
/log/httpd/access_log --
with
-http_ssl_module --
with
-http_dav_module --
with
-http_flv_module --
with
-http_realip_module --
with
-http_gzip_static_module --
with
-http_stub_status_module --
with
-mail --
with
-mail_ssl_module --
with
-pcre=../pcre-
8.33
--add-module=../lua-nginx-module-
0.9
.5rc2/ --add-module=../echo-nginx-module-master --add-module=../ngx_devel_kit-
0.2
.
19
/
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
Vim usr/local/nginx/conf/nignx.conf
server {
listen
80
;
server_name
192.168
.
1.5
;
index index.php;
root /
var
/www/product/eliteall/v1/hosts;
location ~* ^/
2328
(/.*) {
default_type
'text/plain'
;
content_by_lua
'ngx.say("hello, ttlsa lua")'
;
}
}
cd /
var
/www/product/eliteall/v1/hosts
mkdir
2328
|
1
2
3
|
[root@vmware1 nginx-1.3.1]
# /usr/local/nginx/sbin/nginx
[root@vmware1 nginx-1.3.1]
# netstat -anpt | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6205
/nginx
|
1
2
|
# curl http://192.168.1.5/2328/
hello, ttlsa lua
//
使用curl测试
|