di Windows
Nginx (di baca engine-x) merupakan server HTTP dan reverse proxy gratis berbasis
open-source berkemampuan tinggi, yang dapat juga digunakan sebagai proxy
IMAP/POP3. Perangkat lunak ini diciptakan oleh Igor Sysoev pada tahun 2002, dan
dirilis untuk pertama kalinya secara umum pada tahun 2004. Nginx yg katanya
terkenal ringan diperkirakan digunakan 7.65% (22.8juta) nama domain di seluruh
dunia. Sejatinya Nginx sebenarnya di peruntukkan untuk operasi system berbasis
open source yaitu Linux namun sekarang bisa di impletasikan ke Windows.
Lanjut kalu begitu, pertama download dulu nginx, disini Saya menggunakan
nginx yang bisa di download di sini dan sudah di pack oleh Kevin Worthington serta
sudah dicompile menggunakan cgywin sehingga bisa langsung dipake untuk
Windows karena jika kita mendownload dari situs resminya maka kita harus
mengkompilenya dulu dengan cgywin.
Kemudian instal nginx tersebut, secara default maka akan terinstal di c:\nginx setelah
selesai maka kita melanjutkan menginstall PHP, download disini, terserah Anda mau
mendownload yang mana, yang perlu di perhatikan adalah letak dari folder dimana
php di install. Sebagai contoh disini Saya meletakkan di c:\nginx\php.
Setelah itu kita akan menggabungkan nginx dengan php tadi, perlu diketahui bahwa
nginx hanya bisa dipasangkan dengan dengan php-cgi. Buka file konfigurasi nginx di
c:\nginx\conf\nginx.conf, edit seperti dibawah ini, pastikan sesuai dengan tempat
peletakan folder php sewaktu penginstalan.
?
1location ~ .php$ {
2 root
html;
3 fastcgi_pass
127.0.0.1:9000;
4 fastcgi_index index.php;
5 fastcgi_param SCRIPT_FILENAME c:/nginx/html/$fastcgi_script_name;
include
fastcgi_params;
6}
7
Setelah itu download runhiddenconsole, letakan di folder c:\nginx\conf , setelah itu
buka file start-nginx.bat difolder yg sama, edit seperti dibawah ini:
?
1 @ECHO OFF
2 c:\nginx\nginx.exe
RunHiddenConsole c:\nginx\php\php-cgi.exe -b 127.0.0.1:9000 -c
3 c:\nginx\php\php.ini
4 ping 127.0.0.1 -n 1>NUL
5 echo Starting nginx
6 echo .
echo .
7 echo .
8
ping 127.0.0.1 >NUL
9 EXIT
10
Selanjutnya install Mysql, caranya tidak perlu Saya terangkan disini karena sangat
mudah tinggal menggunakan jurus enter saja :). Setelah selesai silakan menjalankan
webserver nginx Anda. Perlu diketahui nginx tidak akan membaca file .htacces jadi
sebelum Anda beralih ke nginx perhatikan juga file .htacces Anda, namun Anda bisa
mengconvert file .htacces menggunakan converter online ini dan letakan hasilnya di
file konfigurasi nginx.
me to write the rest of what Ive been putting off. Its a good way to tweak the stack to
your own needs.
I tried to leave this as in 5 minutes, but then I remembered how long it would take
to download MySQL Even on broadband.
Kevin Worthington had very kindly provided a Cygwin build that ran on Windows,
however Nginx now has a Windows build that we can use and this time, we can add
MySQL to the list as well. To keep everything compatible, well be using the 32 bit
versions for all downloads.
Once youve also downloaded Nginx (0.8.53 at the time of this post), head on to the
PHP libraries and remember to download the Windows Libraries only (5.3.3 as of
today) and select the thread safe version. The first steps are the same with the
exception of the download link to MySQL and we need the no-install download.
= your_password
= 3306
= c:/nginx/mysql/tmp/mysql.sock
[mysqld]
port
= 3306
socket
= c:/nginx/mysql/tmp/mysql.sock
basedir
= c:/nginx/mysql
datadir
= c:/nginx/mysql/data
bind-address
= localhost
enable-named-pipe
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
Where newpassword is your new MySQL root password. This is an important step
toward securing your installation.
Now that weve changed our root password enter the following :
mysql -u root -p
Which will give you a password prompt. Enter your newpassword created before.
Once youre logged in, youre at the MySQL console.
If you need to change your root password at a future date, run mysql as above type the
following :
update mysql.user set password=PASSWORD('new-newpassword') where
user='root';
Note that passwords are encoded before storage in the database, so we need to run the
PASSWORD function on our new-newpassword. Once thats done, be sure to run :
flush privileges;
Now we need to remove all the junk that came with the server.
Delete the test databases and anonymous users (Always remember the semicolon at
the end!) :
delete from mysql.user where user='root' and host!='localhost';
drop database test;
delete from mysql.db where db='test' or db='test\_%';
Now if we need to, we can stop MySQL by running the following (in
C:\nginx\mysql\bin\ as an Administrator of course):
net stop mysql
And if we need to remove it from our services entirely, run the following :
mysqld --remove
Share this: