2012-06-09 119 views
1

我在考慮以自動方式安裝magento。我想我需要創建一些腳本或其他東西......但我想我不是第一個需要它的人。那麼你是否知道任何好的資源或解決方案?它可以在Windows和Linux操作系統中使用。謝謝。哈羅。自動安裝Magento

回答

3

可能還有其他人在那裏,但這裏有一個快速和骯髒的腳本,我使用時不時安裝Magento結帳我svn回購和初始化modman。它可以擴展到創建數據庫,如果需要等,但它對我來說工作正常:

#!/bin/bash 

# Required Script Variables 
DB_NAME= 
DB_USER= 
DB_HOST= 
DB_PASS= 
URL= 
MAGENTO_VERSION="1.7.0.0" 
ADMIN_FIRSTNAME= 
ADMIN_SURNAME= 
ADMIN_EMAIL= 
ADMIN_USER= 
ADMIN_PASS= 
SVN_REPO= 


# Download and install Magento 
wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz 

printf "\n\nUnpacking and preparing to install Magento...\n" 

tar -zxvf magento-$MAGENTO_VERSION.tar.gz 
mv magento/* magento/.htaccess . 
chmod -R o+w media var 
chmod o+w app/etc 
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* 
rm -rf magento/ magento-$MAGENTO_VERSION.tar.gz 

printf "\n\nInstalling Magento...\n" 

/usr/local/bin/php -f install.php -- \ 
    --license_agreement_accepted "yes" \ 
    --locale "en_GB" \ 
    --timezone "Europe/London" \ 
    --default_currency "GBP" \ 
    --db_host "$DB_HOST" \ 
    --db_name "$DB_NAME" \ 
    --db_user "$DB_USER" \ 
    --db_pass "$DB_PASS" \ 
    --url "$URL" \ 
    --use_rewrites "yes" \ 
    --use_secure "no" \ 
    --secure_base_url "" \ 
    --use_secure_admin "no" \ 
    --skip_url_validation "yes" \ 
    --admin_firstname "$ADMIN_FIRSTNAME" \ 
    --admin_lastname "$ADMIN_SURNAME" \ 
    --admin_email "$ADMIN_EMAIL" \ 
    --admin_username "$ADMIN_USER" \ 
    --admin_password "$ADMIN_PASS" 


# Setup svn and modman 
modman init 
mkdir .modman/modules 
svn co $SVN_REPO .modman/modules 
modman update-all