Last active
August 29, 2015 14:21
-
-
Save pkazmierczak/3204b7ef7703e231ff9e to your computer and use it in GitHub Desktop.
EC2 ami configuration for Typo3 7
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
sudo sed '/deb-src/d' /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install python-setuptools apache2 mysql-client php5 php5-cli php5-gd php5-mysql memcached php5-curl php5-memcache php5-xcache ppthtml unrtf xlhtml | |
sudo apt-get clean | |
wget https://github.com/s3tools/s3cmd/archive/master.zip # we need newest s3cmd for Frankfurt V4 auth | |
unzip master.zip | |
cd s3cmd | |
sudo python setup.py install | |
# changing PHP config options | |
sudo sed -i 's/max_execution_time = 30/max_execution_time = 240/' /etc/php5/apache2/php.ini | |
sudo sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/' /etc/php5/apache2/php.ini | |
sudo sed -i 's/post_max_size = 8M/post_max_size = 10M/' /etc/php5/apache2/php.ini | |
# adding libgd and mysql extensions | |
sudo sed -i -e '$aextension=gd.so' /etc/php5/apache2/php.ini | |
sudo sed -i -e '$aextension=mysql.so' /etc/php5/apache2/php.ini | |
# download and install Typo3 7.2 | |
cd /var/www | |
sudo wget http://prdownloads.sourceforge.net/typo3/typo3_src-7.2.0.tar.gz?download | |
sudo tar zxvf typo3_src-7.2.0.tar.gz?download | |
cd html | |
sudo rm -f index.html | |
# gonna use symlinks here so that if we change typo3 version, we can just | |
# change one symlink and the whole structure will remain the same | |
sudo ln -s ../typo3_src-7.2.0 typo3_src | |
sudo ln -s typo3_src/index.php index.php | |
sudo ln -s typo3_src/typo3 typo3 | |
sudo cp typo3_src/_.htaccess .htaccess | |
sudo touch FIRST_INSTALL | |
# permissions | |
sudo chown -R www-data:www-data /var/www | |
sudo find /var/www/html -type d -print0 | sudo xargs -0 chmod 0770 | |
sudo find /var/www/html -type f -print0 | sudo xargs -0 chmod 0660 | |
sudo service apache2 restart | |
# preparing typo3 configuration sync tool | |
# vorsicht: s3cmd must be configured for this. | |
sudo find /var/www/html/typo3conf -type d -print0 | sudo xargs -0 -I{} sudo echo "{} IN_CLOSE_WRITE,IN_CREATE,IN_DELETE /usr/bin/s3cmd sync --skip-existing --delete-removed /var/www/html/typo3conf s3://typo3.piotr.kazmierczak" > /etc/incron.d/webroot.conf | |
sudo sed -i -e '$a* * * * * ubuntu /usr/bin/sudo /usr/local/bin/s3cmd sync --skip-existing --delete-removed /var/www/html/typo3conf s3://typo3.piotr.kazmierczak' /etc/crontab | |
# TODO: upgrade this to utilize inotify and make significantly less s3cmd calls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment