Skip to content

Instantly share code, notes, and snippets.

@webbgeorge
Last active May 24, 2016 21:13
Show Gist options
  • Select an option

  • Save webbgeorge/66f3edb155ba67fd11fbdab75557b3f2 to your computer and use it in GitHub Desktop.

Select an option

Save webbgeorge/66f3edb155ba67fd11fbdab75557b3f2 to your computer and use it in GitHub Desktop.
Install PHPCI on amazon linux in EC2
#!/bin/bash
# Ensure in user's home dir to start
cd ~
# Yum packages
sudo yum update -y
sudo yum install -y httpd24 mysql-server php55 php55-devel php55-common php55-cli php55-pecl-apc php55-pdo php55-xml php55-gd php55-mbstring php-pear php55-mysqlnd php55-mcrypt
# Start apache and start on boot
sudo chkconfig httpd on
sudo service httpd start
# Set up MySQL
sudo chkconfig mysqld on
sudo service mysqld start
sudo /usr/bin/mysql_secure_installation # TODO: input arguments on CLI
# Install beanstalkd
sudo yum install --enablerepo=epel beanstalkd
sudo service beanstalkd start
chkconfig beanstalkd
# Install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
# Create install dir
sudo mkdir /var/www/phpci
sudo chown ec2-user:ec2-user /var/www/phpci
# Install PHPCI
composer create-project block8/phpci /var/www/phpci --keep-vcs --no-dev
cd /var/www/phpci && composer install
./console phpci:install
# Create VirtualHost
sudo cat > /etc/httpd/conf.d/phpci.conf <<- EOM
<VirtualHost *:80>
ServerName phpci.dev
DocumentRoot /var/www/phpci/public
<Directory /var/www/phpci/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</VirtualHost>
EOM
# Restart apache
sudo service httpd restart
# Start the phpci "Daemon"
nohup php ./daemonise phpci:daemonise >/dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment