Skip to content

Instantly share code, notes, and snippets.

@ahamid
Created January 24, 2011 07:30
Show Gist options
  • Save ahamid/792938 to your computer and use it in GitHub Desktop.
Save ahamid/792938 to your computer and use it in GitHub Desktop.
Bootstrap Drupal 6.20 on Quercus
#!/bin/sh
DRUSH_TGZ=drush-All-versions-4.1.tar.gz
RESIN_TGZ=resin-4.0.14.tar.gz
MYSQL_DRIVER_TGZ=mysql-connector-java-5.1.14.tar.gz
function msg {
echo
echo -e "\033[31m $1 \033[39m"
echo
}
HERE=$(pwd)
msg "Gettin' yum packages...please authenticate to sudo..."
# extra php deps are for drush
sudo yum install -y mysql mysql-server php-mysql php-gd php-pdo php-domxml-php4-php5
msg "Startin' db..."
sudo /sbin/service mysqld start
msg "Fetchin' tarballs.."
[[ -f $DRUSH_TGZ ]] || wget http://ftp.drupal.org/files/projects/$DRUSH_TGZ
[[ -f $RESIN_TGZ ]] || wget http://www.caucho.com/download/$RESIN_TGZ
[[ -f $MYSQL_DRIVER_TGZ ]] || wget http://www.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.14.tar.gz/from/http://mysql.llarian.net/
echo "Extracting..."
tar -zxf $RESIN_TGZ
tar -zxf $DRUSH_TGZ
tar -zxf $MYSQL_DRIVER_TGZ
echo "(for now drush has been added to your PATH. you can move it wherever you like afterwords, e.g. ~)"
export PATH=$PATH:$(readlink -f drush*/)
msg "Downloading drupal..."
cd resin*/webapps/ROOT
drush dl drupal-6.20
mv drupal-6.20/* .
mv drupal-6.20/.hta* .
rmdir drupal-6.20
msg "Installing your drupal site as root mysql user - answer 'y' to continue..."
drush si --db-url=mysql://root@localhost/drupalq_620
drush status
mkdir -p WEB-INF/lib
msg "Copying Mysql jdbc driver"
cp $HERE/mysql-*/mysql-*.jar WEB-INF/lib
msg "Setting up clean urls"
cat > WEB-INF/resin-web.xml <<END
<web-app xmlns="http://caucho.com/ns/resin">
<welcome-file-list><welcome-file>index.php</welcome-file></welcome-file-list>
<rewrite-dispatch>
<dispatch regexp="\.(php|gif|css|jpg|png|ico|js|html|htm|txt)"/>
<forward regexp="^/" target="/index.php?q="/>
</rewrite-dispatch>
</web-app>
END
msg "Your Quercus-based Drupal 6.20 instance is ready. Log in here http://localhost:8080 with admin/admin"
../../bin/resin.sh console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment