Last active
April 4, 2016 19:11
-
-
Save Nezteb/37b46873f763b247d1df to your computer and use it in GitHub Desktop.
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 | |
# Noah Betzen | |
# CentOS 7.1 Minimal Image | |
# GravCMS 1.0.10 Install Steps | |
# CONFIRMED WORKING 2-29-16 | |
# Path variables you should set | |
serverFilesPath=/var/www/html | |
#yum update -y # Uncomment this if you want updates (recommended on fresh server installs) | |
yum --enablerepo=extras install -y epel-release | |
#yum upgrade -y # Uncomment this if you want updates (recommended on fresh server installs) | |
# Install requisite packages | |
yum install -y httpd git curl php composer php-mysql php-gd php-pdo php-openssl php-mbstring php-mcrypt php-curl php-xml unzip | |
# Replace old PHP 5.5 with PHP 5.6 | |
yum install -y https://centos7.iuscommunity.org/ius-release.rpm | |
yum install -y yum-plugin-replace | |
yum replace -y --replace-with php56u php | |
systemctl enable httpd | |
systemctl start httpd | |
# Creates a simple Apache virtual host to use (port 80) | |
cd /etc/httpd/conf.d | |
touch grav.conf | |
cat << EOF > grav.conf | |
<VirtualHost *:80> | |
DocumentRoot $serverFilesPath | |
<Directory "$serverFilesPath"> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> | |
</VirtualHost> | |
EOF | |
# Remove the default Apache confs | |
cd /etc/httpd/conf.d | |
rm -f autoindex.conf | |
rm -f welcome.conf | |
rm -f userdir.conf | |
# Download and unpack GravCMS | |
cd $serverFilesPath | |
rm -f ./* | |
wget https://github.com/getgrav/grav/releases/download/1.0.10/grav-admin-v1.0.10.zip | |
unzip grav-admin-v1.0.10.zip | |
shopt -s dotglob # Let wildcards affect dotfiles | |
mv grav-admin/* . | |
bin/gpm -y install admin | |
bin/gpm -y selfupgrade -f | |
bin/gpm -y update -f | |
# Set permissions correctly | |
cd $serverFilesPath | |
chown -R apache:apache . | |
chmod -R 775 . | |
# Restart neccesary services | |
systemctl restart httpd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment