Variables Used:
{{ENDPOINT}}
The endpoint used for project.
e.g. api.xyz.com
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install gzip
sudo apt-get install php7.3
sudo apt install zip unzip php7.3-zip
sudo apt-get install php7.3-curl
sudo phpenmod curl
sudo apt-get install php7.3-xmlrpc
sudo phpenmod xmlrpc
sudo apt-get install php7.3-mbstring
sudo phpenmod mbstring
sudo apt-get install php7.3-dom
sudo phpenmod dom
sudo apt-get install php7.3-gd
sudo phpenmod gd
sudo apt-get install php7.3-mysql
sudo nano /etc/php/7.3/apache2/php.ini
Set the following variables as required.
upload_max_filesize = 10M
post_max_size = 10M
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
sudo nano /etc/environment
Paste the following lines:
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
sudo a2enmod rewrite
sudo service apache2 restart
sudo groupadd htmlowners
sudo usermod -a -G htmlowners ubuntu
sudo usermod -a -G htmlowners www-data
cd /var/www
sudo mkdir {{ENDPOINT}}
sudo chown -R ubuntu {{ENDPOINT}}
- Create Account
- Create Repository
- Copy your ssh key to beanstalk
- copy beanstalk's ssh key on clipboard
sudo nano ~/.ssh/authorized_keys
- paste the copied ssh key from beanstalk here.
- Deploy code from beanstalk
cd /etc/apache2/sites-available/
sudo nano {{ENDPOINT}}.conf
Configure and save
Sample File Heresudo a2ensite {{ENDPOINT}}.conf
sudo service apache2 restart
cd /var/www/{{ENDPOINT}}
composer install
sudo chown -R ubuntu:htmlowners storage
sudo chown -R ubuntu:htmlowners bootstrap/cache
sudo chmod -R g+s storage
sudo chmod -R g+s bootstrap/cache
sudo chmod -R u+s storage
sudo chmod -R u+s bootstrap/cache
sudo find storage -type d -exec chmod 775 {} \;
sudo find storage -type f -exec chmod 664 {} \;
sudo find bootstrap/cache -type d -exec chmod 775 {} \;
sudo find bootstrap/cache -type f -exec chmod 664 {} \;
sudo find {{ENDPOINT}} -type d -exec chmod 775 {} \;
sudo find {{ENDPOINT}} -type f -exec chmod 664 {} \;