Skip to content

Instantly share code, notes, and snippets.

@minostro
Last active February 18, 2019 16:43
Show Gist options
  • Save minostro/11387989 to your computer and use it in GitHub Desktop.
Save minostro/11387989 to your computer and use it in GitHub Desktop.
Configuring Nginx on Webfaction

1.- Get into the src folder, download & extract nginx source

  • cd ~/src
  • curl -O http://nginx.org/download/nginx-1.7.0.tar.gz
  • tar -xzvf nginx-1.7.0.tar.gz
  • cd nginx-1.7.0

2.- Configuring the source

./configure --prefix=$HOME/local/nginx
--sbin-path=$HOME/local/sbin/nginx
--conf-path=$HOME/local/etc/nginx.conf
--error-log-path=$HOME/logs/user/nginx/error.log
--http-log-path=$HOME/logs/user/nginx/access.log
--pid-path=$HOME/local/run/nginx/nginx.pid
--lock-path=$HOME/local/lock/nginx.lock
--http-client-body-temp-path=$HOME/tmp/nginx/client/
--http-proxy-temp-path=$HOME/tmp/nginx/proxy/
--http-fastcgi-temp-path=$HOME/tmp/nginx/fcgi/
--with-http_flv_module
--with-http_ssl_module
--with-http_gzip_static_module

3.- Compile & Install

  • make
  • make install

4.- Creating folders

  • mkdir -p ~/tmp/nginx/fcgi ~/tmp/nginx/proxy ~/tmp/nginx/client

5.- Modifying the Path

  • export PATH=/home/axion/local/sbin:$PATH
  • source ~/.bashrc

6.- Create a custom app on Webfaction

7.- The configuration file

  • mv ~/local/etc/nginx.conf ~/local/etc/nginx.conf.backup

8.- Edit the configuration file as needed & check it

  • nginx -t

9.- Start, Stopping & Reloading

  • nginx
  • nginx -s stop
  • nginx -s reload
  • nginx -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment