Przeglądaj źródła

apache wsgi config

kevin 1 rok temu
rodzic
commit
d34dd2fd78
5 zmienionych plików z 28 dodań i 0 usunięć
  1. 0 0
      __init__.py
  2. 17 0
      apache/chatgpt.conf
  3. 9 0
      chatgpt.wsgi
  4. 1 0
      gunicorn.conf.py
  5. 1 0
      requirements.txt

+ 0 - 0
__init__.py


+ 17 - 0
apache/chatgpt.conf

@@ -0,0 +1,17 @@
+<VirtualHost *:80>
+    ServerAdmin webmaster@localhost
+    ServerName maronakingz
+    ServerAlias maronakingz.local
+    DocumentRoot /var/www/maronakingz
+    WSGIDaemonProcess chatgpt user=maronakins threads=5 python-home=/var/www/maronakingz/wsgi/.venv
+    WSGIScriptAlias /chatgpt /var/www/maronakingz/wsgi/chatgpt.wsgi
+    WSGIApplicationGroup %{GLOBAL}
+    <Directory /var/www/maronakingz/wsgi/>
+        WSGIProcessGroup chatgpt
+        WSGIApplicationGroup %{GLOBAL}
+        Order allow,deny
+        Allow from all
+    </Directory>
+    ErrorLog ${APACHE_LOG_DIR}/error.log
+    CustomLog ${APACHE_LOG_DIR}/access.log combined
+</VirtualHost>

+ 9 - 0
chatgpt.wsgi

@@ -0,0 +1,9 @@
+#!/var/www/maronakingz/wsgi/.venv/bin/python
+
+import sys
+import logging
+
+logging.basicConfig(level=logging.DEBUG, filename='/var/www/maronakingz/wsgi/chatgpt.log', format='%(asctime)s %(message)s')
+sys.path.insert(0, '/var/www/maronakingz/wsgi')
+
+from main import app as application

+ 1 - 0
gunicorn.conf.py

@@ -13,6 +13,7 @@ keyfile = None
 certfile = None
 worker_class = 'gthread'
 threads = 4
+ca_certs = None
 
 def on_starting(server):
     worker_count = int(workers)

+ 1 - 0
requirements.txt

@@ -1,3 +1,4 @@
 Flask==2.3.2
 gunicorn==20.1.0
+mod-wsgi==4.9.4
 openai==0.27.8