Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Compile & install Nginx web server

Requirement on Mac OS X: Xcode

   1  
   2  # See:
   3  # - http://en.wikipedia.org/wiki/Nginx
   4  # - http://wiki.codemongers.com/NginxGettingStarted
   5  # - http://wiki.codemongers.com/NginxInstallOptions
   6  # - http://wiki.codemongers.com/NginxCommandLine
   7  # - http://wiki.codemongers.com/NginxConfiguration
   8  
   9  export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
  10  
  11  mkdir -p ~/Desktop/Nginx
  12  cd ~/Desktop/Nginx
  13  
  14  curl -L -O http://sysoev.ru/nginx/nginx-0.7.2.tar.gz
  15  tar -xzf nginx-0.7.2.tar.gz
  16  
  17  curl -L -O http://downloads.sourceforge.net/pcre/pcre-7.7.tar.gz
  18  tar -xzf pcre-7.7.tar.gz
  19  
  20  cd ~/Desktop/Nginx/nginx-0.7.2
  21  ./configure --help
  22  ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin --with-debug --with-http_ssl_module --with-pcre=../pcre-7.7
  23  make
  24  sudo make install
  25  
  26  
  27  which nginx
  28  otool -L /usr/local/sbin/nginx
  29  open /usr/local/nginx
  30  open -e /usr/local/nginx/conf/nginx.conf
  31  
  32  nginx -v
  33  nginx -V
  34  sudo nginx   # start server
  35  sudo nginx -t
  36  
  37  open http://localhost:80
  38  open http://localhost:80/50x.html
  39  
  40  sudo nano /usr/local/nginx/conf/nginx.conf   # editing ... server {  listen  8080; ... 
  41  
  42  # reload configuration
  43  sudo kill -HUP `cat /usr/local/nginx/logs/nginx.pid`  
  44  
  45  # stop server
  46  sudo kill -15 $(ps -auxxx | egrep "[n]ginx.*master" | awk '{ print $2 }') 2>/dev/null
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS