2022年5月6日金曜日

Django web Serverの構築(websv)

# dnf install httpd httpd-devel
# dnf install python36 python3-libs python36-devel
# pip3 install --upgrade pip
# mkdir /var/www/wsgi
# chmod 0755 /var/www/wsgi
# mkdir /var/log/python/
# chmod  a+w /var/log/python                           ※ あとで直す。
# vi /etc/httpd/conf/httpd.conf
ServerName websv1:80
# dnf install gcc rpm-build
# pip3 install mod-wsgi
# vi /etc/httpd/conf.modules.d/20-wsgi.conf
LoadModule wsgi_module /usr/local/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
# httpd -M|grep wsgi
proxy_uwsgi_module (shared)
wsgi_module (shared)
#  vi /etc/httpd/conf.d/wsgi.conf
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
WSGIApplicationGroup %{GLOBAL}
WSGISocketPrefix /var/run/wsgi

WSGIDaemonProcess test user=apache group=apache processes=1 threads=100 maximum-                               requests=10000 \
                             home=/var/www/wsgi/test \
                            python-home=/var/www/wsgi/test/myenv/venv36-d324 \
                           python-path=/var/www/wsgi/test/django:/var/www/wsgi/test/myenv/venv36-d324/lib/python3.6/site-packages \
                           lang=ja_JP.utf8

WSGIScriptAlias /test /var/www/wsgi/test/Config/wsgi.py process-group=test

Alias /static/ /var/www/wsgi/test/static/
Alias /media/ /var/www/wsgi/test/media/
WSGIPassAuthorization on

# for s3
Alias /assets/ /s3/assets/
Alias /media/  /s3/media/
<Directory /s3/assets>
   Require all granted
</Directory>

<Directory /s3/media>
   Require all granted
</Directory>

<Location /test>
WSGIProcessGroup test
</Location>

#   cd  /var/www/wsgi
#    scp -rp root@websv1:/var/www/wsgi/test  .
# chown -R apache:apache test

# firewall-cmd --add-service=http --zone=public --permanent
# firewall-cmd --reload

# dnf remove mariadb* mysql*
# curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
# dnf install MariaDB-client 
# dnf install zbar





0 件のコメント:

コメントを投稿

zabbix7 amazon linux2023 インストール postgres15

【postgres】 dnf -y install postgresql15-server postgresql15-server-devel postgresql-setup initdb passwd postgres vi `find / -name pg_hba.con...