Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
litespeed_wiki:nodejs_setup [2014/07/30 15:42] Michael Armstrong |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Setting Up Node.js ====== | ||
- | Node.js is a platform that generally runs as a separate web server. LiteSpeed Web Server can be configured to proxy traffic to Node.js so that users can run Node.js applications (like Ghost) on their sites. | ||
- | |||
- | The following wiki guides you through the steps to set up Node.js with LiteSpeed Web Server. The wiki assumes that you have a functional LSWS installation running off of Apache configurations (though the steps can be easily adapted to using LSWS native configuration files). | ||
- | |||
- | ===== Install Node.js ===== | ||
- | |||
- | - wget http://nodejs.org/dist/node-latest.tar.gz | ||
- | - tar xvzf node-latest.tar.gz | ||
- | - cd node-vX.X.X | ||
- | ./configure --prefix=~ | ||
- | make | ||
- | make install | ||
- | |||
- | ===== Proxy Node.js Traffic ===== | ||
- | |||
- | Now that Node.js is installed on your server, you will need to tell LSWS to send the proper traffic to Node.js. Starting with LSWS 4.2.13, this can be done with a just a rewrite rule (if Node.js is installed on the same server as LSWS). Simply add a rewrite rule that will redirect traffic to the port Node.js is listening on. The following is an example: | ||
- | |||
- | RewriteEngine On | ||
- | RewriteRule ^$ http://127.0.0.1:XXXXX/ [P,L] | ||
- | RewriteCond %{REQUEST_FILENAME} !-f | ||
- | RewriteCond %{REQUEST_FILENAME} !-d | ||
- | RewriteRule ^(.*)$ http://ghost.domain.com:60385/ghost/$1 [P,L] | ||
- | |||
- | The above example redirects all traffic |