From: Sarah Hoffmann Date: Wed, 13 May 2020 08:13:15 +0000 (+0200) Subject: improve syntax highlighting for apache and nginx examples X-Git-Tag: v3.5.0~13 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/124410a17bbe1bfdd744d6a832be0870f260a8b0?ds=inline;hp=--cc improve syntax highlighting for apache and nginx examples --- 124410a17bbe1bfdd744d6a832be0870f260a8b0 diff --git a/docs/admin/Import-and-Update.md b/docs/admin/Import-and-Update.md index 0d1bb027..47516a2b 100644 --- a/docs/admin/Import-and-Update.md +++ b/docs/admin/Import-and-Update.md @@ -319,4 +319,4 @@ behind the scenes.) If you have imported multiple country extracts and want to keep them up-to-date, [Advanced installations section](Advanced-Installations.md) contains instructions -to set up and update multiple country extracts. \ No newline at end of file +to set up and update multiple country extracts. diff --git a/docs/admin/Installation.md b/docs/admin/Installation.md index 98cfe573..f3f54794 100644 --- a/docs/admin/Installation.md +++ b/docs/admin/Installation.md @@ -125,13 +125,15 @@ from there. Make sure your Apache configuration contains the required permissions for the directory and create an alias: - - Options FollowSymLinks MultiViews - AddType text/html .php - DirectoryIndex search.php - Require all granted - - Alias /nominatim /srv/nominatim/build/website +``` apache + + Options FollowSymLinks MultiViews + AddType text/html .php + DirectoryIndex search.php + Require all granted + +Alias /nominatim /srv/nominatim/build/website +``` `/srv/nominatim/build` should be replaced with the location of your build directory. @@ -159,30 +161,32 @@ follows: Tell nginx that php files are special and to fastcgi_pass to the php-fpm unix socket by adding the location definition to the default configuration. - root /srv/nominatim/build/website; - index search.php; - location / { - try_files $uri $uri/ @php; - } - - location @php { - fastcgi_param SCRIPT_FILENAME "$document_root$uri.php"; - fastcgi_param PATH_TRANSLATED "$document_root$uri.php"; - fastcgi_param QUERY_STRING $args; - fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; - fastcgi_index index.php; - include fastcgi_params; - } - - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - if (!-f $document_root$fastcgi_script_name) { - return 404; - } - fastcgi_pass unix:/var/run/php7.3-fpm.sock; - fastcgi_index search.php; - include fastcgi.conf; +``` nginx +root /srv/nominatim/build/website; +index search.php; +location / { + try_files $uri $uri/ @php; +} + +location @php { + fastcgi_param SCRIPT_FILENAME "$document_root$uri.php"; + fastcgi_param PATH_TRANSLATED "$document_root$uri.php"; + fastcgi_param QUERY_STRING $args; + fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; +} + +location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + if (!-f $document_root$fastcgi_script_name) { + return 404; } + fastcgi_pass unix:/var/run/php7.3-fpm.sock; + fastcgi_index search.php; + include fastcgi.conf; +} +``` Restart the nginx and php5-fpm services and the website should now be available at `http://localhost/`.