Install Mysql Server di Linux
Bahan yang di perlukan :
httpd-2.0.48.tar.gz
mysql-4.0.16.tar.gz
php-4.3.4.tar.gz
cari dan download source bahan diatas dengan google, bisa pake cara masukan keyword download "namafilediatas" atau langsung pake wget.
Ekstrak files2 di atas :
#tar -zxf httpd-2.0.48.tar.gz (enter)
#tar -zxf mysql-4.0.16.tar.gz (enter)
#tar -zxf php-4.3.4.tar.gz (enter)
Install Apache
Masuk ke directory httpd yang sudah di extract.
#cd httpd-2.0.48 (enter)
Configure apachenya yah, disini kita ingin install apache di directory /usr/local/apache2 , dengan module yang sering digunakan.
#./configure --prefix=/usr/local/apache2 --enable-mods-shared=most (enter)
#make
#make install
Edit file httpd.conf sesuai dengan keperluan :
#vi /usr/local/apache2/conf/httpd.conf
Tambahkan dan save ketiga baris dibawah ini :
LoadModule php4_module modules/libphp4.so
DirectoryIndex index.html index.html.var index.php
AddType application/x-httpd-php .php
Install mysql
#cd mysql-4.0.16 (enter)
#./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-maintainer-mode --with-mysqld-user=mysql --enable-large-files-without-debug (enter)
#make (enter)
#make install (enter)
Membuat group untuk mysql dan user mysql :
#/usr/sbin/groupadd mysql (enter)
#/usr/sbin/useradd -g mysql mysql (enter)
Install mysql script :
#./scripts/mysql_install_db (enter)
Merubah kepemilikan folder dan files :
# chown -R root:mysql /usr/local/mysql (enter)
# chown -R mysql:mysql /usr/local/mysql/data (enter)
Edit ld.so.conf :
#vi /etc/ld.so.conf
tambahkan ini :
/usr/local/mysql/lib/mysql
kemudian ketik :
#ldconfig
Jalankan mysql server :
#/usr/local/mysql/bin/mysqld_safe --user=mysql &
Membuat user root di mysql :
#/usr/local/mysql/bin/mysqladmin -u root password new_password
Installa PHP
Masuk ke directory php yang sudah di ekstract
#cd php-4.3.4 (enter)
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql (enter)
#make (enter)
#make install (enter)
Setelah berhasil terinstall , ketik :
#cp php.ini-recommended /usr/local/php/lib/php.ini (enter)
Edit php.ini
#vi /usr/local/php/lib/php.ini (enter)
Ubah dan sesuaikan dengan kebutuhan dan letak files2 web kamu :
doc_root= "/usr/local/apache2/htdocs/"
Bila kamu memperbolehkan proses upload di web, silahkan ubah jadi on
file_uploads=Off
Jalankan apache webserver
#/usr/local/apache2/bin/apachectl start (enter)
Semua files web anda ada di directory ini
#cd /usr/local/apache2/htdocs (enter)
buat file untuk melihat apakah semua sudah ok
#vi test.php
Add the following line to the file;
<?php phpinfo(); ?>
Save
Agar semua berjalan secara otomatis :
#cd /home/xxxx/mysql-4.0.16 <enter>
copy file mysql.server ke /etc/init.d directory as follows;
#cp support-files/mysql.server /etc/init.d/mysql
Ok, lets create some links in the startup folders for run levels 3 and 5.
#cd /etc/rc3.d <enter>
#ln -s ../init.d/mysql S85mysql <enter>
#ln -s ../init.d/mysql K85mysql <enter>
#cd /etc/rc5.d <enter>
#ln -s ../init.d/mysql S85mysql <enter>
#ln -s ../init.d/mysql K85mysql <enter>
#cd ../init.d <enter>
#chmod 755 mysql <enter>
Autostart apache
#cd /usr/local/apache2/bin <enter>
#cp apachectl /etc/init.d/httpd <enter>
#cd /etc/rc3.d <enter>
#ln -s ../init.d/httpd S85httpd <enter>
#ln -s ../init.d/httpd K85httpd <enter>
#cd /etc/rc5.d <enter>
#ln -s ../init.d/httpd S85httpd <enter>
#ln -s ../init.d/httpd K85httpd <enter>
Written By vampire_surfer