Created
April 14, 2021 13:31
-
-
Save manjurulhoque/3387c61b8cc9bb6c5e82fe01e13e9e9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh into the server and goto the directory | |
then create a folder using mkdir, cd into that folder. create virtualenv and activate that env | |
clone project using git and goto the project directory. install dependencies using pip install -r requirements.txt. | |
create service file sudo nano /etc/systemd/system/<name>.service and configure like below: | |
[Unit] | |
Description=gunicorn daemon for listen music project | |
After=network.target | |
[Service] | |
User=root | |
Group=www-data | |
WorkingDirectory=/var/www/html/listenproject/listenapp | |
ExecStart=/var/www/html/listenproject/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/var/www/html/listenproject/listenapp.sock music.wsgi:application | |
[Install] | |
WantedBy=multi-user.target | |
then run this commands to start and enable this service: | |
# listenapp is just service name | |
sudo systemctl start listenapp | |
sudo systemctl enable listenapp | |
add domain config to /etc/nginx/sites-enabled/default | |
sudo nginx -t | |
sudo systemctl restart nginx | |
to reload after editing any service file: | |
sudo systemctl daemon-reload | |
sudo systemctl restart gunicorn | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment