班級網頁管理系統安裝筆記 (921126)


感謝高雄市加昌國小許智超老師完成如此方便的系統, 造福大家.

以下是狼主的安裝筆記, 如果各位想 step by step 安裝此系統, 可以參照以下步驟:


ps. Linux 作業系統安裝不再敘述, 各位可參考其他文件!


安裝筆記[狼主]
--------------------------------------------------------------------------------------


1.將程式解壓縮放在 web 伺服器網頁目錄下(/var/www/html/classweb)

[root@classweb root]# 

[root@classweb root]# cd /var/www/html

[root@classweb html]# mkdir classweb

[root@classweb html]# cd classweb

[root@classweb classweb]# 

[root@classweb classweb]# unzip classsystem20031120.zip 

即完成解壓縮動作.



啟動 mysql:

[root@mail classweb]# service mysqld start

2.在 MySQL 中建一資料庫

[root@mail classweb]# mysqladmin create classmysql


3.在 MySQL 剛建立的資料庫中執行 ClassSystem.sql 建立資料表格

[root@mail classweb]# mysql classmysql<ClassSystem.sql


[root@mail classweb]# mysql mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> UPDATE user SET password=password('填上您的密碼') where user='root'; 
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> DELETE FROM user WHERE User = ''; 
Query OK, 2 rows affected (0.00 sec)

mysql> insert into user values ('','填上帳號',password('填上密碼'),'y','y','y','y','y','y','y','y','y','y','y','y','y','y');
Query OK, 1 row affected (0.00 sec)

mysql> FLUSH PRIVILEGES; 
Query OK, 0 rows affected (0.00 sec)

mysql> exit




4.修改 PublicParameter.php
4-1.修改連結資料庫的使用者名稱,密碼,資料庫名稱($DATABASE_URL; $DATABASE_USER; $DATABASE_PASSWORD; $DATABASE_BASE)
4-2.修改管理所有網頁密碼($MANAGE_PASSWORD; 管理者可刪除某班班級頁或更改班級教師密碼)
4-3.修改申請班級網頁密碼($APPLY_PASSWORD)


[root@mail classweb]# vi PublicParameter.php 
<?
//資料庫設定
$DATABASE_URL = "localhost";
$DATABASE_USER = "填上帳號";
$DATABASE_PASSWORD = "填上密碼";
$DATABASE_BASE = "classmysql";

//管理所有班級網頁密碼,如果空白表示不需密碼
$MANAGE_PASSWORD = "管理密碼";
//申請網頁密碼,如果空白表示不需密碼
$APPLY_PASSWORD = "申請密碼";

//留言區每頁顯示留言數
$PERPAGE_MESSAGE_NUMBER = "15";
//討論區每頁顯示主題數
$PERPAGE_SUBJECT_NUMBER = "25";



測試資料庫

[root@mail classweb]# mysql clmysql -u填上帳號 -hlocalhost -p填上密碼 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> exit


5.修改 UploadDocument 的權限,目錄擁有者改為 apache
6.修改 UploadHomepage 的權限,目錄擁有者改為 apache
7.修改 UploadPhoto 的權限,目錄擁有者改為 apache


[root@mail classweb]# chown apache.apache UploadDocument 
[root@mail classweb]# chown apache.apache UploadHomepage/
[root@mail classweb]# chown apache.apache UploadPhoto/ 


8.開機自動執行 mysql

在 /etc/rc.d/rc.local 最後一行加上

/usr/bin/safe_mysqld --user=mysql & 


筆記到此結束
===============================================================================================