openresty php luajit

来源:互联网 发布:单片机哪种好 编辑:程序博客网 时间:2024/04/19 13:43

http://www.cppblog.com/AutomateProgram/archive/2013/03/21/198685.html


yum install -y pcre-devel readline-devel    openssl-devel


mkdir download

cd download

wget http://openresty.org/download/ngx_openresty-1.4.3.6.tar.gz

tar xvf ngx_openresty-1.4.3.6.tar.gz

cd  ngx_openresty-1.4.3.6

./configure --with-luajit

gmake

gmake install


nano /usr/local/openresty/nginx/conf/nginx.conf

location /hello { 

      default_type 'text/plain'; 
      content_by_lua 'ngx.say("hello, lua")'; 
}


/usr/local/openresty/nginx/sbin/nginx 

/usr/local/openresty/nginx/sbin/nginx -s reload


===


git clone http://luajit.org/git/luajit-2.0.git

cd luajit-2.0

make

make install

===============


yum install -y php php-devel php-mysql


php-cgi   -b 127.0.0.1:9000

nano www/index.php 

==nginx==

server {
        listen  80;
        server_name myserver.com;
        charset utf-8;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $http_x_forwarded_for;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
location ~ \.php$ {
root /root/www; 
fastcgi_pass 127.0.0.1:9000; 
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}

nohup php-cgi -b 127.0.0.1:9000 > /dev/null 2> /dev/null &