mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 13:24:07 +00:00
improve syntax highlighting for apache and nginx examples
This commit is contained in:
@@ -125,13 +125,15 @@ from there.
|
|||||||
Make sure your Apache configuration contains the required permissions for the
|
Make sure your Apache configuration contains the required permissions for the
|
||||||
directory and create an alias:
|
directory and create an alias:
|
||||||
|
|
||||||
<Directory "/srv/nominatim/build/website">
|
``` apache
|
||||||
Options FollowSymLinks MultiViews
|
<Directory "/srv/nominatim/build/website">
|
||||||
AddType text/html .php
|
Options FollowSymLinks MultiViews
|
||||||
DirectoryIndex search.php
|
AddType text/html .php
|
||||||
Require all granted
|
DirectoryIndex search.php
|
||||||
</Directory>
|
Require all granted
|
||||||
Alias /nominatim /srv/nominatim/build/website
|
</Directory>
|
||||||
|
Alias /nominatim /srv/nominatim/build/website
|
||||||
|
```
|
||||||
|
|
||||||
`/srv/nominatim/build` should be replaced with the location of your
|
`/srv/nominatim/build` should be replaced with the location of your
|
||||||
build directory.
|
build directory.
|
||||||
@@ -159,30 +161,32 @@ follows:
|
|||||||
Tell nginx that php files are special and to fastcgi_pass to the php-fpm
|
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.
|
unix socket by adding the location definition to the default configuration.
|
||||||
|
|
||||||
root /srv/nominatim/build/website;
|
``` nginx
|
||||||
index search.php;
|
root /srv/nominatim/build/website;
|
||||||
location / {
|
index search.php;
|
||||||
try_files $uri $uri/ @php;
|
location / {
|
||||||
}
|
try_files $uri $uri/ @php;
|
||||||
|
}
|
||||||
|
|
||||||
location @php {
|
location @php {
|
||||||
fastcgi_param SCRIPT_FILENAME "$document_root$uri.php";
|
fastcgi_param SCRIPT_FILENAME "$document_root$uri.php";
|
||||||
fastcgi_param PATH_TRANSLATED "$document_root$uri.php";
|
fastcgi_param PATH_TRANSLATED "$document_root$uri.php";
|
||||||
fastcgi_param QUERY_STRING $args;
|
fastcgi_param QUERY_STRING $args;
|
||||||
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
if (!-f $document_root$fastcgi_script_name) {
|
if (!-f $document_root$fastcgi_script_name) {
|
||||||
return 404;
|
return 404;
|
||||||
}
|
|
||||||
fastcgi_pass unix:/var/run/php7.3-fpm.sock;
|
|
||||||
fastcgi_index search.php;
|
|
||||||
include fastcgi.conf;
|
|
||||||
}
|
}
|
||||||
|
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
|
Restart the nginx and php5-fpm services and the website should now be available
|
||||||
at `http://localhost/`.
|
at `http://localhost/`.
|
||||||
|
|||||||
Reference in New Issue
Block a user