Skip to content

Instantly share code, notes, and snippets.

@furu
Last active August 29, 2015 14:22
Show Gist options
  • Save furu/2962385078444e3f0ec0 to your computer and use it in GitHub Desktop.
Save furu/2962385078444e3f0ec0 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -euv
ablogcms_version=1.6.0
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y apache2
apt-get install -y mysql-client mysql-server
apt-get install -y php5 php5-gd php5-mysql
a2enmod rewrite
cat <<\EOS > /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
EOS
cd /tmp
if [ ! -e ablogcms${ablogcms_version}.zip ]; then
wget -q http://version1.a-blogcms.jp/archives/oldversion/ablogcms${ablogcms_version}.zip
unzip ablogcms${ablogcms_version}.zip
fi
if [ -e /var/www/index.html ]; then
rm /var/www/index.html
fi
cp -r /tmp/ablogcms${ablogcms_version}/ablogcms/* /var/www/
cp -r /tmp/ablogcms${ablogcms_version}/install/* /var/www/
mv /var/www/htaccess.txt /var/www/.htaccess
chmod 666 /var/www/config.server.php
chmod -R 777 /var/www/archives
chmod -R 777 /var/www/private
if [ ! -e ioncube_loaders_lin_x86-64.zip ]; then
wget -q http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.zip
unzip ioncube_loaders_lin_x86-64.zip
fi
cp -r ioncube /usr/local/
cat <<EOS > /etc/php5/apache2/conf.d/20-ioncube.ini
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so
EOS
sed -i -e 's/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/error_reporting = E_ALL/' /etc/php5/apache2/php.ini
sed -i -e 's/display_errors = Off/display_errors = On/' /etc/php5/apache2/php.ini
sed -i -e 's/display_startup_errors = Off/display_startup_errors = On/' /etc/php5/apache2/php.ini
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment