Last active
August 29, 2015 14:16
-
-
Save V13Axel/746a1f60f37604888b1e to your computer and use it in GitHub Desktop.
Setup a basic Apache server with Laravel
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
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
apt-get update | |
apt-get -y upgrade | |
apt-get --yes --force-yes install apache2 php5 libapache2-mod-php5 postgresql php5-pgsql php5-mcrypt curl openssh-server git | |
php5enmod mcrypt | |
curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/bin | |
cd /var/www && composer create-project laravel/laravel epic | |
chown -R root:www-data /var/www | |
cat > /etc/apache2/sites-enabled/000-default.conf <<EndOfMessage | |
ServerName "www.epic.com" | |
<VirtualHost *:80> | |
#Require all granted | |
DocumentRoot "/var/www/epic/public" | |
<Directory "/var/www/epic/public"> | |
AllowOverride all | |
Options FollowSymLinks MultiViews | |
Require all granted | |
</Directory> | |
</VirtualHost> | |
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet | |
EndOfMessage | |
service apache2 restart | |
sed -i '/Laravel 5/c\<div class="title">EPIC Inc.</div>' /var/www/epic/resources/views/welcome.blade.php | |
sudo chmod -R 775 /var/www/epic | |
cd - | |
# sed -i '/Port 22/c\Port 6622' /etc/ssh/sshd_config | |
# sed -i '/PermitRootLogin*/c\PermitRootLogin without-password' /etc/ssh/sshd_config | |
# sed -i '/RSAAuthentication*/c\RSAAuthentication yes' /etc/ssh/sshd_config | |
# sed -i '/PubkeyAuthentication*/c\PubkeyAuthentication yes' /etc/ssh/sshd_config | |
# service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment