2013年9月30日 星期一

於 CentOS 6 上安裝 Drupal 7

作業系統


  • 於 /etc/yum.conf 中設定 yum proxy ,使安裝套件速度加快:proxy=http://proxy.server.ip:port
  • 更新系統: yum update
  • 安裝 apache : yum install httpd
  • 安裝 php :yum -y install php php-pear php-mysql
  • 安裝 php extension :yum -y install php-xml php-gd  php-pdo php-mbstring
  • 安裝 uploadprogress:
    • yum -y install php-devel
    • yum -y install gcc
    • pecl channel-update pecl.php.net
    • pecl install uploadprogress
  • 安裝 mysql :yum -y install mysql-server

環境設定

允許使用者個人網站(編輯 /etc/httpd/conf/httpd.conf )

  1. 將 UserDir disabled 改成 Userdir enabled user1 user2 
  2. 將 <Directory /home/*/public_html> 至 </Directory> 的註解取消
  3. 設定 AllowOverride All    Options All 
  4. 重新啟動 web 服務: service httpd restart
  5. 設定開機啟動 web 服務: chkconfig httpd on

安裝 Drupal 7

  1. 下載 drupal 7 :wget http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz。
  2. 解壓 : tar -zxvf drupal-7.22.tar.gz。
  3. 搬移至網站目錄: cp -ap druapl-7.22/* /home/drupaldir/public_html。
  4. 變更檔案權限:
    1. 將 sites/default/default.settings.php 複製並更名成 settings.php ,並設成可讀寫。
    2. 將 sites/default 設成可讀寫。
  5. 自瀏覽器輸入網址以執行安裝。
  6. 安裝完成後切記將步驟 4 之權限設回唯讀。

安裝 drush

    1. pear channel-discover pear.drush.org
    2. pear install drush/drush
    3. 注意:drush 必需在 drupal 根目錄下執行!

    安裝基本模組

    • drush dl l10n_update
    • drush dl backup_migrate
    • drush dl views
    • drush dl ctools
    • drush dl cck
    • drush dl panels
    • drush dl webform
    • drush dl smtp
    • drush dl date

    網站維護

    自動備份:
    刪除過期備份檔:find /tmp/ -type f -name "*.log" -mtime +1 -exec rm -rf {} \;

    沒有留言:

    張貼留言