Joomla 1.5.23 調校
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)
安裝的模組:
Display_News_1.7.02_BK (link)
設 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。設定完成時請記得按一下 [儲存變更]。
請依照下列配置來設定您的用戶端: