-
Notifications
You must be signed in to change notification settings - Fork 0
/
dokuwiki-setup.sh
69 lines (58 loc) · 2.07 KB
/
dokuwiki-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
sudo yum install -y wget vim git epel-release unzip
sudo yum clean all
sudo yum update -y
sudo yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum --enablerepo=remi-php72 install -y php php-gd php-xml php-json
sudo yum install -y httpd openssl mod_ssl
sudo systemctl start httpd
sudo systemctl enable httpd
if [[ $GIT_INITIALIZED = "false" ]]
then
sudo wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
tar -xzvf dokuwiki-stable.tgz
sudo mv ~/dokuwiki-20* /var/www/html/wiki
sudo chown -R apache:apache /var/www/html/wiki
sudo chmod 755 -R /var/www/html/wiki
wget https://github.com/LotarProject/dokuwiki-template-bootstrap3/zipball/master
unzip master
sudo mv Lotar* /var/www/html/wiki/lib/tpl/bootstrap3
wget https://github.com/splitbrain/dokuwiki-plugin-searchindex/archive/2016-02-03.zip
unzip 2016-02-03.zip
sudo mv dokuwiki-plugin-search* /var/www/html/wiki/lib/plugins/searchindex
echo "# acl.auth.php
# <?php exit()?>
# Don't modify the lines above
* @ALL 0
* @user 8" | sudo tee /var/www/html/wiki/conf/acl.auth.php
echo "# users.auth.php
# <?php exit()?>
# Don't modify the lines above
#
# Userfile
#
# Format:
#
# login:passwordhash:Real Name:email:groups,comma,separated
$ADMIN_USERNAME:$ADMIN_PASSWORD_HASH:admin:[email protected]:admin,user" | sudo tee /var/www/html/wiki/conf/users.auth.php
echo "<?php
/**
* Dokuwiki's Main Configuration File - Local Settings
* Auto-generated by install script
* Date: Sun, 11 Nov 2018 22:07:35 +0000
*/
\$conf['title'] = '$WIKI_TITLE';
\$conf['template'] = 'bootstrap3';
\$conf['lang'] = 'en';
\$conf['license'] = 'cc-by-sa';
\$conf['useacl'] = 1;
\$conf['superuser'] = '@admin';
\$conf['disableactions'] = 'register';" | sudo tee /var/www/html/wiki/conf/local.php
sudo rm -f /var/www/html/wiki/install.php
fi
sudo sed -i s/SELINUX=enforcing/SELINUX=permissive/g /etc/selinux/config
sudo setenforce 0
sudo systemctl restart httpd
sudo mkdir /scripts
sudo chmod 755 /scripts
sudo chown centos:centos /scripts