Jumat, 11 Februari 2011

Web Server dengan PHP dan My SQL pada DEBIAN

Halo sob, gue kembali lagi nich... Pada edisi kali ini gue akan posting mengenai web server di Linux... buat yang udah gak sabar nie dia penjelasanya cekidot...

Siapa sich yang nggak tau about LINUX. Linux merupakan SO yang stabil dan banyak digunakan untuk keperluan webserver. Teknologi yang banyak digunakan dalam membangun web server adalah LAMP (linux,apache,mysql, dan php)

INSTALASI

1. bertindak sebagai root

2. instal webserver apache2 debian:~# apt-get install apache2

Reading package lists… Done

Building dependency tree… Done

The following extra packages will be installed:

apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1 libpq4

libsqlite3-0

The following NEW packages will be installed:

apache2 apache2-mpm-worker apache2-utils apache2.2-common libapr1

libaprutil1 libpq4 libsqlite3-0

0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.

Need to get 2428kB of archives.

After unpacking 6300kB of additional disk space will be used.

Do you want to continue [Y/n]?

y

Get:1 http://kambing.ui.edu stable/main libapr1 1.2.7-8.2 [109kB]

Get:2 http://kambing.ui.edu stable/main libpq4 8.1.13-0etch1 [284kB]

Get:3 http://kambing.ui.edu stable/main libsqlite3-0 3.3.8-1.1 [194kB]

Get:4 http://kambing.ui.edu stable/main libaprutil1 1.2.7+dfsg-2 [68.5kB]

Get:5 http://kambing.ui.edu stable/main apache2-utils 2.2.3-4+etch6 [344kB

3. setelah apache terinstal. buktikan dengan membuka web browser dan buka halaman

http://localhost,

atau jika dns sudah terinstal sebelumnya anda dapat menuliskan alamat webnya contoh

http://www.debianmaros.org,

dan akan terlihat tampilan berikut :

3. anda dapat melihat file-file web dalam folder /var/www/apache2-default

4. instal php5 debian:~# apt-get install php5

5. buatlah file baru dengan nama cobacoba.php

debian:~# nano /var/www/cobacoba.php

6. tuliskan kalimat berikut di dalamnya

7. jalankan web browser, dan buka halaman web anda

http://www.debianmaros.org/cobacoba.php

8. instal php5-mysql

debian:~# apt-get install php5-mysql

Reading package lists... Done

Building dependency tree... Done

The following extra packages will be installed:

libmysqlclient15off mysql-common

The following NEW packages will be installed:

libmysqlclient15off mysql-common php5-mysql

0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.

Need to get 1911kB of archives.

After unpacking 4289kB of additional disk space will be used.

Do you want to continue [Y/n]?

y

Get:1 http://kambing.ui.edu stable/main mysql-common 5.0.32-7etch6 [54.2kB]

Get:2 http://kambing.ui.edu stable/main libmysqlclient15off 5.0.32-7etch6 [1792k

9. instal mysql-server

debian:~# apt-get install mysql-server

Reading package lists... Done

Building dependency tree... Done

The following extra packages will be installed:

libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl

mysql-client-5.0 mysql-server-5.0

Suggested packages:

dbishell libcompress-zlib-perl tinyca

The following NEW packages will be installed:

libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl

mysql-client-5.0 mysql-server mysql-server-5.0

0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.

Need to get 33.4MB of archives.

After unpacking 86.9MB of additional disk space will be used.

Do you want to continue [Y/n]?

y

Get:1 http://kambing.ui.edu stable/main libnet-daemon-perl 0.38-1.1 [45.8kB]

Get:2 http://kambing.ui.edu stable/main libplrpc-perl 0.2017-1.1 [34.9kB]

Get:3 http://kambing.ui.edu stable/main libdbi-perl 1.53-1etch1 [676kB]

10. buat password untuk mysql

debian:~# mysqladmin -u root password

Passwordmu

11. konfigurasi file php.ini dengan mengetikkan

#nano /etc/php5/apache2/php.ini

12. carilah baris ; extension=mysql.so, …..(pake ctrl+w) untuk search kalimat, lalu ketik mysql.so ……..hilangkan tanda titik koma (;) didepannya hingga menjadi extension=mysql.so

13. restart apache

debian:~# /etc/init.d/apache2 restart

14. jika mysql telah terinstal, lakukan pengetesan dengan masuk ke mysql

debian:~# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 10

Server version: 5.0.32-Debian_7etch6-log Debian etch distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

15. instal phpmyadmin

debian:~# apt-get install phpmyadmin

Reading package lists… Done

Building dependency tree… Done

Recommended packages:

php5-mcrypt php4-mcrypt php5-gd php4-gd

The following NEW packages will be installed:

phpmyadmin

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Need to get 3608kB of archives.

After unpacking 14.1MB of additional disk space will be used.

Get:1 http://kambing.ui.edu stable/main phpmyadmin 4:2.9.1.1-8 [3608kB]

16. konfigurasi file apache2.conf

debian:~# nano /etc/apache2/apache2.conf

17. pada file apache2.conf tsb, buat sebuah alias baru bernama “phpmyadmin” dan diarahkan ke /usr/share/phpmyadmin dengan menggunakan kode

Alias /phpmyadmin “/usr/share/phpmyadmin/”

Options Indexes MultiViews

AllowOverride None

order allow,deny

Allow from all

18. aksek phpmyadmin melalui web browser dengan mengetikkan pada halaman web

http://www.debianmaros.org/phpmyadmin/index.php

19. tuliskan user dan passwordnya sehingga akan muncul tampilan source : http://desvianri.wordpress.com/2009/02/26/membuat-server-pada-debian-woody/

0 comments:

Poskan Komentar

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews