Author Topic: [Solved] Customizing von Nginx Webserver in Zentyal 4.0  (Read 6958 times)

c.monty

  • Zen Apprentice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
[Solved] Customizing von Nginx Webserver in Zentyal 4.0
« 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
  • a) diverse Subdomains nutzen
  • b) die Nginx-Konfigurationsdatei nginx.conf modifizieren

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
« Last Edit: January 24, 2015, 11:10:49 am by c.monty »

julio

  • Guest
Re: [Q] Customizing von Nginx Webserver in Zentyal 4.0
« Reply #1 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
« Last Edit: January 21, 2015, 01:04:30 pm by julio »

c.monty

  • Zen Apprentice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: [Q] Customizing von Nginx Webserver in Zentyal 4.0
« Reply #2 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
« Last Edit: January 21, 2015, 03:19:59 pm by c.monty »

RAB

  • Zen Apprentice
  • *
  • Posts: 42
  • Karma: +2/-0
    • View Profile
Re: [Solved] Customizing von Nginx Webserver in Zentyal 4.0
« Reply #3 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 ...
« Last Edit: May 13, 2015, 02:28:31 pm by RAB »

aarcos

  • Zen Apprentice
  • *
  • Posts: 20
  • Karma: +1/-0
    • View Profile
Re: [Solved] Customizing von Nginx Webserver in Zentyal 4.0
« Reply #4 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