[aur-dev] [PATCH] Improve INSTALL details for nginx and config.
Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com> --- INSTALL | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/INSTALL b/INSTALL index 9040c17..d78740a 100644 --- a/INSTALL +++ b/INSTALL @@ -6,14 +6,41 @@ Setup on Arch Linux $ cd /srv/http/ $ git clone git://projects.archlinux.org/aurweb.git -2) Setup a web server with PHP and MySQL. Configure the web server to redirect - all URLs to /index.php/foo/bar/. The following block can be used with nginx: - - location ~ .* { - rewrite ^/(.*)$ /index.php/$1 last; +2) Setup a web server with PHP support and MySQL. Configure the web server + to redirect all URLs to /index.php/foo/bar/. For nginx a working setup + could be: + + http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + server_name localhost; + error_log /var/log/nginx/aurweb.error.log notice; + location ~ ^/[^/]+\.php($|/) { + fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; + fastcgi_index index.php; + fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + include fastcgi_params; + } + location ~ .* { + rewrite ^/(.*)$ /index.php/$1 last; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } + root /srv/http/aurweb/web/html; + index index.php index.html index.htm; } -3) Copy conf/config.proto to conf/config and adjust the configuration. +3) Copy conf/config.proto to conf/config and adjust the configuration (pay + attention on disable_http_login, enable_maintenance and aur_location) 4) Create a new MySQL database and a user and import the AUR SQL schema: -- 2.4.3
On Tue, 16 Jun 2015 at 23:29:22, Leonidas Spyropoulos wrote:
Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com> --- INSTALL | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-)
diff --git a/INSTALL b/INSTALL index 9040c17..d78740a 100644 --- a/INSTALL +++ b/INSTALL @@ -6,14 +6,41 @@ Setup on Arch Linux $ cd /srv/http/ $ git clone git://projects.archlinux.org/aurweb.git
-2) Setup a web server with PHP and MySQL. Configure the web server to redirect - all URLs to /index.php/foo/bar/. The following block can be used with nginx: - - location ~ .* { - rewrite ^/(.*)$ /index.php/$1 last; +2) Setup a web server with PHP support and MySQL. Configure the web server + to redirect all URLs to /index.php/foo/bar/. For nginx a working setup + could be: + + http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + server_name localhost; + error_log /var/log/nginx/aurweb.error.log notice; + location ~ ^/[^/]+\.php($|/) { + fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; + fastcgi_index index.php; + fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + include fastcgi_params; + } + location ~ .* { + rewrite ^/(.*)$ /index.php/$1 last; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } + root /srv/http/aurweb/web/html; + index index.php index.html index.htm;
This example configuration makes it hard to add other server blocks. I'd rather keep the introductory text and replace the location block with a server block that might look as follows: server { listen 80; server_name aur.local aur; root /srv/http/aurweb/web/html; index index.php; location ~ ^/[^/]+\.php($|/) { fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; } location ~ .* { rewrite ^/(.*)$ /index.php/$1 last; } } What do you think?
}
-3) Copy conf/config.proto to conf/config and adjust the configuration. +3) Copy conf/config.proto to conf/config and adjust the configuration (pay + attention on disable_http_login, enable_maintenance and aur_location)
s/attention on/attention to/? Also, there is a missing full stop at the end of the sentence.
4) Create a new MySQL database and a user and import the AUR SQL schema:
-- 2.4.3
* Lukas Fleischer <lfleischer@archlinux.org> (Wed, 17 Jun 2015 10:26:38 +0200):
This example configuration makes it hard to add other server blocks. I'd rather keep the introductory text and replace the location block with a server block that might look as follows:
server { listen 80; server_name aur.local aur;
root /srv/http/aurweb/web/html; index index.php;
Ah! I thought you said that these lines should be outside of the server block, but this is much better!
location ~ ^/[^/]+\.php($|/) { fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params;
[How do I tell my email client to not wrap lines in case of patches? (In normal cases, it definitely should!)]
}
location ~ .* { rewrite ^/(.*)$ /index.php/$1 last; } }
What do you think?
Looks neater to me, less clutter. But shouldn't we at least add a line like error_log /var/log/nginx/aurweb.error.log notice; without it, I didn't get an error log at all and it's hard to debug things without one.
On Wed, 17 Jun 2015 at 13:07:50, Marcel Korpel wrote:
* Lukas Fleischer <lfleischer@archlinux.org> (Wed, 17 Jun 2015 10:26:38 +0200): [...] Ah! I thought you said that these lines should be outside of the server block, but this is much better!
No, just outside the location block.
[...] Looks neater to me, less clutter. But shouldn't we at least add a line like
error_log /var/log/nginx/aurweb.error.log notice;
without it, I didn't get an error log at all and it's hard to debug things without one.
Is that really needed? The default path for error logs is /var/log/nginx/error.log. I prefer a minimal working example...
* Lukas Fleischer <lfleischer@archlinux.org> (Wed, 17 Jun 2015 13:43:36 +0200):
Looks neater to me, less clutter. But shouldn't we at least add a line like
error_log /var/log/nginx/aurweb.error.log notice;
without it, I didn't get an error log at all and it's hard to debug things without one.
Is that really needed? The default path for error logs is /var/log/nginx/error.log. I prefer a minimal working example...
Agreed, but I didn't get that one at first. Hmm, I now see a DOMAINNAME.error.log, but it only contains one line, whereas I remember I had several issues at first. Nope, I just created an error when there was no error_log line in nginx.conf, but I don't get a log. Unrelated detail: the commit message ends with a full stop.
participants (3)
-
Leonidas Spyropoulos
-
Lukas Fleischer
-
Marcel Korpel