Skip to content

Instantly share code, notes, and snippets.

@charlesastwood
Last active January 30, 2024 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save charlesastwood/c0ba2d49e8a7210d1a6817a0ea47f570 to your computer and use it in GitHub Desktop.
Save charlesastwood/c0ba2d49e8a7210d1a6817a0ea47f570 to your computer and use it in GitHub Desktop.
Install Symfony on AWS
sudo yum update
sudo yum install httpd24 php70 php70-cli php70-intl php70-gd php70-zip php70-xml php70-mysqlnd php70-mbstring php70-dom php70-soap php70-memcached memcached php70-fpm php70-opcache php70-mcrypt git
sudo service httpd start
sudo chkconfig httpd on
sudo groupadd www
sudo usermod -a -G www ec2-user
exit
sudo chown -R root:www /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} \;
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
sudo yum install -y nodejs
sudo npm install -g bower gulp
sudo ln -s /usr/bin/php70 /usr/local/bin/php
sudo rm -rf localtime && sudo ln -s /usr/share/zoneinfo/Europe/London localtime
sudo ntpdate -u pool.ntp.org
sudo curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
sudo ln -s /usr/local/bin/composer /usr/bin/composer
sudo vi /etc/httpd/conf.d/site.conf
<VirtualHost *:80>
ServerName domain.tld
ServerAlias www.domain.tld
DocumentRoot /var/www/project/web
<Directory /var/www/project/web>
AllowOverride None
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
</Directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeeScript assets
# <Directory /var/www/project>
# Options FollowSymlinks
# </Directory>
# optionally disable the RewriteEngine for the asset directories
# which will allow apache to simply reply with a 404 when files are
# not found instead of passing the request into the full symfony stack
<Directory /var/www/project/web/bundles>
<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>
</Directory>
ErrorLog /var/log/apache2/project_error.log
CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment