Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created example tklpatch for reference: drupal5
- Loading branch information
1 parent
c6b55ad
commit 7bf5b31
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
13 changes: 13 additions & 0 deletions
13
examples/drupal5/overlay/usr/lib/live-installer.d/40regen-drupal5-secrets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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=/ | ||
|