Skip to content

Instantly share code, notes, and snippets.

@mashcom
Created June 14, 2023 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mashcom/5fd72794afd42668d0460ce696b3f432 to your computer and use it in GitHub Desktop.
Save mashcom/5fd72794afd42668d0460ce696b3f432 to your computer and use it in GitHub Desktop.
Originality Install Script
#!/bin/bash
## BASE INSTALLATION
# Update package lists
sudo apt-get update
# Install necessary packages
sudo apt-get install apache2 # Apache HTTP Server
sudo apt-get install apache2-dev # Apache development headers and module support
sudo apt-get install build-essential # Essential build tools
sudo apt-get install python3-dev # Python 3 development headers
sudo apt-get install libapache2-mod-wsgi-py3 # Apache module for hosting Python WSGI applications
sudo apt-get install libpq-dev # PostgreSQL development headers
sudo apt-get install netcat # Networking utility for reading from/writing to network connections
sudo apt-get install default-libmysqlclient-dev # MySQL development headers
sudo apt-get install libmagic-dev # Development files for libmagic, a file type detection library
# Remove cached package lists
sudo rm -rf /var/lib/apt/lists/*
# Update package lists again
sudo apt-get update
# Install MariaDB server
sudo apt-get install mariadb-server
# Start MariaDB service
sudo systemctl start mariadb
# Secure MariaDB installation
sudo mysql_secure_installation
#enable apache mod rewrite
sudo a2enmod rewrite
#install python-venv
sudo apt install python3.10-venv
## SCRIPT INSTALLATION
# Clone the repository from GitHub
sudo git clone https://github.com/mashcom/originality-integration-fiverr
# Navigate to the cloned repository
cd originality-integration-fiverr
#create the .env file
sudo cp .env_example .env
# Create a directory for virtual environments
sudo mkdir .venvs
# Create a virtual environment for Django
sudo python3 -m venv venvs/django
# Activate the virtual environment
source venvs/django/bin/activate
# Create a log file for Django
sudo touch logs/django.log
# Set permissions for the log file
sudo chmod 0777 logs/django.log
# Change ownership of the repository to www-data user and group
sudo chown -R www-data:www-data .
# Set directory permissions
sudo chmod 0777 .
# Install Python dependencies
sudo venvs/django/bin/pip install -r requirements.txt
## DATABASE MIGRATIONS
# Run database migrations
sudo venvs/django/bin/python manage.py makemigrations
sudo venvs/django/bin/python manage.py migrate
#create application super user
sudo venvs/django/bin/python manage.py createsuperuser
#install snapd
sudo apt update
sudo apt install snapd
sudo snap install core; sudo snap refresh core
#install certbot
sudo apt-get remove certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
# after adding apache config run certbot to install ssl
#sudo cerbot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment