Created
April 2, 2015 20:35
-
-
Save fridolin-koch/e7b865b66bbe29abd7e7 to your computer and use it in GitHub Desktop.
Webtech - Tutorial
This file contains hidden or 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
#!/bin/bash | |
MYSQL_PASSWORD="symfony2" | |
# update | |
apt-get update | |
# set mysql password | |
debconf-set-selections <<< "mysql-server mysql-server/root_password password ${MYSQL_PASSWORD}" | |
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${MYSQL_PASSWORD}" | |
# install dependencies | |
apt-get install -y \ | |
php5 \ | |
php5-cli \ | |
php5-curl \ | |
php5-gd \ | |
php5-memcached \ | |
php5-imagick \ | |
php5-imap \ | |
php5-mysql \ | |
php5-json \ | |
php5-xsl \ | |
php5-mcrypt \ | |
php5-intl \ | |
php5-xcache \ | |
php5-mongo \ | |
libssh2-php \ | |
php5-mcrypt \ | |
php5-intl \ | |
git \ | |
mysql-server \ | |
apache2 \ | |
libapache2-mod-php5 | |
#enable mod_rewrite | |
a2enmod rewrite | |
# configure | |
cat <<< EOT > /etc/apache2/sites-available/000-default.conf | |
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/notifair/web | |
<Directory /var/www/notifair/web> | |
# enable the .htaccess rewrites | |
AllowOverride All | |
Order allow,deny | |
Allow from All | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
EOT | |
# restart apache | |
service apache2 restart | |
# prepare mysql database | |
echo "CREATE DATABASE symfony2 CHARACTER SET utf8 COLLATE utf8_general_ci;" | mysql -u root -p$MYSQL_PASSWORD | |
# install composer globally | |
curl -sS https://getcomposer.org/installer | php | |
mv composer.phar /usr/local/bin/composer |
This file contains hidden or 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
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "phusion/ubuntu-14.04-amd64" | |
#No Autoupdate | |
config.vm.box_check_update = false | |
# Create a private network, which allows host-only access to the machine | |
# using a specific IP. | |
config.vm.network "private_network", ip: "192.168.10.10" | |
#set hostname | |
config.vm.hostname = "symfony.dev" | |
#Bridge | |
config.vm.network "public_network" | |
# Sync current folder | |
config.vm.synced_folder "./", "/var/www/app", group: "www-data", owner: "www-data", mode: 0775 | |
#provisioning | |
config.vm.provision "shell", path: "./provision.sh", privileged: true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment