LeanClub 是高性能 C++ 论坛系统。
注意:不建议在生产环境使用!
特性
-
速度非常快,20000 RPS on i7 iMac.
-
前端非常简洁
-
完全是 Ajax 和 API
-
可以使用 Google GitHub Twitter OAuth 登录
要求
-
GCC 4.8
-
CMake 2.8
(不支持 Windows)
安装
数据库
-
创建 4 个数据库: “category” “notification” “topics” 和 “user”
-
导入 “databases” 目录
环境
-
apt-get install build-essential cmake libcurl4-nss-dev libboost-all-dev redis-server libtcmalloc-minimal4 && sudo ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc_minimal.so
-
Install hiredis from sources ( redis3m is already included )
配置
cp src/config.h.example.h src/config.h vi src/config.h
构建运行
mkdir Build cd Build cmake .. make ./leanclub
Nginx
server { listen 80; server_name leanclub.org; client_max_body_size MAX_UPLOAD_SIZE; root /path/to/leanclub/; location / { proxy_pass http://127.0.0.1:18080; proxy_redirect off; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_set_header Host leanclub.org; add_header X-XSS-Protection "1; mode=block"; add_header X-Frame-Options DENY; } # Cache the avatar (Optional) # location /info/ { # proxy_pass http://127.0.0.1:18080; # proxy_redirect off; # proxy_set_header X-Forwarded-For $http_x_forwarded_for; # proxy_set_header Host leanclub.org; # proxy_cache one; # proxy_cache_key "$request_uri"; # proxy_cache_valid 200 302 120m; # } location /static/ { expires 10d; } location /attachments/ { expires 365d; } }
reverse proxy 127.0.0.1:18080 , and map the "static" and "attachments" folder.
关于
此系统基于 Crow