-
Notifications
You must be signed in to change notification settings - Fork 163
Home
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
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
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.
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 -S localhost:8000 genghis.php