{"id":17664,"date":"2015-10-06T15:46:13","date_gmt":"2015-10-06T20:46:13","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17664"},"modified":"2022-06-03T03:44:08","modified_gmt":"2022-06-03T08:44:08","slug":"install-quokka-on-a-centos-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-quokka-on-a-centos-vps\/","title":{"rendered":"Install Quokka on Centos"},"content":{"rendered":"
In this blog post we will show you how to install Quokka on a Centos VPS<\/a> with Nginx and uWSGI. Quokka is open source flexible content management system based on the Flask web framework . You can use Quokka to build a web portal, publish a blog or use it as a document management system . With the existing Quokka modules you can create an e-commerce application or fundraising website. This guide should work on other Linux VPS<\/a> systems as well but was tested and written for a Centos 7 VPS<\/a>.<\/p>\n <\/p>\n To install the EPEL repository on your CentOS VPS, just run:<\/p>\n Create a new user for Quokka:<\/p>\n We will install the latest MongoDB 2.6 packages from the official MongoDB repository.<\/p>\n Create a Once you have saved the file, install MongoDB with the following command:<\/p>\n Finaly start and enable MongoDB at boot:<\/p>\n The following commands are run as quokka user. To switch to quokka user run:<\/p>\n Create a new virtualenv using the following command<\/p>\n Clone the Quokka source code to the Switch to the new virtualenv<\/p>\n Install all dependencies with:<\/p>\n If you want to populate the installation with sample data run :<\/p>\n Nginx is not available by default in CentOS 7 so we will use the official Nginx repository:<\/p>\n To install Nginx run:<\/p>\n Next, create a new Nginx server block:<\/p>\n Install uWSGI using pip<\/p>\n Create uwsgi configuration file for Quokka:<\/p>\n Open your editor of choice and create a new systemd service for Quokka:<\/p>\n and add the following code lines:<\/p>\n Start and enable uWSGI at boot:<\/p>\n Start and enable Nginx at boot:<\/p>\n That’s it. You have successfully installed your Quokka. To access it, open Of course you don\u2019t have to do any of this if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.<\/p>\n PS<\/span><\/strong>. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this blog post we will show you how to install Quokka on a Centos VPS with Nginx and uWSGI. … <\/p>\nLogin to your VPS via SSH<\/h4>\n
ssh root@vps<\/pre>\n
Install the EPEL repository<\/h4>\n
[root]$ rpm -Uvh http:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/epel-release-7-5.noarch.rpm<\/pre>\n
Update the system and install necessary packages<\/h4>\n
[root]$ yum -y update\n[root]$ yum -y install git python-pip python-virtualenv pcre-devel python-imaging python-devel libjpeg-turbo-devel make gcc<\/pre>\n
Create a new system user<\/h4>\n
[root]$ adduser --comment 'Quokka User' --home-dir \/home\/quokka quokka<\/pre>\n
[root]$ chmod 755 \/home\/quokka<\/pre>\n
Install MongoDB<\/h4>\n
\/etc\/yum.repos.d\/mongodb-org-2.6.repo<\/code> file and insert the following lines:<\/p>\n
[root]$ nano \/etc\/yum.repos.d\/mongodb-org-2.6.repo<\/pre>\n
[mongodb-org-2.6]\nname=MongoDB 2.6 Repository\nbaseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/x86_64\/\ngpgcheck=0\nenabled=1<\/pre>\n
[root]$ yum -y install mongodb-org<\/pre>\n
[root]$ chkconfig mongod on\n[root]$ systemctl start mongod<\/pre>\n
Create a python virtual environment and clone the Quokka source code<\/h4>\n
[root]$ su - quokka<\/pre>\n
[quokka]$ virtualenv quokka-env<\/pre>\n
\/home\/quokka\/quokka-env\/quokka<\/code> directory.<\/p>\n
[quokka]$ cd quokka-env\n[quokka]$ git clone https:\/\/github.com\/quokkaproject\/quokka<\/pre>\n
[quokka]$ source ~\/quokka-env\/bin\/activate<\/pre>\n
(quokka-env)[quokka]$ cd quokka\n(quokka-env)[quokka]$ pip install -r requirements\/requirements.txt<\/pre>\n
(quokka-env)[quokka]$ \/home\/quokka\/quokka-env\/bin\/python manage.py populate<\/pre>\n
Install and configure Nginx and uWSGI<\/h4>\n
[root]$ rpm -Uvh http:\/\/nginx.org\/packages\/centos\/7\/noarch\/RPMS\/nginx-release-centos-7-0.el7.ngx.noarch.rpm<\/pre>\n
[root]$ yum -y install nginx<\/pre>\n
[root]$ nano \/etc\/nginx\/conf.d\/YOUR_QUOKKA_DOMAIN.conf<\/pre>\n
server {\n server_name YOUR_QUOKKA_DOMAIN;\n\tclient_body_in_file_only clean;\n\tclient_body_buffer_size 64K;\n\tclient_max_body_size 40M;\n\tsendfile on;\n send_timeout 300s;\n location ~ ^\/(static|mediafiles)\/ {\n root \/home\/quokka\/quokka-env\/quokka\/quokka;\n location ~* ^.+.(py|pyc|sh|bat|ini|pot|git)$ {deny all; }\n expires 7d;\n }\n location \/ {\n uwsgi_pass unix:\/home\/quokka\/quokka-env\/quokka\/etc\/logs\/quokka.socket;\n include \/etc\/nginx\/uwsgi_params;\n uwsgi_param UWSGI_SCHEME $scheme;\n uwsgi_param SERVER_SOFTWARE nginx\/$nginx_version;\n }\n}\n<\/pre>\n
pip install --upgrade uwsgi<\/pre>\n
mkdir \/etc\/uwsgi.d\/<\/pre>\n
[root]$ nano \/etc\/uwsgi.d\/quokka.ini<\/pre>\n
[uwsgi]\nchmod-socket = 666\nvirtualenv = \/home\/quokka\/quokka-env\nmount = \/=wsgi:application\nchdir = \/home\/quokka\/quokka-env\/quokka\nsocket = \/home\/quokka\/quokka-env\/quokka\/etc\/logs\/%n.socket\nstats = \/home\/quokka\/quokka-env\/quokka\/etc\/logs\/%n.stats.socket\nlogto = \/home\/quokka\/quokka-env\/quokka\/etc\/logs\/%n.log\nworkers = 4\nuid = quokka\ngid = quokka\nmax-requests = 2000\nlimit-as = 512\nreload-on-as = 256\nreload-on-rss = 192<\/pre>\n
[root]$ nano \/etc\/systemd\/system\/uwsgi.service<\/pre>\n
[Unit]\nDescription=uWSGI Emperor Service\nAfter=syslog.target\n\n[Service]\nExecStart=\/usr\/bin\/uwsgi --master --die-on-term --emperor \/etc\/uwsgi.d\nExecReload=\/bin\/kill -HUP $MAINPID\nKillSignal=SIGINT\nRestart=always\nType=notify\nStandardError=syslog\nNotifyAccess=all\n\n[Install]\nWantedBy=multi-user.target\n<\/pre>\n
[root]$ systemctl enable uwsgi\n[root]$ systemctl start uwsgi<\/pre>\n
[root]$ systemctl enable nginx\n[root]$ systemctl start nginx<\/pre>\n
http:\/\/YOUR_QUOKKA_DOMAIN\/<\/code> in your browser. For more information about Quokka, please refer to the official Quokka website.<\/p>\n
\n