centos 7 安裝 NodeBB紀錄
1.Install Node.js and npm
sudo yum install nodejs
2.Install MongoDB
sudo yum install mongodb-org
3.Install NodeBB
sudo git clone -b v1.x.x https://github.com/NodeBB/NodeBB nodebb
cd nodebb
sudo npm install
4.Setup apache
<VirtualHost *:80>
#ServerAdmin [email protected]
DocumentRoot "/var/www/nodebb"
ServerName www.yourdomain.com
#ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/nodebb-error_log"
CustomLog "/var/log/httpd/nodebb-access_log" combined
ProxyPass / http://localhost:4567/
ProxyPassReverse / http://localhost:4567/
<Directory "/var/www/nodebb/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine on
#Redirect a whole subdirectory:
RewriteRule ^node/(.+) http://www.yoururl.com/$1 [P]
ProxyRequests off
RequestHeader set X-Forwarded-Proto "http"
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:4567/$1 [P,L]
ProxyPass / http://127.0.0.1:4567/
ProxyPassReverse / http://127.0.0.1:4567/
</IfModule>
</VirtualHost>