Created
November 14, 2013 15:54
-
-
Save kai23/7469183 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# Met à jour la box | |
apt-get update | |
# Install Vim | |
apt-get install -y vim | |
# Install Apache | |
apt-get install -y apache2 | |
# PHP 5.4 | |
# ------- | |
apt-get install -y libapache2-mod-php5 | |
# Add add-apt-repository binary | |
apt-get install -y python-software-properties | |
# Install PHP 5.4 | |
add-apt-repository ppa:ondrej/php5 | |
# mise à jour | |
apt-get update | |
# Les trucs PHP | |
# --------- | |
apt-get install -y php5-cli | |
apt-get install -y php5-curl | |
apt-get install -y curl | |
apt-get install -y php5-mcrypt | |
# Git | |
# --- | |
apt-get install -y git | |
# On supprime le dossier /var/www | |
rm -rf /var/www | |
# lien entre /vagrant et /www --> on fait un raccourci | |
ln -fs /vagrant /var/www | |
# Clone repository | |
git clone https://github.com/laravel/laravel.git /vagrant/laravel | |
# Add ServerName to httpd.conf | |
echo "ServerName localhost" > /etc/apache2/httpd.conf | |
# Setup hosts file | |
VHOST=$(cat <<EOF | |
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
DocumentRoot /var/www/laravel/public | |
<Directory /var/www/laravel/public> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
</Directory> | |
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ | |
<Directory "/usr/lib/cgi-bin"> | |
AllowOverride None | |
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | |
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> | |
EOF | |
) | |
echo "${VHOST}" > /etc/apache2/sites-available/laravel.conf | |
sudo a2dissite default | |
sudo a2dissite 000-default.conf | |
sudo a2ensite laravel | |
sudo service apache2 reload | |
sudo service apache2 restart | |
# Install Composer | |
# ---------------- | |
curl -s https://getcomposer.org/installer | php | |
# Make Composer available globally | |
mv composer.phar /usr/local/bin/composer | |
# Enable mod_rewrite | |
a2enmod rewrite | |
# Restart apache | |
service apache2 restart | |
cd /var/www/laravel | |
composer install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment