Difference between revisions of "Radicale"

From wiki.tamerz.com
Jump to: navigation, search
(Added radicale.service)
Line 28: Line 28:
  
  
radicale.service:
+
/etc/systemd/system/radicale.service:
 
   [Unit]
 
   [Unit]
 
   Description=Radicale
 
   Description=Radicale

Revision as of 08:07, 1 September 2016

Installing Radicale using Gunicorn and Nginx on CentOS 7

Install Nginx:

Nginx is in the EPEL so install that first.

# yum install -y epel-release
# yum install -y nginx

We are going to run Radicale and Gunicorn in a virtual environment, so we need to install virtualenv

# yum install -y python-virtualenv

Create a "radicale" user to run the application:

# adduser radicale

Make them a member of the nginx group so that Nginx can access the files:

# usermod -a -G nginx radicale

Switch to the radicale user:

# su - radicale

Create the app directory and virtualenv:

$ mkdir radicale
$ cd radicale
$ virtualenv venv
$ source venv/bin/activate
(venv)$ pip install radicale gunicorn


/etc/systemd/system/radicale.service:

 [Unit]
 Description=Radicale
 After=network.target
 
 [Service]
 User=radicale
 Group=nginx
 WorkingDirectory=/opt/radicale
 ExecStart=/opt/radicale/venv/bin/gunicorn --workers 3 --bind:/opt/radicale/radicale.sock wsgi:application
 
 [Install]
 WantedBy=multi-user.target



References:

How To Set Up Django with Postgres, Nginx, and Gunicorn on CentOS 7
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-centos-7

How to use selinux on your Redhat/CentOS server.
http://blog.centralserv.co.uk/how-to-use-selinux-on-centos-6-5/