Tags » Ubuntu/Linux

Setup nginx

Create a configuration file
vi /etc/nginx/conf.d/railsapp.conf and copy the content below

server {
        listen 80;
        server_name railsApp.com;
        rewrite ^ https://$host$request_uri? permanent;
}

server {
        server_name railsApp.com;

        listen 443 ssl;
        ssl_certificate /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /etc/nginx/ssl/nginx.key;

        gzip on;
        gzip_types      text/plain text/css application/javascript;
        gzip_min_length 1000;

        location / {
                proxy_pass http://localhost:3474;
                proxy_set_header Host $host;
                proxy_buffering off;
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # Adding support for WebSocket
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }

        location /forum {
                proxy_pass http://localhost:4001;
                proxy_set_header Host $host;
                proxy_buffering off;
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # Adding support for WebSocket
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
        }
}

Ubuntu/linux

How to install php curl ?

### First, check if there is enabled curl.
$ php info | grep -i curl

### If no result then install the php curl library
$ sudo apt-get install php5-curl

### Once its installed restart the server
$ sudo /etc/init.d/apache2 restart

### Verify if the curl is enabled. 22 more words

How to setup a supervisor - monitor Linux processes

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

More info at http://supervisord.org/ 83 more words

Ubuntu Commands

How to preview video or image thumbnails in Ubuntu ?
$ sudo apt-get install ffmpegthumbnailer
It works also in Ubuntu Mate

How to install Atom editor in Ubuntu Mate

$ sudo add-apt-repository ppa:webupd8team/atom
$ sudo apt-get update
$ sudo apt-get install atom
...

Split terminal windows using tmux

tmux is a terminal multiplexer. It allows you to access a tmux terminal using multiple virtual terminals.
tmux takes advantage of a client-server model, which allows you to attach terminals to a tmux session. 295 more words

Travis CI: This version of node/NAN/v8 requires a C++11 compiler

Upon deploying your node.js app using Travis CI you may encountered a build error that says “This version of node/NAN/v8 requires a C++11 compiler” it means that the current compiler is not capable to build to some node modules like json or time. 319 more words