2010/09/24

Ubuntu LAMP 環境架設

#Ubuntu 架設 Apache、MySQL、PHP
#LAMP:Linux + Apache + MySQL + PHP

sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo service apache2 restart
sudo apt-get install mysql-server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql 

Apache 設定檔:
/etc/apache2/apache2.conf
/etc/apache2/ports.conf
/etc/apache2/*

PHP 設定檔:
/etc/php5/apache2/php.ini

MySQL 設定檔:
/etc/mysql/my.cnf

MySQL shell login:
mysql -h 127.0.0.1 -u root -p

mysql>?
mysql>SHOW DATABASES;
mysql>CREATE DATABASE 資料庫名稱;
mysql>DROP DATABASE 資料庫名稱;
mysql>SHOW VARIABLES LIKE 'char%' ;
mysql>SHOW COLLATION LIKE 'utf8%';
mysql>SHOW CHARACTER SET;

utf-8 is utf8 in MySQL.

Reference:
01. http://www.phpwact.org/php/i18n/utf-8/mysql
02. http://islandlinux.org/howto/migrating-mysql-utf-8-encoding

沒有留言:

張貼留言