Skip to content

Commit

Permalink
created example tklpatch for reference: drupal5
Browse files Browse the repository at this point in the history
  • Loading branch information
alonswartz committed Nov 15, 2009
1 parent c6b55ad commit 7bf5b31
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -15,6 +15,7 @@ install:
mkdir -p $(INSTALL_PATH_SHARE)
cp bin/* $(INSTALL_PATH_BIN)
cp -a docs $(INSTALL_PATH_SHARE)
cp -a examples $(INSTALL_PATH_SHARE)

uninstall:
rm $(INSTALL_PATH_BIN)/$(progname)*
Expand Down
54 changes: 54 additions & 0 deletions examples/drupal5/conf
@@ -0,0 +1,54 @@
#!/bin/bash -ex

HOSTNAME=drupal5

# set hostname
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts

# start mysql daemon
/etc/init.d/mysql start

# install drupal5
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y \
-o DPkg::Options::=--force-confdef \
-o DPkg::Options::=--force-confold \
install drupal5

# cleanup after drupal package and setup apache
rm -rf /etc/apache
rm -f /etc/apache2/conf.d/drupal.conf
touch /etc/apache2/conf.d/drupal.conf
ln -s /etc/drupal/5/apache.conf /etc/apache2/sites-available/drupal5

a2dissite default
a2ensite drupal5
a2enmod rewrite

# configure cron related
CRON_ORIG=/usr/share/drupal5/scripts/cron.sh
CRON_NEW=/etc/drupal/5/cron.sh
cp $CRON_ORIG $CRON_NEW
sed -i "s|http://localhost/drupal5|http://localhost|g" $CRON_NEW
sed -i "s|$CRON_ORIG|$CRON_NEW|g" /etc/cron.d/drupal5

# complete drupal installation
/etc/init.d/apache2 start
curl http://127.0.0.1/install.php?profile=default >/dev/null
curl http://127.0.0.1/cron.php >/dev/null
/etc/init.d/apache2 stop

# set files to be writable by webserver (upload and css aggregation)
chown -R www-data: /var/lib/drupal5/files

# configure drupal to use cleanurls by default
mysql -uroot --database=drupal5 --execute "insert into variable values('clean_url', 's:1:\"1\";'); delete from cache;"

CONF=/etc/drupal/5/htaccess
sed -i "s|^ RewriteBase /drupal5$| #RewriteBase /drupal5|" $CONF
sed -i "s|^ #RewriteBase /$| RewriteBase /|" $CONF

# stop mysql daemon
/etc/init.d/mysql stop

22 changes: 22 additions & 0 deletions examples/drupal5/overlay/etc/drupal/5/apache.conf
@@ -0,0 +1,22 @@
NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
UseCanonicalName Off
ServerAdmin webmaster@localhost
DocumentRoot /usr/share/drupal5/
</VirtualHost>

<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/cert.pem
ServerAdmin webmaster@localhost
DocumentRoot /usr/share/drupal5/
</VirtualHost>

<Directory /usr/share/drupal5/>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>
@@ -0,0 +1,13 @@
#!/bin/bash
# regenerate drupal5 mysql password

PASSWORD=$(mcookie)

CONF=/etc/drupal/5/sites/default/dbconfig.php
sed -i "s/\$dbpass=\(.*\)/\$dbpass=\'$PASSWORD\';/" $CONF

CONF=/etc/dbconfig-common/drupal5.conf
sed -i "s/dbc_dbpass=\(.*\)/dbc_dbpass=\'$PASSWORD\'/" $CONF

/usr/lib/di-live.d/??mysql-conf -u drupal5 -p $PASSWORD --chroot=/

0 comments on commit 7bf5b31

Please sign in to comment.