Welcome to Setting Up WAGATIL CMS USING UWSGI and NGINX 👋


Twitter: mfaisaltariq01


This repository will will configure and setup a demo Wagtail CMS that is served using uwsgi and proxied through nginx.

NOTE


All the roles have been test with CentOS7.

The Role for mariadb have been reused from the bertv.mariadb ansible-galaxy official repository

ROLES


MARIADB

  • The maria db role installs mariadb from the official repository
  • Remove all the test dbs/users
  • Creates our custom user and database and assign all priviledges of the database to our custom user

WAGTAIL

  • The wagtail role installs python3, pip, wagtail, uwsgi and other dependencies
  • Sets up a virtual python environments
  • Creates a wagtail project and configures it to us mariadb instead of SQLite
  • Configures the project with uwsgi.
  • Starts uwsgi service to serve pages to the user

NGINX

  • The nginx role installs nginx and enables service on startup
  • Configures environment to proxy uwsgi
  • Disable selinux so that nginx can run without any permissions issue
    This can be improved by setting selinux to permissive mode instead of completly disabling it

Usage


  • Add the host to the inventory file
  • In the host_vars directory create a new file. Name of the file should be the hostname/IP of the managed host and set the variables accordingly. (See the sample host_vars/localhost file).
  • Run the ansible-playbook e2e-setup.yaml playbook to simulate the end 2 end senario of setting up the entire environment.

NOTE:
A restart of the server might be required after the setup to make sure selinux policies take effect.

Author

👤 Muhammad Faisal Tariq

Twitter: mfaisaltariq01
Github: mfaisaltariq
LinkedIn: mfaisaltariq
YouTube: mfaisaltariq

Show your support

Give a ⭐️ if this project helped you!