sudo apt update
-
Install required packages for mysqlclient:
sudo apt install pkg-config sudo apt install libmysqlclient-dev sudo apt-get install libpython3.9-dev default-libmysqlclient-dev build-essential
-
Install NGINX:
sudo apt install nginx
-
Open nginx configuration file:
sudo nano /etc/nginx/sites-available/default
Clear the contents of the file and add the following lines (SAVE & EXIT):
server { server_name <example.com> <vpc-ip-address>; location / { include proxy_params; proxy_pass http://localhost:5001; } location /socket.io { include proxy_params; proxy_http_version 1.1; proxy_buffering off; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_pass http://localhost:5001/socket.io; } }
-
Make sure nginx is listening to port 80 and 443:
sudo iptables -I INPUT -p TCP --dport 80 -j ACCEPT sudo iptables -I INPUT -p TCP --dport 443 -j ACCEPT
-
Open bash profile:
sudo nano ~/.bash_profile
-
Append these lines inside bash profile (SAVE & EXIT):
export SECRET_KEY="<your-secret-key(any random string)>" export DB_USER="<your mysql username>" export DB_PASS="<your mysql password>"
-
Execute commands from a bash_profile in current shell environment:
source ~/.bash_profile
-
Install MySQL:
sudo apt install mysql-server
-
Change MySQL password:
sudo mysql ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
-
DATABASE CONFIGURATION
- Run these commands in your mysql terminal
-
Install virtualenv:
sudo apt install virtualenv
-
Install the repository:
git clone https://github.com/shubhamistic/DIGIBOXX-HACKATHON.git
-
Activate virtualenv and install the modules (use byobu):
virtualenv DIGIBOXX-HACKATHON cd DIGIBOXX-HACKATHON source ~/.bash_profile source bin/activate pip install --no-cache-dir -r requirements.txt
-
Run the server using:
gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 -b 127.0.0.1:5001 app:app
This repository is maintained by shubhamistic, a passionate programmer and web developer. Explore my projects and join me on my journey to create innovative solutions and push the boundaries of what's possible.