2013年6月2日 星期日

Install Drupal in CentOS 6.4 with Apache/MySQL/SELinux




1. 要讓httpd 可以存取遠端資料庫(remote database)

     要打開SELinux httpd_can_network_connect
    
   setsebool -P httpd_can_network_connect 1

2.  如果 Enable Clean URL fail


    先確認 RewriteEngine 是否能正常運作
    VirtualHost + RewriteEngine
    A: httpd.conf 要打開  Options  FollowSymLinks


3. httpd.conf 相關與其他安全設定

打開 .htaccess override 讓 apache 去讀drupal的 .htaccess

        AllowOverride All

上面註解了以後,autopath 模組應該就不用另外設定rewrite rule 在httpd.conf裡面了


修改Drupal的.htaccess


        Order deny,allow
        Deny from all
        Allow from 127.0.0.1

讓相關檔案只能從local存取

另外依照 https://drupal.org/node/244924 調整目錄權限
[root@localhost]cd /path_to_drupal_installation
[root@localhost]chown -R webadmin:www-data .
[root@localhost]find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
[root@localhost]find . -type f -exec chmod u=rw,g=r,o= '{}' \;

[root@localhost]cd /path_to_drupal_installation/sites
[root@localhost]find . -type d -name files -exec chmod ug=rwx,o= '{}' \;
[root@localhost]for d in ./*/files
do
   find $d -type d -exec chmod ug=rwx,o= '{}' \;
   find $d -type f -exec chmod ug=rw,o= '{}' \;
done 



Summarizing the permissions

  • drupal_admin: the user on the server that administrates Drupal, not necessarily is the root.
  • site_admin: the owner of the hosted site (a customer)

Ownership

Core modules/themes files and directories: drupal_admin:www-data
Hosted sites modules/themes/files files and directories: site_admin:www-data

Permissions

Core modules/themes directories: rwxr-x---
Core modules/themes files: rw-r-----
Hosted sites modules/themes directories: rwxr-x---
Hosted sites modules/themes files: rw-r-----
Hosted sites "files" directory: rwxrwx---
Hosted sites files under "files" directories: rw-rw----
Hosted sites subdirectories under "files" directories: rwxrwx---



參考
http://www.madirish.net/242

 

4. Update Manger with SSH


Just ran into same issue on my CentOS 6 box...
Here's the info...
# su -
# php -m | grep ssh2
# rpm -qa | grep libssh2

If one or both queries are empty, then proceed with following...
# yum install libssh2 libssh2-devel
# pecl install ssh2
   *** Note you'll probably get a PECL error, if so then fix with...
   # pecl install "channel://pecl.php.net/ssh2-0.12"

如果pecl 安裝 ssh2 時出現
 ex :
              sh: phpize: command not found




解法 :   yum install php-devel

如果pecl 安裝 ssh2 時出現
ex:
       configure: error: no acceptable C compiler found in $PATH

解法: yum install gcc

Then enable the extension...
# echo "extension=ssh2.so" > /etc/php.d/ssh2.ini

Finally restart Apache
# /etc/init.d/httpd restart

最後要注意上傳目錄
sites/all/modules/views
sites/all/modules/themes
的寫入權限

必須SSH user 有write
(建議新增一個webadministrator 之類的user)






drush dl views ctools panels advanced_help pathauto token wysiwyg entity ds nivo_slider nivo_formatter media admin_menu omega_tools

drush dl delta context jquery_update libraries link drupalforfirebug devel imce

drush dl css_injector workbench


drush install youtube views_slideshow varnish quicktabs fb_social


Relate Modules:

https://drupal.org/project/views
(http://ftp.drupal.org/files/projects/views-7.x-3.7.tar.gz)

https://drupal.org/project/ctools
 (http://ftp.drupal.org/files/projects/ctools-7.x-1.3.tar.gz)
 
https://drupal.org/project/panels
(http://ftp.drupal.org/files/projects/panels-7.x-3.3.tar.gz)

https://drupal.org/project/advanced_help
(http://ftp.drupal.org/files/projects/advanced_help-7.x-1.0.tar.gz)

http://ftp.drupal.org/files/projects/pathauto-7.x-1.2.tar.gz


http://ftp.drupal.org/files/projects/token-7.x-1.5.tar.gz

https://drupal.org/project/wysiwyg
()
裝普通版(先不要裝dev版)
  • http://download.moxiecode.com/tinymce/tinymce_3.5.8.zip
  • http://download.cksource.com/CKEditor/CKEditor/CKEditor%203.6.4/ckeditor_3.6.4.tar.gz

http://ftp.drupal.org/files/projects/entity-7.x-1.1.tar.gz

http://ftp.drupal.org/files/projects/ds-7.x-2.3.tar.gz

https://drupal.org/project/admin_menu
()

Omega:
https://drupal.org/node/1298616

https://drupal.org/project/omega
(http://ftp.drupal.org/files/projects/omega-7.x-3.1.tar.gz)


omegatool
http://ftp.drupal.org/files/projects/omega_tools-7.x-3.0-rc4.tar.gz
delta
http://ftp.drupal.org/files/projects/delta-7.x-3.0-beta11.tar.gz
context
http://ftp.drupal.org/files/projects/context-7.x-3.0-beta6.tar.gz






nivo_slider:
https://drupal.org/project/nivo_slider
https://drupal.org/project/Jquery_update
https://drupal.org/project/libraries
http://ftp.drupal.org/files/projects/nivo_formatter-7.x-1.x-dev.tar.gz
http://dev7studios.com/wp-content/uploads/downloads/2013/01/nivo-slider3.2.zip


views slideshow
https://drupal.org/project/views_slideshow
(http://ftp.drupal.org/files/projects/views_slideshow-7.x-3.0.tar.gz)
https://drupal.org/project/libraries
(http://ftp.drupal.org/files/projects/libraries-7.x-2.1.tar.gz)
https://github.com/malsup/cycle/downloads
(
  1. Locate/download the jQuery cycle plugin from the internet, download jquery.cycle.all.latest.min.js and rename it to jquery.cycle.all.min.js
)
https://drupal.org/project/link
(http://ftp.drupal.org/files/projects/link-7.x-1.1.tar.gz)


responsive :
https://drupal.org/project/views_responsive_grid
https://drupal.org/project/cs_adaptive_image



沒有留言:

張貼留言