Thursday, November 20, 2014

Cara Mudah Install Apache, MySQL, PHP, dan phpMyAdmin di FreeBSD

Lanjut tutorial FreeBSD nya dulu ya... kali ini kita coba install  Apache, MySQL, PHP, dan phpMyAdmin di FreeBSD, ada yang mau coba?... ikuti langkah berikut :

1. Install dan Konfigurasi Apache

root@mulyana# cd /usr/ports/www/apache24
root@mulyana:/usr/ports/www/apache24# make install clean
root@mulyana:/usr/ports/www/apache24# echo 'apache24_enable="YES"' >> /etc/rc.conf
root@mulyana:/usr/ports/www/apache24# service apache24 start

2. Install dan Konfigurasi MySQL

root@mulyana# cd /usr/ports/databases/mysql56-server
root@mulyana:/usr/ports/databases/mysql56-server# make install clean
root@mulyana:/usr/ports/databases/mysql56-server# echo 'mysql_enable="YES"' >> /etc/rc.conf
root@mulyana:/usr/ports/databases/mysql56-server# service mysql-server start
root@mulyana:/usr/ports/databases/mysql56-server#  /usr/local/bin/mysqladmin -u root password 'password-kamu'

3. Install dan Konfigurasi PHP

root@mulyana# cd /usr/ports/lang/php56
root@mulyana:/usr/ports/lang/php56# make install clean
root@mulyana:/usr/ports/lang/php56# cd /usr/ports/www/mod_php56
root@mulyana:/usr/ports/www/mod_php56# make install clean
root@mulyana:/usr/ports/www/mod_php56# cd /usr/ports/lang/php56-extensions/
root@mulyana:/usr/ports/lang/php56-extensions# make config
root@mulyana:/usr/ports/lang/php56-extensions# make install clean

4. Install dan Konfigurasi phpMyAdmin

root@mulyana# cd /usr/ports/databases/phpmyadmin/
root@mulyana:/usr/ports/databases/phpmyadmin# make install clean
root@mulyana:/usr/ports/databases/phpmyadmin# cp /usr/local/etc/php.ini-development /usr/local/etc/php.ini
root@mulyana:/usr/ports/databases/phpmyadmin# nano /usr/local/etc/apache24/httpd.conf

Ubahnya disini :

DirectoryIndex index.html index.php
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>
Alias /phpmyadmin "/usr/local/www/phpMyAdmin"

<Directory "/usr/local/www/phpMyAdmin">
Options None
AllowOverride None
Require all granted
</Directory>

root@mulyana:/usr/ports/databases/phpmyadmin# service apache24 restart
root@mulyana:/usr/ports/databases/phpmyadmin#  mkdir /usr/local/www/phpMyAdmin/config && root@mulyana:/usr/ports/databases/phpmyadmin#   chmod o+w /usr/local/www/phpMyAdmin/config
root@mulyana:/usr/ports/databases/phpmyadmin#  chmod o+r /usr/local/www/phpMyAdmin/config.inc.php
root@mulyana:/usr/ports/databases/phpmyadmin#   mv /usr/local/www/phpMyAdmin/config/config.inc.php /usr/local/www/phpMyAdmin
root@mulyana:/usr/ports/databases/phpmyadmin# rm -r /usr/local/www/phpMyAdmin/config
root@mulyana:/usr/ports/databases/phpmyadmin# chmod o-r /usr/local/www/phpMyAdmin/config.inc.php


5. Hidupkan ulang Apache dan MySQL

root@mulyana# service apache24 restart
root@mulyana# service mysql-server restart 

Mudah banget kan cara install dan konfigurasinya, mari kita coba :D

Referensi :
http://caffetine.org/freebsd-amp.php
https://httpd.apache.org/docs/2.4/upgrading.html



1 comment:

  1. saran nih
    kalo ditambah setting wordpress bisa kah ?

    ReplyDelete