- Completed
Using the IP address from the server
- Completed
You will need the Incuna scripts repo
-
From the Incuna scripts repo
fab -f setup_salt.py deploy:your-new-site.com
- Completed
-
From the salt server
-
Check the new server is available.
sudo salt-key -L
- Completed
-
Accept the new server.
sudo salt-key -a your-new-site.com
- Completed
-
Push high state to the new server.
sudo salt your-new-site.com state.highstate -v
- Completed
-
-
SSH to the new server.
ssh incuna@your-new-site.com
- Completed
On the new server
-
Download the Distelli agent.
curl -sSL https://www.distelli.com/download/client | sh- Completed
-
Install the Distelli agent.
sudo /usr/local/bin/distelli agent install
- Completed
The Distelli setup instructions for setting up Applications & builds are located here.
On the new server
-
Navigate to the
wwwfolder and create a folder for the new site.cd /var/www/mkdir your-new-site.com
cd /var/www/your-new-site.com- Completed
-
Create the Client & Static media folders.
mkdir client_media static_media
- Completed
-
Grant the correct permissions.
sudo chgrp -R www-data .This will change the group permission of
/var/www/your-new-site.com,/var/www/your-new-site.com/client_media&/var/www/your-new-site.com/static_media.sudo chown distelli static_media
sudo chown distelli client_media
- Completed
-
Create a folder for the envitonment variables.
cd /varmkdir conf
cd confmkdir env
cd env- Completed
-
Change the permissions for
/var/conf/env.sudo chown -R incuna .- Completed
-
Create the environment variables.
The environment variables will change depending on the project. These are the core variables more most projects.
Name Value ALLOWED_HOSTSyou-new-site.comDATABASE_URLpostgres://user:password@127.0.0.1/database_nameMEDIA_ROOT/var/www/your-new-site.com/client_mediaMEDIA_URLhttps://your-new-site.com/client/OPBEAT_APP_IDapp_idOPBEAT_ORGANIZATION_IDorg_idOPBEAT_SECRET_TOKENtokenSECRET_KEYsecret_keySTATIC_ROOT/var/www/your-new-site.com/static_mediaSTATIC_URLhttps://your-new-site.com/static/-
To create the variable l, where Name and Value are the column labels above:
echo 'Value' > Name
- Completed
-
-
Start a
PSQLshell as the postgres user.sudo -u postgres psql
- Completed
Inside the psql shell.
-
Create the database.
create database new_site_db;- Completed
-
Create the user with a password.
create user new_user with password 'new_password';
- Completed
-
Grant permissions to the user on the database.
grant all on databse new_site_db to new_user;- Completed
These credentials must match the DATABASE_URL environment variable.
-
Create the Supervisor config.
sudo vim /etc/supervisor/conf.d/your_new_site.conf
- Completed
-
Reload & restart Supervisor.
sudo supervisorctl
This will open a supervisor shell.
reload
This will reload the all supervisor config files.
restart your_new_site
This will restart the your_new_site process, you could also user
restart allto restart all processes.Ctrl dto exit the Supervisor shell.- Completed
###Supervisor help
You do not need to enter a shell to use supervisor.
sudo supervisorctl restart allUse
tail -f process_namewithin a supervisor shell to help resolve errors.
-
Create the Nginx config.
vim /etc/nginx/sites-available/your_new_site.conf
ln -s /etc/nginx/sites-available/your_new_site.conf /etc/nginx/sites-enabled/your_new_site.conf
Test the config file is valid using
sudo /etc/init.d/nginx configtest.- Completed
-
Reload and restart Nginx.
sudo /etc/init.d/nginx reload
Reloads the nginx config.
sudo /etc/init.d/nginx restart
Restarts the nginx config.
- Completed