Blackstreetnight Wordpress Com

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

SEARCH

Bcsegso akt tih lg l r nt e 'B


J U S T A N O T H E R B L A C K S H I Home R T

Search Subscribe

LINUX

ANG BLOGS TENT

// you're reading...
DEBIAN, LINUX, UBUNTU CATEGORIES

Setup Nginx, php5 (php5-fpm), mysql server dan phpmyadmin di debian


POSTED BY BLACKSHIRT NOVEMBER 10, 2011 LEAVE A COMMENT

Debian FreeBSD Linux Other .. bisa python Tips Ubuntu Web


ARCHIVES

Suatu waktu berkesempatan mencoba Nginx (engine-X), yang konon katanya high-performance web server, ringan, dan cepat dibaca di http://wiki.nginx.org

Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev started development of Nginx in 2002, with the first public release in 2004. Nginx now hosts nearly 11.28% (43M) of all domains worldwide. Netcraft predicts that current trends will soon have Nginx surpassing Microsoft IIS as the second most popular web server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption. Nginx is one of a handful of servers written to address the C10K problem. Unlike traditional servers, Nginx doesnt rely on threads to handle requests. Instead it uses a much more scalable event-driven (asynchronous) architecture. This architecture uses small, but more importantly, predictable amounts of memory under load. Even if you dont expect to handle thousands of simultaneous requests, you can still benefit from Nginxs high-performance and small memory footprint. Nginx scales in all directions: from the smallest VPS all the way up to clusters of servers. Nginx powers several high-visibility sites, such as WordPress, Hulu, Github, Ohloh, SourceForge, WhitePages and TorrentReactor.
Karena memang dipakai buat php programming, dan mysql server buat databasenya, alangkah baiknya jika dicatat agar penulis sendiri tidak lupa dan mudah-mudahan bermanfaat bagi yang lain Saya menggunakan debian linux 64 bit, untuk sistem sejenis (ubuntu, mint dll) saya rasa tinggal disesuaikan sendiri Installasi nginx, php5-fpm Sayang sekali, repository default debian belum menyertakan php5-fpm, jadi penulis menambahkan repository non formal http://packages.dotdeb.org/ ke sources.list, lalu jalankan update dan install
$echo deb http://packages.dotdeb.org/ stable all | sudo tee -a /etc/apt/sources.list

February 2012 January 2012 December 2011 November 2011 October 2011 September 2011 August 2011 June 2011 February 2011 January 2011 October 2010
BLOGROLL

Deny26 aka archit3x Hellnest Me Integer Manual blog Lisnux Ninja Tuxer Saa7_go
MET A

Register tambahkan keyring, Log in


$wget http://www.dotdeb.org/dotdeb.gpg $cat dotdeb.gpg | sudo apt-key add $sudo apt-get update

Kemudian install nginx web server dan php5-fpm, beserta paket lain yang diperlukan
$sudo apt-get install php5-cli php5-suhosin php5-fpm php5-cgi php5-mysql nginx mysql-server phpmyadmin

Default instalasi nginx di debian tidak membuat dan menggunakan /var/www sebagai root dokumen-nya untuk web, tetapi default bawaannya menggunakan direktori /usr/share/nginx/www. Konfigurasi Nginx Agar bisa diakses localhost, buka dan edit file /etc/nginx/sites-available/default
1 $gksudo gedit /etc/nginx/sites-available/default

converted by Web2PDFConvert.com

dan rubah root direktorinya, menjadi


server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 root /var/www; index index.html index.php index.htm; ...........

Kemudian agar nginx bisa memproses php script menggunakan php-fpm tadi, tambahkan di /etc/nginx/sites-available/default, sehingga menjadi

............ location ~ .php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass backend; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } ## Disable viewing .htaccess & .htpassword location ~ /\.ht { deny all; } } upstream backend { server 127.0.0.1:9000; } ......

Kemudian kita test, dengan membuat file index.php di bawah direktori /var/www, dengan isi : dan coba cek apakah nginx bisa memproses php script tersebut. Kalau sukses, dan tidak ada masalah.. seperti scrinsut di bawah

Kemudian untuk menambahkan phpmyadmin agar bisa diakses, tambahkan baris berikut di /etc/nginx/sites-available/default,
location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include /etc/nginx/fastcgi_params;

converted by Web2PDFConvert.com

} location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; }

yang nantinya agar bisa diakses dengan alamat http://localhost/phpmyadmin.. ini scrinsut punya penulis

Dan tinggal dikembangkan


Rate this: Like this: 1 Vote Be the first to like this post.

PHP date() error .

FreeBSD sehari-hari :)

D I S C U S S I O N
NO COMMENTS YET .

LEAVE A REPLY

E n t e r y o u r h e r e . . .

c o m m e n t

Blackstreetnight's Blog

Blog at WordPress.com. Theme: The Morning After by WooThemes.

converted by Web2PDFConvert.com

You might also like