├── tpl ├── server │ ├── logs │ │ └── _dummy │ ├── conf │ │ └── httpd.conf │ └── php │ │ └── php.ini ├── dokuwiki │ └── index.php └── run.cmd ├── .gitignore ├── README.md ├── .github └── workflows │ └── build.yml └── compress.sh /tpl/server/logs/_dummy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | tmp 3 | upx 4 | -------------------------------------------------------------------------------- /tpl/dokuwiki/index.php: -------------------------------------------------------------------------------- 1 |

Copy DokuWiki here

2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Portable Apache Builder for DokuWiki on a Stick 2 | =============================================== 3 | 4 | This is a build script to extract the needed files for a minimal Apache server 5 | with PHP for the use with DokuWiki. It's meant to be run on Linux but builds 6 | a 64 bit Windows version of the server. 7 | 8 | End users are not supposed to run this. Instead chose the "DokuWiki on a Stick" 9 | option at http://download.dokuwiki.org - this is merely a reminder in script 10 | form for the maintainers. 11 | 12 | The script creates the server part only. It needs to be completed by placing 13 | a "dokuwiki" folder in the root dir. 14 | 15 | Note: you can get a Win11 VM directly from Microsoft for testing: 16 | 17 | wget https://aka.ms/windev_VM_virtualbox 18 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: 'build' 2 | 3 | on: [push] 4 | 5 | jobs: 6 | run: 7 | name: 'build' 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v4 12 | - name: Install Prequisites 13 | run: | 14 | export DEBIAN_FRONTEND=noninteractive 15 | sudo apt-get update 16 | sudo apt-get install -y cabextract binutils 17 | - name: Run Build Script 18 | run: ./build.sh 19 | - name: 'Upload artifact' 20 | uses: actions/upload-artifact@v3 21 | with: 22 | name: stickserver 23 | path: out 24 | - name: Run UPX compression 25 | run: ./compress.sh 26 | - name: 'Upload artifact' 27 | uses: actions/upload-artifact@v3 28 | with: 29 | name: stickserver-upx 30 | path: out 31 | -------------------------------------------------------------------------------- /tpl/run.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | goto begin 3 | 4 | :usage 5 | echo Usage: %~n0 6 | echo. 7 | echo Starts DokuWiki on a Stick (http://www.dokuwiki.org/dokuwiki_on_a_stick) 8 | echo and waits for user to press a key to stop. 9 | goto end 10 | 11 | :begin 12 | if not "%1"=="" goto usage 13 | cd server 14 | start "Apache server" /B mapache.exe 15 | echo DokuWiki on a Stick started... 16 | echo. 17 | 18 | :runbrowser 19 | echo Your web browser will now open http://localhost:8800 20 | echo. 21 | if exist ..\dokuwiki\conf\local.php ( 22 | start http://localhost:8800/ 23 | ) else ( 24 | start http://localhost:8800/install.php 25 | ) 26 | 27 | :wait 28 | echo Close this window to stop DokuWiki on a Stick. 29 | echo. 30 | echo If the window does not close you need to force close the Apache server. 31 | echo To force close the server 32 | pause 33 | 34 | :stop 35 | taskkill /im mapache.exe /f /t 36 | echo ... DokuWiki on a Stick stopped. 37 | echo You can close this window now. 38 | 39 | :end 40 | -------------------------------------------------------------------------------- /compress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | UPX_VER=4.1.0 4 | UPX_TAR="https://github.com/upx/upx/releases/download/v${UPX_VER}/upx-${UPX_VER}-amd64_linux.tar.xz" 5 | 6 | # download upx 7 | if [ ! -e "./upx" ]; then 8 | if [ ! -f "tmp/upx.tar.xz" ]; then 9 | wget "$UPX_TAR" -O tmp/upx.tar.xz 10 | fi 11 | if [ -d "tmp/upx" ]; then 12 | rm -rf tmp/upx 13 | fi 14 | cd tmp || exit 15 | tar -xf upx.tar.xz --strip-components=1 upx-$UPX_VER-amd64_linux/upx 16 | cp upx .. 17 | chmod 755 ../upx 18 | cd .. 19 | fi 20 | 21 | if [ $(./upx -V |head -n 1|cut -c 5) != 4 ]; then 22 | echo "UPX version >=4 is needed." 23 | echo "See https://github.com/upx/upx/releases/latest" 24 | exit 1 25 | fi 26 | 27 | if [ ! -d "out" ]; then 28 | echo "out directory not found. run build.sh first" 29 | exit 1 30 | fi 31 | 32 | # compress files 33 | ./upx out/server/*.dll 34 | ./upx out/server/*.exe 35 | ./upx out/server/modules/*.so 36 | ./upx out/server/php/ext/* 37 | 38 | exit 0 39 | 40 | -------------------------------------------------------------------------------- /tpl/server/conf/httpd.conf: -------------------------------------------------------------------------------- 1 | # absolute minimum configuration for DokuWiki on a Stick 2 | # change the Listen directive if you want to use a different port 3 | 4 | Listen 8800 5 | ServerName microapache 6 | ServerRoot . 7 | DocumentRoot ./../dokuwiki 8 | ServerAdmin webmaster@example.com 9 | 10 | # load apache modules 11 | LoadModule access_compat_module modules/mod_access_compat.so 12 | LoadModule authz_core_module modules/mod_authz_core.so 13 | LoadModule dir_module modules/mod_dir.so 14 | LoadModule mime_module modules/mod_mime.so 15 | LoadModule rewrite_module modules/mod_rewrite.so 16 | 17 | # Load PHP module and add handler 18 | LoadModule php_module php/php8apache2_4.dll 19 | AddHandler application/x-httpd-php .php 20 | 21 | # Configure the path to php.ini 22 | PHPIniDir php 23 | 24 | # Increase Stacksize to 8MB but use fewer threads -> 192MB RAM usage 25 | # see Issue #3 26 | 27 | ThreadStackSize 8388608 28 | ThreadsPerChild 24 29 | 30 | 31 | AcceptPathInfo off 32 | KeepAlive on 33 | KeepAliveTimeout 15 34 | TimeOut 30 35 | DirectoryIndex index.html index.php 36 | 37 | # allow .htaccess overrides 38 | 39 | AllowOverride All 40 | 41 | 42 | AllowOverride None 43 | 44 | -------------------------------------------------------------------------------- /tpl/server/php/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | ; Minimal php.ini file, keeps most settings at default 3 | 4 | ; List of timezones supported by PHP https://www.php.net/manual/timezones.php 5 | date.timezone = Europe/Berlin 6 | 7 | max_execution_time = 30 8 | max_input_vars = 1000 9 | memory_limit = 128M 10 | ignore_repeated_errors = Off 11 | ignore_repeated_source = Off 12 | enable_dl = Off 13 | 14 | ; File upload settings 15 | post_max_size = 15M 16 | file_uploads = On 17 | upload_max_filesize = 15M 18 | max_file_uploads = 20 19 | 20 | ; php.ini-production recommends these 21 | short_open_tag = Off 22 | output_buffering = 4096 23 | zend.exception_ignore_args = On 24 | zend.exception_string_param_max_len = 0 25 | max_input_time = 60 26 | ;error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 27 | ;display_errors = Off 28 | ;display_startup_errors = Off 29 | log_errors = On 30 | variables_order = "GPCS" 31 | request_order = "GP" 32 | register_argc_argv = Off 33 | session.gc_divisor = 1000 34 | session.sid_bits_per_character = 5 35 | 36 | ; PHP extension settings 37 | extension_dir = ./php/ext 38 | extension=bz2 39 | extension=ldap 40 | extension=gd 41 | extension=intl 42 | extension=mbstring 43 | extension=openssl 44 | extension=pdo_sqlite 45 | zend_extension=opcache 46 | 47 | ; To avoid errors VirtualProtect() failed [87] Incorrect parameter 48 | ; in apache_error.log. See: 49 | ; https://www.apachelounge.com/viewtopic.php?p=39637#39637 50 | ; https://bugs.php.net/bug.php?id=79751 51 | opcache.jit=off 52 | --------------------------------------------------------------------------------