File tree Expand file tree Collapse file tree 8 files changed +27
-20
lines changed Expand file tree Collapse file tree 8 files changed +27
-20
lines changed Original file line number Diff line number Diff line change 80
80
└── js
81
81
```
82
82
## Openresty Installation
83
- + Prerequisites:` apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential `
83
+ + Prerequisites:
84
+ ```
85
+ apt-get install libreadline-dev libncurses5-dev libpcre3-dev \
86
+ libssl-dev perl make build-essential
87
+ ```
84
88
+ Building:
85
89
```bash
86
- wget https://openresty.org/download/openresty-1.11.2.1 .tar.gz
90
+ wget https://openresty.org/download/openresty-1.11.2.3 .tar.gz
87
91
tar xvf openresty-1.11.2.1.tar.gz
88
92
cd openresty-1.11.2.1
89
93
./configure --prefix=/opt/openresty \
90
- --with-pcre-jit \
91
- --with-ipv6 \
94
+ --with-luajit \
92
95
--without-http_redis2_module \
93
96
--with-http_iconv_module \
94
- --with-http_postgres_module \
95
- -j2
96
- make
97
+ --with-http_postgres_module
98
+ make -j2
97
99
sudo make install
98
100
```
99
-
101
+ + error
102
+ + 错误1:`you need to have ldconfig in your PATH env when enabling luajit.`
103
+ + 解决办法:
104
+ ```bash
105
+ sudo apt-get install luajit
106
+ whereis luajit
107
+ luajit: /usr/bin/luajit /usr/share/man/man1/luajit.1.gz
108
+
109
+ ./configure --prefix=/opt/openresty \
110
+ --with-luajit=/usr/bin/luajit \
111
+ --without-http_redis2_module \
112
+ --with-http_iconv_module \
113
+ --with-http_postgres_module
114
+ make -j2
115
+ sudo make install
116
+ ```
100
117
## nginx.conf, the Nginx web server configuration
101
118
102
119
```bash
103
120
user www www;
104
121
worker_processes 8;
105
122
106
123
pid logs/nginx.pid;
124
+ error_log log/error.log error;
107
125
worker_rlimit_nofile 204800;
108
126
109
127
events {
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ server {
14
14
listen 8080;
15
15
server_name localhost;
16
16
index index.php index.html index.htm;
17
- #access_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/demo_access.log;
18
- error_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/demo_error.log error;
19
17
set $project_path /mnt/hgfs/Linux-Share/Lua/; # 定义项目根目录,如项目放在/home/www/
20
18
set $web_root "${project_path}lua_project_v0.01/template/websocket";
21
19
Original file line number Diff line number Diff line change 5
5
charset utf8;
6
6
default_type text/html;
7
7
index chatroom.html index.htm;
8
- #access_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/index_access.log;
9
- error_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/index_error.log error;
10
8
11
9
#加载模板文件
12
10
set $template_root "/mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/template";
Original file line number Diff line number Diff line change 9
9
charset utf8;
10
10
default_type text/html;
11
11
index chatroom.html index.htm;
12
- #access_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/live_access.log;
13
- error_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/live_error.log error;
14
12
15
13
#加载直播模板
16
14
set $project_path /mnt/hgfs/Linux-Share/Lua/; # 定义项目根目录,如项目放在/home/www/
Original file line number Diff line number Diff line change 7
7
charset gbk;
8
8
index chatroom.html index.htm index.phtm;
9
9
set $project_path /mnt/hgfs/Linux-Share/Lua/;
10
- access_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/product_access.log;
11
- error_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/product_error.log error;
12
10
13
11
#加载模板文件
14
12
set $project_path /mnt/hgfs/Linux-Share/Lua/; # 定义项目根目录,如项目放在/home/www/
Original file line number Diff line number Diff line change 4
4
server_name 127.0.0.1;
5
5
charset utf8;
6
6
default_type application/json;
7
- #access_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/upstream_access.log;
8
- #error_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/upstream_error.log error;
9
7
10
8
proxy_set_header Host $http_host;
11
9
proxy_set_header X-Forwarded-Port $server_port;
Original file line number Diff line number Diff line change 5
5
listen 8082;
6
6
server_name localhost;
7
7
index index.php chatroom.html index.htm;
8
- #access_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/waf_access.log;
9
- #error_log /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/logs/waf_error.log error;
10
8
11
9
set $web_root /mnt/hgfs/Linux-Share/Lua/lua_project_v0.01/template/waf;
12
10
root $web_root;
Original file line number Diff line number Diff line change 1
1
user tinywan;
2
2
worker_processes 8 ;
3
3
pid logs/nginx.pid;
4
+ error_log log/error.log error ;
4
5
events {
5
6
use epoll ;
6
7
worker_connections 1024 ;
You can’t perform that action at this time.
0 commit comments