DokuWiki

It's better when it's simple

User Tools

Site Tools


install:centos

This is an old revision of the document!


CentOS

CentOS 7.x

Firewall Rules

Incoming traffic on port 80 may be blocked by default. If so, we must create a permanent firewall rule to accept incoming traffic to our DokuWiki website.

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

Apache

Ensure apache service always starts on boot.

sudo systemctl enable httpd.service  

mod_rewrite must be enabled so the .htaccess file which locks down the /data directory can be executed.

Add the following 1 line to a new .conf file and restart apache to load the mod_rewrite module

echo LoadModule rewrite_module modules/mod_rewrite.so > /etc/httpd/conf.d/addModule-mod_rewrite.conf
sudo systemctl restart httpd.service

PHP GD Module Install

The PHP GD module must be installed for image resizing.

sudo yum install php-gd

SELinux Note

CentOS comes with SELinux enabled by default which prevents the apache user from writing to the Document Root and sub directories.

Option 1 We will now modify SELinux to monitor apache in permissive mode. This allows apache to read/write to directories required by DokuWiki and maintains safety by not disabling SELinux.

sudo yum install policycoreutils-python
sudo semanage permissive -a httpd_t

Option 2 Modify context (conf & data directories)

sudo chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/dokuwiki/conf
sudo chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/dokuwiki/data

sudo semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/dokuwiki/conf
sudo semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/dokuwiki/data
sudo restorecon -v /var/www/html/dokuwiki/conf
sudo restorecon -v /var/www/html/dokuwiki/data

For option 2: Using the Wiki Upgrade Plugin & the Extension Manager
To use the Wiki Upgrade Plugin & the Extension Manager with option 2 you also have to grand apache access to the network, otherwise you will get the error : Could not connect Permission denied

sudo setsebool -P httpd_can_network_connect on

check with getsebool -a | grep httpd_can_network_connect

install/centos.1481104626.txt.gz · Last modified: 2016-12-07 10:57 by 134.130.4.241

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki