Zentyal Forum, Linux Small Business Server

International => German => Topic started by: c.monty on January 21, 2015, 10:31:47 am

Title: [Solved] Customizing von Nginx Webserver in Zentyal 4.0
Post by: c.monty on January 21, 2015, 10:31:47 am
Hallo!

Was ist zu tun, um den Nginx Webserver in Zentyal 4.0 zu customizen?
Ich möchte

Die Nginx-Konfigdatei wird mittels eines Templates nach Restart immer neu in /var/lib/zentyal/conf/nginx.conf geschrieben, d.h. jede Änderung in dieser Datei ist nach einem Restart verloren.
Ohne Modifikation dieser Datei ist es aber unmöglich, ein Subdomain zu definieren.

Aus meiner Sicht wäre es ausreichend, Zentyal so zu modifizieren, dass der Webserver Nginx nicht automatisch mit der Konfig-Datei /var/lib/zentyal/conf/nginx.conf gestartet wird, sondern stattdessen Nginx ganz normal durch den Systemstart aufgerufen wird und dann die default Konfig-Datei /etc/nginx/nginx.conf verwendet.

Deshalb meine Frage:
Wie kann ich unterbinden, dass Zentyal den Webserver Nginx startet?

THX
Title: Re: [Q] Customizing von Nginx Webserver in Zentyal 4.0
Post by: julio on January 21, 2015, 01:01:12 pm
Hallo,

du kannst im "/etc/nginx/nginx.conf" eigene Parameters hinzufügen:
Code: [Select]
sudo mkdir /etc/zentyal/stubs/core
sudo cp /usr/share/zentyal/stubs/core/nginx.conf.mas /etc/zentyal/stubs/core/nginx.conf.mas

alle Änderungen im "/etc/zentyal/stubs/core/nginx.conf.mas" machen,
nach Änderungen, webadmin neustarten:
Code: [Select]
sudo services zentyal webadmin restart
Title: Re: [Q] Customizing von Nginx Webserver in Zentyal 4.0
Post by: c.monty on January 21, 2015, 01:59:12 pm
Hallo!

Endlich ein nützlicher Hinweis, mit dem man weiterkommt!

Frage:
Könntest du mir bitte zusätzliche Informationen geben, was unter dem "stubs" Konzept zu verstehen ist?
Wie ist dieses konfiguriert?
Warum reicht es aus, von /usr/share/zentyal/stubs/core nach /etc/zentyal/stubs/core zu kopieren?
Wird das Verzeichnis /etc/zentyal/stubs/core mit Vorrang gelesen?

THX

Update:
Hab etwas im Wiki gefunden zu "stubs"
https://wiki.zentyal.org/wiki/En/3.5/Development_and_advanced_configuration (https://wiki.zentyal.org/wiki/En/3.5/Development_and_advanced_configuration)
Title: Re: [Solved] Customizing von Nginx Webserver in Zentyal 4.0
Post by: RAB on May 13, 2015, 12:05:34 pm
Used this in an attempt  to solve the nginx 504 timeout issue and it seems to be successful.

First create the stub (see above).
then:
# nano /etc/zentyal/stubs/core/nginx.conf.mas

What seemed to work is to insert the lines

Code: [Select]
proxy_read_timeout 300;
uwsgi_read_timeout 300;

in the http context (look for the section below):

Code: [Select]
http {

    ##
    # Basic Settings
    ##

    # 20150513 Attempt to prevent nginx 504 timeout WSOD error in webadmin
    # http://howtounix.info/howto/110-connection-timed-out-error-in-nginx
    # http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout
    proxy_read_timeout 300;
    # http://stackoverflow.com/questions/14167910/nginx-and-mysql-timeout-upstream-timed-out-110-connection-timed-out
    # http://nginx.org/en/docs/http/ngx_http_uwsgi_module.html#uwsgi_read_timeout
    uwsgi_read_timeout 300;

    sendfile on;
    tcp_nopush on;

And finally restart webadmin:

# service zentyal webadmin stop
# service zentyal webadmin start

Note that after succesfull stop "service zentyal webadmin status" shows [RUNNING] - the webadmin does no longer respond however.

I have not seen 504's anymore since ...
Title: Re: [Solved] Customizing von Nginx Webserver in Zentyal 4.0
Post by: aarcos on July 02, 2021, 05:38:15 pm
Hi

I hope you are well,

Thanks for this post !!! After 6 year in production showed up this problem.

Best