Arborescence des pages

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

CompteRépertoire (si besoin)CommandeCommentaires
root
yum install --enablerepo=epel nginx(avertissement)Inutile normalement (à l'UM, déjà réalisé par l'équipe Système)
root
emacs /etc/nginx/nginx.conf

(info)Vérifier, dans ce fichier, que :

  • include /etc/nginx/conf.d/*.conf existe,
  • commenter l'ipv6 "# listen [::]:80 default_server;",
  • ajouter  "server_tokens      off;" pour ne pas avoir la version affichée
  • supprimer le index.html du root du site par défaut.
root
systemctl enable nginxActivation du service
root
systemctl start nginxDémarrage du serveur
pod/data/www/pod/django_projects/podv2/emacs pod/custom/pod_nginx.conf

Configuration Nginx & Pod.

Bloc de code
# the upstream component nginx needs to connect to
upstream podupstream {
    server unix:///var/run/podv2/podv2.sock max_fails=2 fail_timeout=3s;
}

# configuration of the server
server {
        
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name video.umontpellier.fr;
    charset     utf-8;
    
    # max upload size
    client_max_body_size 4G;

    # adjustAllow to download large tastefiles
    uwsgi_max_temp_file_size 0;

    # Django media
    location /media  {
        alias /data/www/pod/media;
    }

    location /static {
        alias /data/www/pod/django_projects/podv2/pod/static;
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  podupstream;
        # Si besoin, timeout uWsgi à 10min
        uwsgi_read_timeout 600;
        include     /data/www/pod/django_projects/podv2/uwsgi_params;
    }
}


root/data/www/pod/django_projects/podv2/ln -s /data/www/pod/django_projects/podv2/pod/custom/pod_nginx.conf /etc/nginx/conf.d/pod_nginx.confCréation du lien symbolique dans Nginx pour Pod
root
systemctl restart nginxRedémarrage nginx
root
pip3 install uwsgiInstallation uWSGI
pod
emacs /data/www/pod/django_projects/podv2/pod/custom/pod_uwsgi.ini

Configuration uWSGI

Bloc de code
# pod_uwsgi.ini file
[uwsgi]

# Django-related settings
# the base directory (full path)
chdir           = /data/www/pod/django_projects/podv2
# Django's wsgi file
module          = pod.wsgi
# the virtualenv (full path)
home            = /data/www/pod/.virtualenvs/django_pod
# process-related settings
# master
master          = true
# maximum number of worker processes
processes       = 10
# the socket (use the full path to be safe)
socket          = /var/run/podv2/podv2.sock
chown-socket     = pod:nginx
chmod-socket    = 660
# clear environment on exit
vacuum          = true
#
daemonize        = /var/log/podv2/uwsgi-pod.log
#
die-on-term        = true
#
limit-as         = 5120
max-requests    = 5000
#harakiri = 30
#ignore-sigpipe=true
#ignore-write-errors=true
#disable-write-exception=true


root
mkdir /var/run/podv2Création répertoire de run pour uWSGI
root
chown pod:nginx /var/run/podv2/Droits de ce répertoire
root
mkdir /var/log/podv2Création répertoire de run pour uWSGI
root
chown pod:nginx /var/log/podv2/Droits de ce répertoire

...