Requirments:
Apache
php php-mysql php-devel
mysql mysql-server
1. 下載MyWineCellar安裝檔案
wget http://sourceforge.net/projects/mywinecellar/files/mywinecellar/0.2/mywinecellar-0.2.tar.gz/download
2. 解壓縮,搬移網站檔案至網頁根目錄
tar -zxvf mywinecellar-0.2.tar.gz
mv mywinecellar /var/www/html/mywine
chown -R apache /var/www/html/mywine
3. 設定開機啟動服務
service httpd start: chkconfig httpd on
service mysqld start: chkconfig mysqld on
4. 建立對應資料庫
mysqladmin -u root password '管理這密碼'
mysql -u root -p
create database wine;
grant all on wine.* to root@localhost identified by '資料庫擁有者密碼';
quit
5. 匯入資料庫初始數據
cd /var/www/html/mywine
vi wine.mysql
205 order2 smallint(5) unsigned NOT NULL default '99',
因為order為SQL語法中的關鍵字所以會出現匯入失敗,之後再將order2轉換回原來order
mysql -u root -p
use wine;
ALTER TABLE `winedata` CHANGE `ORDER2` `ORDER` SMALLINT( 5 ) UNSIGNED NOT NULL DEFAULT '99';quit
6. 修改網站組態設定
vi /var/www/html/mywine/wine.inc
$cfg['db'] = "wine";
$cfg['dbuser'] = "root";
$cfg['dbpass'] = "資料庫擁有者密碼";
$cfg['dbhost'] = "localhost";
7. 完成
http://your server name/mywine
沒有留言:
張貼留言