This set of scripts is homework for DevOPS01 cource
Task description goes here:
https://github.com/DevOps01-ua/Linux01/blob/main/homework/HW1.md
In few words the scripts should deploy sample project https://github.com/Manisha-Bayya/simple-django-project
-
OS distribution - tested with Debian\Ubuntu\Oracle\Alma\Rocky linux stale version on september 2023 and minus 2 stable version. May work on other versions but not guaranteed
-
Create linux user without root rights
#create user useradd keefeere #add user to sudo like this usermod -aG sudo keefeere #or this echo "keefeere ALL=(ALL:ALL) ALL" | sudo EDITOR='tee -a' visudo #make shure that user's dir is exist and accesible mkdir /home/keefeere chown keefeere:keefeere /home/keefeere
-
Ensure that sudo is installed and user have sudo rights
-
In case of using wsl2 ensure that systemd support enabled
To enable, start your Ubuntu (or other Systemd) distribution under WSL (typically just wsl ~ will work).
Edit file
/etc/wsl.conflike this:sudo -e /etc/wsl.confAdd the following:
[boot] systemd=true
git clone "https://github.com/keefeere/linux_HW01.git"
cd linux_HW01Open file mail_config_example.sh with any editor and enter your variables for mail server
Better use GMail but not forget that for SMTP you must enable passwords for appliations
export EMAIL_HOST_USER='your_user@gmail.com'
export EMAIL_HOST_PASSWORD='pass'Execute script mail_config_example.sh
💡 TIP: Run with
. mail_config_example.shnot with.\mail_config_example.shbecause this script will be executed in curren shell and script will set current shell environment variables
This script will install all build dependencies and build specific Python version for you you may asked of root or sudo password
cd /your dir
chmod +x provisionmysqlenv.sh
./provisionpython.shat the end of execution you should see prompt with ENV started
This will install MySQL server and provision it's root password to main script throught environment variable
Open dir with scripts, set execution rights and run
cd /your dir
chmod +x provisionmysql.sh
. provisionmysql.sh💡 TIP: Run with
. provisionmysql.shnot with.\provisionmysql.shbecause this script will be executed in current shell and script will set current's shell environment variables
In dir with scrips run:
cp startdjango.sh ~
cd ~
chmod +x startdjango.sh
./startdjango.shWhen scrips prompts:
WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'.
Your choices after this are to restore from backups or rebuild via the rebuild_index command.
Are you sure you wish to continue? [y/N]
Press y
