Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
Oliver Dunk edited this page Dec 24, 2015 · 11 revisions

Apache configuration

Use the supplied .htaccess file, or add this to your Apache virtual host config:

<IfModule mod_rewrite.c>
    RewriteEngine On
    # RewriteBase /genghis

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule (.*) genghis.php/$1 [L,QSA]
</IfModule>

Uncomment and update the RewriteBase directive if you're serving Genghis from a subdirectory.

If you're authenticating against a database, Apache has trouble with URL encoded slashes by default. Work around this by setting AllowEncodedSlashes to NoDecode in your server or virtual host config:

AllowEncodedSlashes NoDecode

Apache 2.4 configuration

add /etc/httpd/conf.d/genghis.conf with this content:

Alias /genghis /home/sergio/genghis
<Directory /home/sergio/genghis>
    DirectoryIndex genghis.php
    Require all granted
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /genghis

        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule (.*) genghis.php/$1 [L,QSA]
    </IfModule>
</Directory>

change /home/sergio with directory that owns genghis.php

nginx configuration

server {
    root /var/www/genghis;

    location / {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root/genghis.php;
        fastcgi_param SCRIPT_NAME /genghis.php;
        fastcgi_param PATH_INFO $uri;

        rewrite /genghis.php / permanent;
    }
}

Replace root with the path to your genghis directory, and replace the fastcgi_pass with your own socket or host:port.

nginx subdirectory configuration

server {
    location /subdirectory {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        include fastcgi_params;

        fastcgi_split_path_info ^/(subdirectory)(/?.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root/subdirectory/genghis.php;
        fastcgi_param SCRIPT_NAME /subdirectory/genghis.php;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

Replace the fastcgi_pass with your own socket or host:port, and replace all instances of subdirectory with the name of the folder your Genghis installation is in.

PHP 5.4 built-in web server

php -S localhost:8000 genghis.php