Sunday, April 17, 2011

Instalasi apache, PHP, MySQL dan Phpmyadmin

setelah bisa melakukan konfigurasi repository pada linux, maka tutorial selanjutnya saya akan melanjutkan dengan tahap instalasi apache, php dan phpmyadmin, bagi user yang ingin membuat website secara offline (tidak terhubung ke internet) maka harus menginstalasi web server, salah satu web server yang ada pada linux adalah apache, kenapa saya memilih instalasi satu persatu, supaya agar lebih paham proses instalasi dan file-file apa saja yang diperlukan untuk instalasinya, proses pertama untuk instalasi web server adalah menginstal php dengan cara,

Instalasi PHP dan Apache:

1. buka terminal dari : applications > System Tools > Terminal
2. Ketik “su -l”
3. masukkan password root pada saat instalasi fedora
4. ketik “yum install php-pear php-pdo php-mysql php-pgsql php-pecl-memcache php-gd php-mbstring php-mcrypt php-xml”
5. Tunggu beberapa saat agar proses intalasi program php berjalan dengan baik
6. setelah proses instalasi php selesai, masih di terminal ketikkan perintah “service httpd start” peritah ini berfungsi untuk menjalankan service web servernya, setelah menggetikkan perintah tersebut, coba buka browser dan ketikkan “localhost” apakah sudah berjalan web server apachenya atau belum, jika belum maka ulangi langkah nomor 4 mungkin ada yang terlupakan pada saat menginstall file pendukung PHP nya
7. service httpd (web server) harus di ketikkan pada langkah 6 agar tetap berjalan, apabila di restart komputer / notebook maka service httpd tidak berjalan lagi dan harus mengulang mengetik servicenya agar tetap berjalan lagi service httpd, agar service ini tetap berjalan terus menerus walaupun komputer di restart dengan menggetikkan pada terminal yaitu “chkconfig –levels 235 httpd on” atau “chkconfig httpd on” fungsi chkconfig yaiut agar service akan selalu dujalankan pada saat komputer di hidupkan, jadi tidak perlu lagi menggetikkan perintah seperi langkah 6 terus menerus.

Instalasi ,MySQL dan PhpMyAdmin :
1. buka terminal dari : applications > System Tools > Terminal
2. Ketik “su -l”
3. masukkan password root pada saat instalasi fedora
4. ketik “yum install mysql-server”
5. setelah menginstall mysql maka perlu menghidupkan service pada mysql dengan mengetikkan perintah “service mysqld start” pada terminal
6. Maka service Mysql telah berjalan, untuk memasukkan password root pada mysql, password ini berfungsi untuk membuka Phpmydmin maka ketikkan perintah “mysql_secure_installation” pada terminal, maka ikutin langkah seperti ini








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): <-- ENTER
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] <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] <-- ENTER
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <-- ENTER
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] <-- ENTER
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] <-- ENTER
... 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!


7. Setelah melakukan instalasi mySQL dan menentukan password root Mysql maka selanjutnya instalasi phpmyadmin
8. masih pada terminal, ketikkan “yum install phpmyadmin”
9. setelah menginstal maka coba buka browser ketikkan “localhost/phpmyadmin” apabila meminta username dan password maka sudah berhasil menginstall phpmyadmin
10. Agar aktif terus service mysql nya ketikkan pada terminal “chkconfig mysqld on”
11. Setelah mekakukan proses instalasi maka letak folder untuk meletakkan file PHP dan HTML adalah di /var/www/html (folder ini berada di file system) dan letak folder mysql di /var/lib/mysql (folder ini juga berada di file system)

berikut ini sedikit tutorial dari saya, semoga bermanfaat

No comments:

Post a Comment