Joomla 1.6 安裝與調校
安裝:
在 CentOS 5.6 上, /etc/php.ini 要修改這一行: output_buffering = 4096 ,改為 output_buffering = Off
新增一個 configuration.php 的檔案,如果是安裝在網站根目錄,則用以下指令: # touch /var/www/html/configuration.php
執行指令 # chmod 777 /var/www/html/configuration.php
執行指令 # chown -R apache:apache /var/www/html/*
以瀏覽器連入網站作後續安裝。
選擇 mysqli 資料庫。
安裝成功,可正確展現網站。
執行指令 # mv installation installation-backup
執行指令 # chmod 700 /var/www/html/configuration.php
繼續修改「全站設定」細節。
安裝中文語系統調校:
跟 Joomla! 1.5 不一樣的是,只有一個中文語系檔案要下載。
下載後利用 extensions --> extension manager --> install --> upload package file (browse) --> choose your file --> click "upload and install". 來安裝成功。
至後台更改語系: extensions --> language manager --> 設中文為預設 --> 右上角的 filter 選「site」和 「management」都要設為中文。
以 firefox 看 full qualified url 時,會出現以下字,解法如下:
The template for this display is not available. Please contact a Site administrator.
以其他瀏覽器看不會有問題。但安裝 firefox 在乾淨的 windows 系統中,就不會出現這個問題。
參考: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=23437
上面連結提到在出現問題的環境中,清除 firefox 的 cookie 就可以解決這個問題。
Joomla SEF (SEO)調校:
參考: How to check if mod rewrite is enabled on your server 來檢查是否 mod_rewrite 有正常運作。結果發現沒有正常運作。
打開 /etc/httpd/conf/httpd.conf 找到下面這段並改成這樣:
LoadModule rewrite_module modules/mod_rewrite.so
<Directory "/var/www/html">
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
將 joomla 目錄下的 htaccess.txt 改為 .htaccess
在後台管理介面把 apache mod_rewrite 功能打開測試,成功設定 SEF (Search Engine Friendly URL)。
解決 News 出現快取無法寫入的問題:
News 無法顯示,說快取無法寫入。修正方法: chmod 777 /joomla/cache
上面刪除,因為後來發現只要 # chown -R apache:apache * 即可解決,以上 cache (快取目錄)設回權限 755 以保持安全。
解決無法上傳 zip 檔來安裝元件的問題:
先把 joomla 下面的權限調整成 apache 的權限 (user:apache, group:apache):
# cd /var/www/html/
//假設 joomla 程式是放在 /var/www/html/
# chown -R apache:apache *
//註:若有其他
改以下目錄 (joomla! 下) 的權限為 777:
components
modules
templates
tmp
上面刪除,因為後來發現只要 # chown -R apache:apache * 即可解決,以上四個目錄(tmp,templates,modules,components)設回權限 755 以保持安全。
# chmod 755 tmp
# chmod 755 templates
# chmod 755 modules
# chmod 755 components
設 configuration.php 權限為 444 以保持安全:
# chmod 444 /var/www/html/configuration.php
//要再做「全站設定」時,再用以下指令設為可寫。
# chmod 777 /var/www/html/configuratino.php
解決上級要求之 ICT (大寫)網路路徑的問題:
上 級要求 http://yoursite.url/ICT 要出現資訊教育成果網頁,在 windows server 2003 的 iis 伺服器下, http://yoursite.url/ICT = http://yoursite.url/ict = http://yoursite.url/ICT/ = http://yoursite.url/ict/ ,因此只要設個目錄,名稱為 ICT 或 ict ,放在於 iis 的服務根目錄下即可,再放頁面進去豐富內容。
然而,在 linux 系統,目錄的大、小寫不一樣就是不同目錄。
而 在 Joomla! 架站系統中,開設頁面別名設 ict ,出來的結果會是 http://yoursite.url/ict.html 。所以改設定「全站設定」的「網址附加字尾」為 off 的狀態。然而這樣還不可以,這樣頁面也不會是 http://yoursite.url/ict ,為什麼會這樣還待研究,不過如果設定左邊 main menu 的連結就可以成功,方法如下。
設定 main menu 新增一則「選單項目」連結,指向 joomla 的「標準文章頁面」,並設定「別名」為 ICT ,然而因為 Joomla! 會強制修改 ICT(大寫)為 ict (小寫),所以還要再作設定。這樣設定的話, http://yoursite.url/ict 和 http://yoursite.url/ict/ 都是可以運作的,讀者可以看到這兩個連結會指向 joomla 系統的某篇文章頁面。接下來我們要設定 ICT 大寫的目錄能導引向 ict 這個小寫的目錄。
設定導引大寫url到小寫 url的方法: 於 linux 的主機下新增目錄: /var/www/html/ICT ,這樣會多一個 http://yoursite.url/ICT ,我們要再再放置一個 redirect 重新導向的頁面,導向 http://yoursite.url/ict 這個目錄。要新增一個檔案: /var/www/html/ICT/index.html ,檔案內容如下,這樣讀者打 http://yoursite.url/ICT 或 http://yoursite.url/ICT/就可以導向小寫 http://yoursite.url/ict 或 http://yoursite.url/ict/ 的目錄了:
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://yoursite.url/ict/” />
</head>
<body>
Recirecting...
</body>
</html>
安裝的元件:
userport (r145 v2.0) 1.6不適用
http://joomla16.greatjoomla.com/index.php (失敗的 attachment 元件,運作不正常,不用。)
Phoca Download Component (link) 內附中文語系檔。此為作出共享檔案庫介面的延伸元件。
SP Download (link) 此為修改官方圖片管理程式的元件,中文語系檔待改,可由官方介面中取用、修改英文語系檔。需加入網站會員才可下載。解壓後,利用管理介面安裝解壓後的兩個 zip 檔,在後台啟用即可使用。利用「元件」-->「SP Download 」可新增檔案匣,注意檔案匣的權限,以 ls -la 看,「.」 和 「..」 這兩個權限看起來要和 ~/images/banners/ 這個檔案匣的權限一樣,上傳才不會出問題,最好經由利用「元件」-->「SP Download 」新增檔案匣(如新增 ~/images/attachments-number1 這個檔案匣,而非直接以 root 權限新增 /images/ 下的新檔案匣,以免權限有問題。目前指定 ~/images/attachments-number1 為文件及圖片的上傳檔案匣。以後若各處室放太多檔案,太雜亂而難以取用檔案時,再利用 SP Download 的管理介面去開新的檔案匣,並指定新的檔案匣為預設上傳檔案匣。官方說明在此。小問題:中文檔名會被忽略省去不用。另外按鈕在編輯的所在位置可以放後面一點,在模組裏面調整順序即可
YouTube Video Embed for Articles : 只可以新增一段 {youtube}youtubevideonumber1,(optional-youtubevideonumber2){/youtube} 這個區碼,增加第二段就無作用了。
Language Switcher (此為 joomla 1.6 預設模組) 功能為「製作多國語言網站」,打開時需搭配 System - Language Filter 這個外掛,可以關閉(預設值關閉)。「模組管理:模組 語言切換器 」-->狀態選「停止發佈」。然後到 「外掛管理: 系統 - 語言過濾」中,把 languagefilter 選狀態為「不允許的」,這也是預設值。
安裝的模組:
Display_News_1.7.02_BK (link)
解決「警告」訊息,php 沒設定暫存檔目錄:
編輯 php.ini
修改設定: upload_tmp_dir = /var/www/html/tmp
存檔後重新執行 apache : #service httpd restart
設 Gmail 為外送 email 郵件主機的相關設定:
學校的 smtp port 25 不用開啟。 smtp service 也不用開, 本機與學網的 firewall 都不用作設定。
Joomla! 後台管理介面 -->「全站設定」-->「伺服器」-->「郵件設定」設為:
mail type: smtp
ssl
smtp port 465
full email address (the email address you use to log into gmail system)
right password for the email address
server: smtp.gmail.com
smtp auth: yes
sender's email address: full email address the same as the login address
sender's name: 自行設定無規定
sendmail path: /usr/sbin/sendmail
Google Gmail SMTP主機設定為 gmail-smtp-in.l.google.com 是失效的,要用 smtp.gmail.com 才成功。
以下文字引用自 Gmail 官方 http://mail.google.com/support/bin/answer.py?answer=13287:
標準說明:
在 Gmail 中啟用 POP。設定完成時請記得按一下 [儲存變更]。
請依照下列配置來設定您的用戶端: