2013年11月15日 星期五

Installing MySQL with phpMyAdmin On NAS4Free

* Platform OS        : FreeBSD 9.1-RELEASE-p5 (kern.osreldate: 901000)
* Version               : 9.1.0.1 - Sandstorm (revision 847)
* Build date           : Sun Aug 18 03:49:41 CEST 2013

Install MySQL server

First.
ADD a new Group on WebGUI and called mysql
ADD a new User on WebGUI and called mysql
Set the Set the account's primary group to mysql.

§  Log into NAS4Free using SSH or Telnet, for instance by using Putty
§  Create the MySQL data directory:
# mkdir /<directory_name>/db/mysql
§  Create the MySQL symbolic link:
# ln -s /<directory_name>/db/mysql /var/db/mysql
§  Change the owner:
# chown -R mysql:mysql /<directory_name>/db/mysql/
§  Allow anyone access the temporary directory:
# chmod 777 /tmp
# chmod 777 /var/tmp
# chmod 777 /ftmp
§  Install MySQL server:
# pkg_add -r mysql50-server
§  Create database:
# /usr/local/bin/mysql_install_db --user=mysql
# chown -R mysql /var/db/mysql
§  Start MySQL:
# /usr/local/bin/mysqld_safe &
§  Change the password:
# /usr/local/bin/mysqladmin -u root password 'root_password'
§  Edit config file:
# vi /etc/rc.conf
§  Start MySQL automatically by adding contents like that in this file:
mysql_enable="YES"
§  Reboot

Install PHP

§  The file cause WebGUI crash, Backup this file:
cp /usr/local/lib/libxml2.so.5 /tmp/libxml2.so.5
§  Install PHP packages:
# pkg_add -r php5-extensions
# pkg_add -r php5-xmlrpc
# pkg_add -r php5-gettext
# pkg_add -r php5-mcrypt
# pkg_add -r php5-mysql
# pkg_add -r php5-mbstring
# pkg_add -r php5-mysqli
§  Fix WebGUI crash problem:
# mv /usr/local/bin/php /usr/local/bin/php-cli
# cp /usr/local/bin/php-cgi /usr/local/bin/php
# rm /usr/local/lib/libxml2.so.5
# cp /tmp/libxml2.so.5 /usr/local/lib/libxml2.so.5

Install phpMyAdmin

  • Create the phpMyAdmin directory:
# mkdir /<directory_name>
§  Extract the contents of the phpMyAdmin to the new directory. Run the following command in Linux terminal.
# cd /<directory_name>
# fetch http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.0.9/phpMyAdmin-4.0.9-all-languages.tar.gz
# tar -zxvf phpMyAdmin-4.0.9-all-languages.tar.gz
§  Create the phpMyAdmin symbolic link:
# ln -s /<directory_name>/phpMyAdmin-4.0.9-all-languages /<directory_name>/phpMyAdmin
# ln -s /<directory_name>/phpMyAdmin /<web_directory>/phpMyAdmin
§  Access phpMyAdmin:
http://< NAS4Free_IP >/phpMyAdmin

沒有留言:

張貼留言