Saturday, May 10, 2014

Cara Install NginX Web Server

Sumber : http://hex-a.blogspot.com/2014/05/cara-install-web-server-nginx-160-dari.html

Nginx merupakan web server yang populer saat ini. tidak heran jika web server ini telah banyak di gunakan oleh pemilik Website di seluruh dunia, Nginx juga minim resources hardware.
untuk info lebih lanjut silahkan kunjungi website resminya www.nginx.org. 

Oke langsung saja kita menginstall webserver Nginx.

Dalam tutorial ini kita akan menginstall nginx dengan spesifikasi berikut.

  • SSL module: enable HTTPS/SSL support.
  • SPDY module: enable experimental support for SPDY.
  • Real IP module: change the client's IP address based on HTTP request header.
  • Addition module: add text before and after a HTTP response.
  • XSLT module: convert an XML response with the help of XSLT templates.
  • Image filter module: transform JPG/GIF/PNG images with libgd.
  • GeoIP module: geolocate a client' IP address, using MaxMind databases.
  • Substitution module: replace a specified string by another in HTTP responses.
  • DAV module: enable support for the WebDAV protocol.
  • FLV module: enable support for Flash Video (FLV) streaming videos.
  • MP4 module: enable support for H.264/AAC streaming videos.
  • Gunzip module: decompresses gzip-compressed responses when necessary.
  • Gzip static module: send responses with gzip-precompressed content.
  • Random index module: serve a randomly chosen index file in a directory.
  • Secure link module: check authenticity of requested links.
  • Stub status module: get some status from Nginx.
  • Perl module: allow Perl in Nginx config files.
  • Mail SSL module: enable support for SSL/TLS protocol for mail proxy server.
  • Google Perftools module: enable Google performance tools profiling. 
Install Pendukung untuk kompilasi.
Pertama Install paket yang di butuhkan serta modul-modul yang akan si tambahkan
Untuk Debian dan turunannya.
# apt-get install build-essential zlib1g-dev libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgd2-xpm-dev libgeoip-dev libgoogle-perftools-dev libperl-dev
Untuk RedHat dan turunannya.
# yum install gcc-c++ pcre-devel zlib-devel make wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools-devel
Kompilasi Nginx
Download versi stabil dari website resminya www.nginx.org/en/download.html.
# wget http://nginx.org/download/nginx-1.6.0.tar.gz
Ekstrak dan kompile, ikuti langkah berikut.
# tar xvf nginx-1.6.0.tar.gz
# cd nginx-1.6.0
# ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-pcre --with-google_perftools_module --with-debug
# make
# make install
Buat sistem user dan group nginx yang akan dijalankan sebagai Nginx.
# useradd -r nginx
Membuat script init nginx utnuk menjalankan nginx.
# wget http://ip-v.tk/repo/init.d
# mv init.d /etc/init.d/nginx
# chmod 0755 /etv/init.d/nginx 
Sesudah menjalankan perintah di atas, lalu jalan nginx
# /etc/init.d/nginx start
# netstat -nap | grep nginx
Test di web browser
ketikkan ip address atau nama domain yang sudah anda buat. jika sukse maka akan muncul tampilan seperti di bawah ini.
Folder konfigurasi nginx terletak di /etc/nginx dan dukumen terletak di /usr/local/nginx/html.

0 comments:

Post a Comment