Loading...
 

History: How to install WikiSuite on Windows Server

Preview of version: 68

The reference implementation of WikiSuite is with ClearOS. However, in some corporate environments, the only option is Windows. Thus, we are currently developing an alternate recipe to set up parts of WikiSuite on Windows Server 2012 R2.

Included

Use Windows version instead of Linux

  • PHP 5.6
  • Apache 2.4
  • MariaDB

Replaced

  • ClearOS OpenLDAP -> Use Tiki logins as master (So Openfire needs to connect to Tiki instead of ClearOS's OpenLDAP)
  • Cron jobs -> Windows Tasks (make sure console.php index:rebuild --log is run from where the Tiki is)
  • svn from the command line -> https://tortoisesvn.net/
  • ClearOS firewall -> Windows Firewall
  • https://doc.tiki.org/Search+within+files -> ???

Maybe later

Excluded

  • ClearOS, because you are running on Windows Server
  • Kolab / Roundcube, because it's not supported on Windows, and we expect that you already have an e-mail system such as Microsoft Exchange
  • FusionPBX / FreeSWITCH because we assume you already have a PBX phone system
  • Kaltura, because it's not supported on Windows: http://kaltura.github.io/platform-install-packages/
  • Xibo, because it's a lesser used component


Installation instructions

For the instructions below, please use the Command Prompt (which is different than Windows PowerShell)

  • It is recommended to activate these two options:
    • Show "File name extension" as it makes it easier to create a new .php file
    • Show "Hidden items" as Subversion (the tool used to manage source control of Tiki) uses this to store needed data. And thus, if you move Tiki to a new directory, you need to make sure not to forget these hidden folders.

2016 08 20 Windows 2012 Show Hide File Name Extensions And Hidden Items

Download and install latest Apache

  • Choose to download 'vc_redist.x64.exe';
  • Run 'vc_redist.x64.exe';
  • Click on the 'Next' button.

  • Unzip and move the 'Apache24' directory to the root of your data drive (example: 'D:');
  • Unzip 'mod_fcgid.so' to "D:\Apache24\modules\";
  • Run "D:\Apache24\bin\httpd.exe" from a command prompt;
    • If you choose to run 'D:', you'll get some error messages and be instructed to fix some lines in 'httpd.conf'. Just replace the paths from 'C:' to 'D:'.
  • By navigating to 'http://127.0.0.1/', confirm that "It works!";
  • With focus on the command prompt window hold down "Ctrl + C" then release both to stop Apache.

Download and install latest PHP 5

  • Download PHP VC11 x64 Thread Safe - v5.6.31 as of 2017/09/09;
  • Extract the content of this file to the root of your data drive in 'a 'PHP5' directory (example: 'D:\PHP5');
  • Add 'php.exe' to the system's path environmental variable:

From the Command Prompt (Admin)
C:\>setx PATH "%PATH%;D:\PHP5" /M

SUCCESS: Specified value was saved.

C:\>

  • Choose to download 'vcredist_x64.exe';
  • Run 'vcredist_x64.exe';
  • Check 'I agree to the license terms and conditions' and click on the 'Install' button;
  • Click on the 'Next' button;
  • Click on the 'Close' button.

Configure PHP

  • Navigate to the PHP folder and copy the 'php.ini-production' file to 'php.ini';
  • Edit the 'php.ini' file;
  • Find the 'extension_dir' directive and change so that it properly locates the 'ext' folder, i.e.:

; extension_dir = "ext"
>>>
extension_dir = D:\PHP5\ext

  • Uncomment the Windows Extensions for MySQL / MariaDB by removing the ";":

;extension=php_mysqli.dll
>>>
extension=php_mysqli.dll

;extension=php_pdo_mysql.dll
>>>
extension=php_pdo_mysql.dll

  • Uncomment the 'curl' and 'openssl' Windows extensions to be able to use Composer:

;extension=php_curl.dll
>>>
extension=php_curl.dll

;extension=php_openssl.dll
>>>
extension=php_openssl.dll

  • Uncomment the 'gd2' Windows extensions to be able to correctly use Tiki:

;extension=php_gd2.dll
>>>
extension=php_gd2.dll

  • Uncomment the 'mbstrings' and 'gmp' Windows extensions as recommended by Tiki Check

;extension=php_mbstrings
;extension=php_gmp.dll
>>>
extension=php_mbstrings.dll
extension=php_gmp.dll

  • Uncomment the PATH_INFO/PATH_TRANSLATED support for CGI:

;cgi.fix_pathinfo=1
>>>
cgi.fix_pathinfo=1

  • Save the file as 'php.ini'.
  • Ensure that you can run PHP from the Windows Command Line:

php -m

If you get "the program can't start because msvcr110.dll is missing", it's likely because you picked the 32 bits ( x86) version instead of 64 above.

  • Edit the PHP configuration file ('php.ini') for Tiki's usage:

memory_limit = 128M
>>>
memory_limit = 256M

upload_max_filesize = 2M
>>>
upload_max_filesize = 128M

post_max_size = 8M
>>>
post_max_size = 128M

;extension=php_sqlite3.dll
>>>
extension=php_sqlite3.dll

;extension=php_fileinfo.dll
>>>
extension=php_fileinfo.dll

;extension=php_intl.dll
>>>
extension=php_intl.dll

disable_functions = 
>>>
disable_functions = exec, passthru, shell_exec, system, proc_open, popen, curl_exec, curl_multi_exec, parse_ini_file, show_source, allow_url_fopen

allow_url_fopen = On
>>>
allow_url_fopen = Off

  • Edit the PHP configuration file ('php.ini') to add your timezone as recommended by Tiki :
  • Here's a configuration example for 'date.timezone':

;date.timezone =
>>>
date.timezone = America/New_York

  • Configure the 'session.save_path' in 'php.ini' in order to use PHP's session functions:

;session.save_path = "/tmp"
>>>
session.save_path = "C:\Windows\Temp"

  • Edit the PHP configuration file ('php.ini') to enable OPcache for performance:

+++
zend_extension=php_opcache.dll

;opcache.enable=0
>>>
opcache.enable=1

;opcache.memory_consumption=64
>>>
opcache.memory_consumption=128

;opcache.interned_strings_buffer=4
>>>
opcache.interned_strings_buffer=8

;opcache.max_accelerated_files=2000
>>>
opcache.max_accelerated_files=4000

;opcache.revalidate_freq=2
>>>
opcache.revalidate_freq=60

;opcache.fast_shutdown=0
>>>
opcache.fast_shutdown=1

  • Edit the PHP configuration file ('php.ini') to display errors (optional)

+++
display_errors=Off
>>>
display_errors=On

  • Edit the PHP configuration file ('php.ini') to enable LDAP support

+++
;extension=php_ldap.dll
>>>
extension=php_ldap.dll

  • Edit the Apache configuration file ('httpd.conf') to make sure you load 'mod_fcgid':

LoadModule fcgid_module modules/mod_fcgid.so

<IfModule fcgid_module>
   FcgidMaxProcesses 300
   FcgidMaxProcessesPerClass 300

   FcgidOutputBufferSize 65536
   FcgidConnectTimeout 10
   FcgidProcessLifeTime 0
   FcgidMaxRequestsPerProcess 0
   FcgidMinProcessesPerClass 0
   FcgidFixPathinfo 0
   FcgidProcessLifeTime 0
   FcgidZombieScanInterval 20
   FcgidMaxRequestLen 536870912
   FcgidIOTimeout 120
   FcgidTimeScore 3

   FcgidPassHeader Authorization

   FcgidInitialEnv PHPRC "D:\\PHP5"
   FcgidInitialEnv PATH "D:\\PHP5;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;"
   FcgidInitialEnv SystemRoot "C:\\Windows"
   FcgidInitialEnv SystemDrive "C:"
   FcgidInitialEnv TEMP "C:\\WINDOWS\\TEMP"
   FcgidInitialEnv TMP "C:\\WINDOWS\\TEMP"
   FcgidInitialEnv windir "C:\\WINDOWS"
   <Files ~ "\.php$">
      Options Indexes FollowSymLinks ExecCGI
      AddHandler fcgid-script .php
      FcgidWrapper "D:/PHP5/php-cgi.exe" .php
   </Files>
</IfModule>

  • Finally, add 'index.php' to the "DirectoryIndex" directive in 'httpd.conf' to serve that file:

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
>>>
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

  • If you receive no error, open a command prompt using 'Run as administrator' then navigate to the 'bin' folder of Apache to run Apache as a service. Now, install the service:

D:\Apache24\bin>httpd -k install
Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.

D:\Apache24\bin>net start Apache2.4
The Apache2.4 service is starting.
The Apache2.4 service was started successfully.


D:\Apache24\bin>

  • After that, the service will be automatically restarted every time the server is rebooted.

Download and install latest MariaDB

  • Download the current stable relase of MariaDB - v10.2.8 as of 2017/09/09;
    • Download the "ZIP file" package type for Windows x86_64;
  • Click the 'No thanks, just take me to the download' button if you don't want to be added to their mailing list;
  • Extract the content of this file to the root of your data drive and rename the directory to 'MariaDB';
  • If upgrading, keep a copy of the data directory and copy it back. Then after starting mysql, do: mysql_upgrade -uroot -p See Upgrading from MariaDB 10.1 to MariaDB 10.2

D:\MariaDB>copy my-large.ini my.ini
        1 file(s) copied.

D:\MariaDB>

  • Edit the default MariaDB configuration file ('my.ini') to change socket location:

[client]
socket		= /tmp/mysql.sock
>>>
socket		= C:\Windows\Temp\mysql.sock

[mysqld]
socket		= /tmp/mysql.sock
>>>
socket		= C:\Windows\Temp\mysql.sock

  • Edit the MariaDB configuration file ('my.ini') for Tiki's usage:

max_allowed_packet = 1M
>>>
max_allowed_packet = 128M

+++
character_set_server = utf8

  • Install 'mysqld.exe' as a Windows service using the following:

From the Command Prompt (Admin)
D:\MariaDB\bin>mysqld.exe --install
Service successfully installed.

D:\MariaDB\bin>net start MySQL
The MySQL service is starting...
The MySQL service was started successfully.


D:\MariaDB\bin>

  • After that, the service will be automatically restarted every time the server is rebooted;
  • Assign a password to the root user because by default no password is set:

D:\MariaDB\bin>mysql.exe -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.14-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('new_password');
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> SET PASSWORD FOR 'root'@'::1' = PASSWORD('new_password');
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

D:\MariaDB\bin>

Create a new directory that will be used as "DocumentRoot"

  • Open a command prompt and navigate to 'D:\';
  • Create a 'www' directory that will be used by Apache as "DocumentRoot":

D:\>md www

D:\>

  • Edit the Apache configuration file in 'D:\Apache24\conf\httpd.conf') to enable 'mod_rewrite' and change "DocumentRoot" + "AllowOverride All":

#LoadModule rewrite_module modules/mod_rewrite.so
>>>
LoadModule rewrite_module modules/mod_rewrite.so

DocumentRoot "d:/Apache24/htdocs"
<Directory "d:/Apache24/htdocs">
(...)
    AllowOverride None
>>>
DocumentRoot "d:/www"
<Directory "d:/www">
(...)
    AllowOverride All

  • Restart Apache:

C:\>net stop Apache2.4
The Apache2.4 service is stopping.....
The Apache2.4 service was stopped successfully.


C:\>net start Apache2.4
The Apache2.4 service is starting.
The Apache2.4 service was started successfully.


C:\>

Download and install Adminer

  • Download Adminer - v4.3.1 as of 2017/09/09;
  • Copy the downloaded file to "D:\www\" and rename it to 'adminer.php';
  • NOTE: Adminer will be used later in this documentation.
  • When you are finished, make sure to delete "D:\www\adminer.php".

Download and install TortoiseSVN

  • Download TortoiseSVN - v1.9.7 as of 2017/09/09;
  • Double-click on the '.msi' file to run the setup;
  • Click on the 'Next >' button;
  • Click on the 'Next >' button again;
  • Select 'Will be installed on local hard drive' for the 'command line client tools' feature;
  • Click on the 'Next >' button;
  • Click on the 'Install' button;
  • Click on the 'Finish' button.

Configure TortoiseSVN

  • Add 'svn.exe' to the system's path environmental variable:

C:\>setx PATH "%PATH%;C:\Program Files\TortoiseSVN\bin" /M

SUCCESS: Specified value was saved.

C:\>

Download and install Fake Sendmail (optional)


If you prefer to skip this step, just configure Tiki to use an external SMTP server.

  • Download Fake Sendmail;
  • Copy 'sendmail.exe' and 'sendmail.ini' from the archive into 'D:\usr\lib';
  • Edit 'D:\usr\lib\sendmail.ini' and enter your mail account credentials;
  • Edit 'D:\PHP5\php.ini' to configure the 'sendmail_path':

;sendmail_path =
>>>
sendmail_path = D:\usr\lib\sendmail -t -i

  • Restart Apache:

C:\>net stop Apache2.4
The Apache2.4 service is stopping.....
The Apache2.4 service was stopped successfully.


C:\>net start Apache2.4
The Apache2.4 service is starting.
The Apache2.4 service was started successfully.


C:\>

Download and install Tiki

  • Open a command prompt and navigate to 'D:\www';
  • Download the latest Tiki 17.x from SVN:

D:\www>svn checkout https://svn.code.sf.net/p/tikiwiki/code/branches/17.x .

  • Download Composer
  • Move the 'composer.phar' file to 'D:\www\temp';
  • Install the project dependencies:

cd \www\vendor_bundled
D:\www>php ..\temp\composer.phar install

  • Create a user and database with same name for Tiki using Adminer:
  • Click on the 'Create new database' link;
  • Enter the desired database name and select 'utf8_unicode_ci' for the "collation";
  • Click on the 'Save' button;
  • Click on the 'Privileges' link;
  • Click on the 'Create user' link;
  • Enter the desired "User name" and "Password";
  • Check 'All privileges' and click on the 'Save' button.

  • Initiate the Tiki installation by loading the 'tiki-install.php' script:
  • Click on the 'Continue' button;
  • Click on the 'Continue' button again;
  • Click on the 'Continue' button one more time;
  • Under "Database information" enter the "Database name";
  • Under "Database user" enter the "User name" and its "Password";
  • Click on the 'Continue' button;
  • Select 'InnoDB' for the database engine and click on the 'Install' button;
  • Click on the 'Continue' button.



The installer should either link from .htaccess to _htaccess or copy _htaccess to .htaccess. If this doesn't work, you can do manually:

copy _htaccess .htaccess

Download and install Elasticsearch

From the Command Prompt (Admin)
C:\>setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_91" /M

SUCCESS: Specified value was saved.

C:\>

  • Double-click on the '.exe' file to run the setup;
  • Click on the 'Install >' button;
  • Click on the 'Next >' button;
  • Click on the 'Next >' button again;
  • Click on the 'Close' button;
  • Download Elasticsearch - pick latest stable v5.x
  • Unzip the content to "D:\" and rename the directory to 'Elasticsearch';
  • Open a command prompt then navigate to "D:\Elasticsearch\bin":
  • Install Elasticsearch as a Windows service using the following:

D:\Elasticsearch\bin>elasticsearch-service install
Installing service      :  "elasticsearch-service-x64"
Using JAVA_HOME (64-bit):  "C:\Program Files\Java\jdk1.8.0_91"
The service 'elasticsearch-service-x64' has been installed.

D:\Elasticsearch\bin>elasticsearch-service start
The service 'elasticsearch-service-x64' has been started

D:\Elasticsearch\bin>service manager


Elasticsearch 2.3.3 Service x64

  • Change "Startup type" from 'Manual' to 'Automatic';
  • Click on the 'Apply' button;
  • Click on the 'OK' button.

Successfully started service manager for 'elasticsearch-service-x64'.

D:\Elasticsearch\bin>

Upgrading Elasticsearch

The procedure would be similar to downgrade.

Download new Elasticsearch version and unzip into a folder elasticsearch-new

D:\>cd\Elasticsearch\bin

D:\Elasticsearch\bin>service stop
The service 'elasticsearch-service-x64' has been stopped

D:\Elasticsearch\bin> service remove
The service 'elasticsearch-service-x64' has been removed

D:\Elasticsearch\bin>cd\

D:\>ren Elasticsearch Elasticsearch-old

D:\>ren elasticsearch-new Elasticsearch

D:\>cd Elasticsearch\bin

D:\>Elasticsearch\bin>elastciesearch-service install
Installing service : "elasticsearch-service-x64"
Using JAVA_HOME (64-bit): "C:\Program Files\Java\jdk1.8.0_91"
The service 'elasticsearch-service-x64' has been installed.

D:\Elasticsearch\bin>elasticsearch-service start
The service 'elasticsearch-service-x64' has been started

D:\Elasticsearch\bin>service manager

- Change "Startup type" from 'Manual' to 'Automatic';
- Click on the 'Apply' button;
- Click on the 'OK' button.

Successfully started service manager for 'elasticsearch-service-x64'.

D:\Elasticsearch\bin>

Then, rebuild Tiki index, via command line or web interface


cd \www
php console.php index:rebuild --log

http://127.0.0.1/tiki-admin.php?page=search

- Click on the 'Rebuild Index' button;
- Click on the 'Rebuild' button.

Configure Elasticsearch for use with Tiki

  • Click on the 'Rebuild Index' button;
  • Click on the 'Rebuild' button.

Schedule a task to Rebuild Search Index

  • Open a command prompt using 'Run as administrator' to schedule a daily task:

C:\>md D:\Scripts

C:\>echo pushd D:\www ^& php console.php index:rebuild --log > "D:\Scripts\Rebuild_Search_Index.bat

C:\>schtasks /create /ru SYSTEM /tn "Rebuild Search Index" /tr "D:\Scripts\Rebuild_Search_Index.bat" /sc daily /st 03:00
SUCCESS: The scheduled task "Rebuild Search Index" has successfully been created
.

C:\>


It is necessary to use a batch file to create a scheduled task with multiple actions.

Configure the Windows Firewall to allow access

  • Open TCP port 80 (HTTP) in Windows Firewall:

C:\>netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80
Ok.


C:\>

Performance issues

If you have performance issues (can be related to your specific environment, add the following in your httpd.conf file:

AcceptFilter http none
AcceptFilter https none
EnableMMAP off


To discuss

  • Backup script
  • Monitoring (especially of Elasticsearch)

History

Advanced
Information Version
Marc Laporte Clarify this will need a client 112
View
Marc Laporte [Rollback by marc.laporte to version 109] 111
View
Marc Laporte 110
View
Marc Laporte 109
View
Marc Laporte 108
View
Robert Pouliot 107
View
Marc Laporte Matomo (like Google Analytics) is a tool to get web visitor information using a snippet of JavaScript in each page, and it makes nice stats and reports. In the WikiSuite context, we control the server and all the apps. We will improve our internal reports 106
View
Marc Laporte 105
View
Marc Laporte 104
View
Marc Laporte Page renamed from How to install WikiSuite on Windows to How to install WikiSuite on Windows Server. Semantic alias redirect created 103
View
Marc Laporte 102
View
Marc Laporte 101
View
Marc Laporte 100
View
Marc Laporte 99
View
Robert Pouliot 98
View
Robert Pouliot 97
View
Robert Pouliot 96
View
Robert Pouliot 95
View
Robert Pouliot 94
View
Marc Laporte 93
View
Marc Laporte 92
View
Victor Emanouilov 91
View
Robert Pouliot 90
View
Robert Pouliot 89
View
Robert Pouliot 88
View
Robert Pouliot 87
View
Victor Emanouilov 86
View
Marc Laporte 85
View
Marc Laporte 84
View
Marc Laporte 83
View
Marc Laporte 82
View
Marc Laporte Thanks Robert for the tip about setx 81
View
Marc Laporte 80
View
Marc Laporte not working 79
View
Marc Laporte 78
View
Marc Laporte was missing 77
View
Marc Laporte 76
View
Marc Laporte New version 75
View
Marc Laporte 74
View
Marc Laporte 73
View
Marc Laporte 72
View
Marc Laporte typo 71
View
Robert Pouliot 70
View
Robert Pouliot 69
View
Robert Pouliot 68
View
Robert Pouliot 67
View
Robert Pouliot 66
View
Robert Pouliot 65
View
Robert Pouliot 64
View
Robert Pouliot 63
View