-
-
Notifications
You must be signed in to change notification settings - Fork 18
Setting up Pepyatka
epicmonkey edited this page Sep 28, 2013
·
12 revisions
- Install redis
- Install graphicsmagick (ensure jpeg and png flags are set)
- Install nodejs
- Install elasticsearch (and java as a dependency ;-)
- Install graphicsmagick library
- Make sure to update secret token: cp ./conf/envDefault.js to ./conf/envLocal.js.
- Install dependencies: npm install
- Update translation file: cp ./public/config/envDefault.js ./public/config/envLocal.js
- Install mocha globally in the system: npm install -g mocha
- Check there are no broken tests: jake test
- Run elasticsearch
- Run server: node ./server.js
- Run search daemon: node ./bin/search-daemon.js
- Run rss daemon: node ./bin/rss-daemon.js 1 (1 is a number of background workers)
This application uses AMD/RequireJS to separate files to controllers, routers, models and templates. To bundle all of them into a single bundle you need to install RequireJS in your system and then run: r.js -o build.js.
For any additional options feel free to look into build.js file. By default it generates two files: common.js which includes all libraries like emberjs, handlebars, etc and main.js which is custom pepyatka application.
Setup nginx as a proxy server:
upstream app_pepyatka {
server 127.0.0.1:3000;
}
server {
listen 0.0.0.0:80;
server_name pepyatka.com pepyatka;
access_log /var/log/nginx/pepyatka.log;
gzip on;
gzip_comp_level 6;
gzip_vary on;
gzip_min_length 1000;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|flash/|media/|static/|files/\
|robots.txt|humans.txt|favicon.ico) {
root /var/www/pepyatka/public;
access_log off;
expires max;
}
# disable logging for some `common` files
# Disable logging for favicon
location = /favicon.ico {
log_not_found off;
access_log off;
}
# Disable logging for robots.txt
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://app_pepyatka/;
proxy_redirect off;
}
}