Skip to content

Commit

Permalink
Create scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfiex authored Jul 11, 2024
1 parent 74aa7f8 commit e05dc36
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/Apache/scripts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@


```
sudo apt-get install libapache2-mod-wsgi-py3
sudo a2enmod wsgi
```



/var/www/html/my_script.py

```
# /etc/apache2/sites-available/my_script.conf
<VirtualHost *:80>
ServerName mysite.com

WSGIDaemonProcess my_script user=www-data group=www-data threads=5
WSGIScriptAlias / /var/www/html/my_script.py

<Directory /var/www/html>
WSGIProcessGroup my_script
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
</VirtualHost>
```


<VirtualHost *:80>
ServerName your-domain.com
ServerAdmin [email protected]

WSGIDaemonProcess myapp python-home=/path/to/your/env
WSGIProcessGroup myapp

WSGIScriptAlias / /var/www/html/myscript.py

<Directory /var/www/html>
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


```
sudo a2ensite my_script.conf
sudo systemctl restart apache2

sudo apache2ctl configtest
```

0 comments on commit e05dc36

Please sign in to comment.