2016年9月23日 星期五

Joomla 安裝注意事項(讀寫權限)

前置環境:
Joomla依照官方網站安裝步驟完成建置,且安裝於/var/www/html/

時機:
一、Joomla基本目錄權限設定。
二、管理端使用擴充套件功能安裝語言包。
三、確保目錄與檔案有必須的寫入權限(可以需求調整)。

目的:排除安裝時出現的「archive does not exist」、「Failed to copy file」等錯誤訊息。

說明:錯誤訊息的出現通常是檔案或目錄的存取權限發生問題,下述設定方式為一般通用設定,後續如有需要安裝組件或更新,請依官方說明的路徑開放目錄與檔案的讀寫權限。

一、Joomla基本目錄權限設定
先切換至Joomla安裝目錄下
cd /var/www/html/;

1.全目錄預先設定擁有者為root.apache
chown -R root.apache ./;

2.全目錄預先設定權限,目錄為750、檔案為640
chmod 750 $(find ./ -type d);
chmod 640 $(find ./ -type f);

3.全目錄SELinux權限設定為httpd_sys_content_t
chcon -R -t httpd_sys_content_t ./;

4.Joomla運作需要的權限設定,目錄為770、檔案為660
chmod 770 $(find ./cache -type d);
chmod 660 $(find ./cache -type f);
chmod 770 $(find ./tmp -type d);
chmod 660 $(find ./tmp -type f);
chmod 770 $(find ./administrator/cache -type d);
chmod 660 $(find ./administrator/cache -type f);
chmod 770 $(find ./administrator/logs -type d);
chmod 660 $(find ./administrator/logs -type f);

5.Joomla運作需要的SELinux權限設定為httpd_sys_rw_content_t
chcon -R -t httpd_sys_rw_content_t ./cache;
chcon -R -t httpd_sys_rw_content_t ./tmp;
chcon -R -t httpd_sys_rw_content_t ./administrator/cache;
chcon -R -t httpd_sys_rw_content_t ./administrator/logs;

6.確認configuration.php檔案權限設定為640
chmod 640 ./configuration.php;


二、管理端使用擴充套件功能安裝語言包
需針對以下目錄進行權限調整
./administrator/language
./administrator/manifests/packages
./language

#使用WebUI安裝語言包之前
1.權限設定,目錄為770、檔案為660
chmod 770 $(find ./administrator/language -type d);
chmod 660 $(find ./administrator/language -type f);
chmod 770 $(find ./administrator/manifests/packages -type d);
chmod 660 $(find ./administrator/manifests/packages -type f);
chmod 770 $(find ./language -type d);
chmod 660 $(find ./language -type f);

2.SELinux權限設定為httpd_sys_rw_content_t
chcon -R -t httpd_sys_rw_content_t ./administrator/language;
chcon -R -t httpd_sys_rw_content_t ./administrator/manifests/packages;
chcon -R -t httpd_sys_rw_content_t ./language;

3.由管理介面選擇Install Languages後,依步驟安裝所需語言

4.選擇Language(s) > Installed 頁面,依步驟SetDefualt語言



#使用WebUI安裝語言包之後
5.復原權限設定,目錄為750、檔案為640
chmod 750 $(find ./administrator/language -type d);
chmod 640 $(find ./administrator/language -type f);
chmod 750 $(find ./administrator/manifests/packages -type d);
chmod 640 $(find ./administrator/manifests/packages -type f);
chmod 750 $(find ./language -type d);
chmod 640 $(find ./language -type f);

6.復原SELinux權限設定為httpd_sys_content_t
chcon -R -t httpd_sys_content_t ./administrator/language;
chcon -R -t httpd_sys_content_t ./administrator/manifests/packages;
chcon -R -t httpd_sys_content_t ./language;


三、確保目錄與檔案有必須的寫入權限(可以需求調整)。
安裝完成後,可於Joomla管理區的系統資訊,查看目前目錄與檔案的權限狀態,為避免後續執行的困擾可執行以下語法,對清單中的目錄與檔案開放寫入權限。
chmod 770 ./administrator/cache;
chmod 770 ./administrator/components;
chmod 770 ./administrator/language;
chmod 770 ./administrator/language/en-GB;
chmod 770 ./administrator/language/overrides;
chmod 770 ./administrator/language/zh-TW;
chmod 770 ./administrator/logs;
chmod 770 ./administrator/manifests/files;
chmod 770 ./administrator/manifests/libraries;
chmod 770 ./administrator/manifests/packages;
chmod 770 ./administrator/modules;
chmod 770 ./administrator/templates;
chmod 770 ./cache;
chmod 770 ./components;
chmod 770 ./images;
chmod 770 ./images/banners;
chmod 770 ./images/headers;
chmod 770 ./images/sampledata;
chmod 770 ./language;
chmod 770 ./language/en-GB;
chmod 770 ./language/overrides;
chmod 770 ./language/zh-TW;
chmod 770 ./libraries;
chmod 770 ./media;
chmod 770 ./modules;
chmod 770 ./plugins;
chmod 770 ./plugins/authentication;
chmod 770 ./plugins/captcha;
chmod 770 ./plugins/content;
chmod 770 ./plugins/editors;
chmod 770 ./plugins/editors-xtd;
chmod 770 ./plugins/extension;
chmod 770 ./plugins/finder;
chmod 770 ./plugins/installer;
chmod 770 ./plugins/quickicon;
chmod 770 ./plugins/search;
chmod 770 ./plugins/system;
chmod 770 ./plugins/twofactorauth;
chmod 770 ./plugins/user;
chmod 770 ./templates;
chmod 770 ./tmp;
chmod 770 configuration.php;
chcon -t httpd_sys_rw_content_t ./administrator/cache;
chcon -t httpd_sys_rw_content_t ./administrator/components;
chcon -t httpd_sys_rw_content_t ./administrator/language;
chcon -t httpd_sys_rw_content_t ./administrator/language/en-GB;
chcon -t httpd_sys_rw_content_t ./administrator/language/overrides;
chcon -t httpd_sys_rw_content_t ./administrator/language/zh-TW;
chcon -t httpd_sys_rw_content_t ./administrator/logs;
chcon -t httpd_sys_rw_content_t ./administrator/manifests/files;
chcon -t httpd_sys_rw_content_t ./administrator/manifests/libraries;
chcon -t httpd_sys_rw_content_t ./administrator/manifests/packages;
chcon -t httpd_sys_rw_content_t ./administrator/modules;
chcon -t httpd_sys_rw_content_t ./administrator/templates;
chcon -t httpd_sys_rw_content_t ./cache;
chcon -t httpd_sys_rw_content_t ./components;
chcon -t httpd_sys_rw_content_t ./images;
chcon -t httpd_sys_rw_content_t ./images/banners;
chcon -t httpd_sys_rw_content_t ./images/headers;
chcon -t httpd_sys_rw_content_t ./images/sampledata;
chcon -t httpd_sys_rw_content_t ./language;
chcon -t httpd_sys_rw_content_t ./language/en-GB;
chcon -t httpd_sys_rw_content_t ./language/overrides;
chcon -t httpd_sys_rw_content_t ./language/zh-TW;
chcon -t httpd_sys_rw_content_t ./libraries;
chcon -t httpd_sys_rw_content_t ./media;
chcon -t httpd_sys_rw_content_t ./modules;
chcon -t httpd_sys_rw_content_t ./plugins;
chcon -t httpd_sys_rw_content_t ./plugins/authentication;
chcon -t httpd_sys_rw_content_t ./plugins/captcha;
chcon -t httpd_sys_rw_content_t ./plugins/content;
chcon -t httpd_sys_rw_content_t ./plugins/editors;
chcon -t httpd_sys_rw_content_t ./plugins/editors-xtd;
chcon -t httpd_sys_rw_content_t ./plugins/extension;
chcon -t httpd_sys_rw_content_t ./plugins/finder;
chcon -t httpd_sys_rw_content_t ./plugins/installer;
chcon -t httpd_sys_rw_content_t ./plugins/quickicon;
chcon -t httpd_sys_rw_content_t ./plugins/search;
chcon -t httpd_sys_rw_content_t ./plugins/system;
chcon -t httpd_sys_rw_content_t ./plugins/twofactorauth;
chcon -t httpd_sys_rw_content_t ./plugins/user;
chcon -t httpd_sys_rw_content_t ./templates;
chcon -t httpd_sys_rw_content_t ./tmp;
chcon -t httpd_sys_rw_content_t configuration.php;

沒有留言:

張貼留言

Ubuntu 使用apt-get -y update更新出現大量Failed to fetch 404 Not Found訊息

Ubuntu 使用apt-get -y update更新出現大量Failed to fetch 404 Not Found訊息,確認DNS可以解析網址也可連到網路,基本可排除網路問題。 原因判斷:Ubuntu版本過舊,其更新包路徑已不在原本sources.list檔案內的更新路徑...