Loading...
 

History: How to install WikiSuite on Windows Server

Preview of version: 59

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' Windows extensions as recommended by Tiki Check

;extension=php_mbstrings
>>>
extension=php_mbstrings.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 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.1.14 as of 2016/06/21;
    • 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';

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 and install TortoiseSVN

  • Download TortoiseSVN - v1.9.4 as of 2016/06/16;
  • 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 15.x from SVN:

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

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

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
Robert Pouliot 62
View
Robert Pouliot 61
View
Robert Pouliot 60
View
Robert Pouliot 59
View
Robert Pouliot 58
View
Robert Pouliot 57
View
Robert Pouliot 56
View
Robert Pouliot 55
View
Marc Laporte 54
View
Marc Laporte 53
View
Marc Laporte 52
View
Marc Laporte Upgrading Elasticsearch 51
View
Marc Laporte 50
View
Marc Laporte Forget about Elasticsearch 1.x 49
View
Marc Laporte Adding logging 48
View
Marc Laporte Thanks Dylan! 47
View
Marc Laporte 46
View
Marc Laporte 45
View
eric.beaurivage 44
View
Marc Laporte 43
View
Marc Laporte 42
View
Marc Laporte Thank you Jonny Bradley for this information! 41
View
Marc Laporte copy _htaccess .htaccess 40
View
Marc Laporte it's is used when a shorter version of it is 39
View
Marc Laporte display errors 38
View
Marc Laporte php_mbstrings for Tiki Check 37
View
Marc Laporte Code Plugin modified by editor. 36
View
eric.beaurivage Enable 'mod_rewrite' and "AllowOverride All" for '.htaccess' 35
View
eric.beaurivage Finally, add 'index.php' to the "DirectoryIndex" directive in 'httpd.conf' to serve that file 34
View
eric.beaurivage 33
View
eric.beaurivage Configure the 'session.save_path' in order to use PHP's session functions 32
View
Marc Laporte My bad 31
View
Marc Laporte typo 30
View
Marc Laporte This happened to me, and this worked for me 29
View
Marc Laporte Thanks Eric! 28
View
eric.beaurivage 27
View
eric.beaurivage 26
View
eric.beaurivage 25
View
Marc Laporte Indicate usual location 24
View
Marc Laporte also needed 23
View
Marc Laporte This was needed on mine 22
View
eric.beaurivage Configure Elasticsearch for use with Tiki 21
View
eric.beaurivage Running Elasticsearch as a Windows service 20
View
eric.beaurivage Use 'D:\www' only for "DocumentRoot" 19
View
eric.beaurivage Replace 'D:\Apache24' for 'D:\www' and minor adjustments 17
View
Marc Laporte Admin rights needed here as well 16
View
Marc Laporte Code Plugin modified by editor. 15
View
Marc Laporte 14
View
Marc Laporte Looks like Eric decided already :-) 13
View
Marc Laporte 12
View