Blog biasa dari orang biasa

10.05.2010

LAMP di artikel ini bukan LAMPP-nya Apache-friends (atau biasa dikenal dengan XAMPP Linux). Apache, MySQL, dan PHP, yang dibutuhkan untuk webserver, secara native jalan di Linux. Maka ada baiknya mempelajari cara install-nya, bukan dengan yang instan macam XAMPP.

Tidak seperti Slackware, Zenwalk tidak menyertakan LAMP di CD instalasinya. Maka kita perlu download dulu paket-paketnya, apache, libmcrypt (dependensinya apache), mysql, php. Kemudian install semua paket tersebut.

Konfigurasi Apache (httpd)
Setelah terinstall, kita buat file /etc/rc.d/rc.httpd menjadi executable.
root# chmod +x /etc/rc.d/rc.httpd
Kemudian jalankan service httpd
root# /etc/rc.d/rc.httpd start
O iya, di Zenwalk 6.4, biar bisa dieksekusi kita perlu bikin symlink untuk libgmp
root# ln -s /usr/lib/libgmp.so.10.0.1 /usr/lib/libgmp.so.3
Kita buka localhost atau 127.0.0.1 di browser. Kalo ada tulisan It Works! berarti apache sudah berjalan.



Konfigurasi httpd.conf
Biar bisa menggunakan PHP, kita edit file /etc/apache/httpd.conf. Pada baris terakhir, uncomment (hapus #) untuk meng-enable PHP

include /etc/apache/mod_php.conf
Kemudian tambahkan index.php di DirectoryIndex (baris ke 227)

DirectoryIndex index.php index.html

Konfigurasi MySQL
Kita buat rc.mysqld executable
chmod +x /etc/rc.d/rc.mysqld
Kemudian install database MySQL
root# mysql_install_db --user=mysql
Eksekusi rc.mysqld
root# /etc/rc.d/rc.mysqld start
Kemudian jalankan Secure installation. Disini kita bisa nge-set password mysql, dan settingan lain. Kalo bingung kaya saya, tekan enter aja.
root# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

....................................................................................
....................................................................................
................................dst.................................................
....................................................................................
....................................................................................

Reload privilege tables now? [Y/n]
... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Kita coba login ke MySQL

root# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.46-log Source distributionCopyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 licenseType 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>


Aktifkan MySQL support di php.ini. Edit file /etc/apache/php.ini, kemudian uncomment (hapus karakter ; ) di baris 810

; To activate MySQL support, uncomment this line :
extension=mysql.so
Restart rc.mysqld untuk mengupdate perubahan (etc/rc.d/rc.mysqld restart)

Install Wordpress
Pertama, kita buat database terlebih dahulu. Login ke MySQL, kemudian buat database, misalnya blogku

mysql> CREATE DATABASE blogku;
Query OK, 1 row affected (0.11 sec)


Ekstrak wordpress ke /var/www/htdocs. Biar lebih gampang, kita ubah permissionya
root# chmod -R 777 /var/www/htdocs/wordpress

Edit wp-config-sample.php kemudian simpan dengan nama wp-config.php


/** The name of the database for WordPress */
define('DB_NAME', 'blogku');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'your-mysql-password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Lalu kita buka wordpress di browser


 
Wordpress siap digunakan.
Huff.... selesai. Semoga bermanfaat.

0 komentar:

Posting Komentar