Frage

Ich leite Drupal in einem Intranet, das sich hinter einem einfachen HTTP -Proxy befindet. Ich möchte, dass das Modul- und Kern -Update -Checks tatsächlich funktioniert.

Ich erinnere mich, dass es einen Kernhack gab, der dies auf Drupal 6 gemacht hat, aber ich kann die Seite nicht mehr finden.

Weiß jemand, wie ich das zum Laufen bringen kann?

War es hilfreich?

Lösung

Eine unserer Firmeninstallationen hatte einen Forward -Proxy, der den direkten Zugriff ins Internet verhinderte. Wir haben am Ende Core mit "The Proxy Patch" gepatcht (so genannt, weil dieses Problem seit 2004 geöffnet ist. http://drupal.org/node/7881).

http://drupal.org/node/7881#comment-4134240 - hat einen Patch für Drupal 7http://drupal.org/node/7881#comment-2446280 - hat einen Patch für Drupal 6

Sobald das Patch installiert ist, können Sie Drupal_Http_request () ändern, um alle Abfragen über den Proxy zu senden.

Auf diese Weise funktionieren alle Module, die Zugriff auf das Internet erfordern, wie erwartet, z. B. Statue, Aggregator, OpenID usw.

AKTUALISIEREN: Der Patch ist bereits in Drupal 7 -Kofferraum zusammengeführt ( https://drupal.org/comment/6425278#comment-6425278 ), und hoffentlich wird Drupal 7.16 draußen sein

Andere Tipps

Als Referenz ist dies die Syntax, die Sie jetzt in Drupal verwenden können, um sie so zu konfigurieren, dass sie hinter einem Proxy ausgeführt werden (von default.Settings.php/7):

/**
 * External access proxy settings:
 *
 * If your site must access the Internet via a web proxy then you can enter
 * the proxy settings here. Currently only basic authentication is supported
 * by using the username and password variables. The proxy_user_agent variable
 * can be set to NULL for proxies that require no User-Agent header or to a
 * non-empty string for proxies that limit requests to a specific agent. The
 * proxy_exceptions variable is an array of host names to be accessed directly,
 * not via proxy.
 */
# $conf['proxy_server'] = '';
# $conf['proxy_port'] = 8080;
# $conf['proxy_username'] = '';
# $conf['proxy_password'] = '';
# $conf['proxy_user_agent'] = '';
# $conf['proxy_exceptions'] = array('127.0.0.1', 'localhost');

Dafür gibt es ein Modul

Es ist derzeit nur Drupal 6, sollte aber einen guten Ausgangspunkt bieten.

Für die Auflösung von PBS -Staging -PBS arbeite ich lokal mit dem Namen Real Production Domain, aber hinter einem Proxy, sodass die Drupal -Installation und die Webserverkonfiguration streng identisch sind (bei einigen Confs kann das IP -Hören unterschiedlich sein, je nach Hör -IP in der Hör -IP in Produktion).

Also hatte ich einen Proxy, auf den ich antwortete http: //mydomain.local, stellend zu http: //www.mydomain.tld, aber auf einer lokalen IP.

Whith nginx, in lokaler Vhost Conf:

server_name  mydomain.local;
set $proxied_server_name www.mydomain.tld;
set $proxied_cookie_domain mydomain.tld;

# then generic proxy conf
proxy_set_header Host              $proxied_server_name;
proxy_set_header X-Real-IP         $remote_addr;
proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;

# My param added for drupal absolute url construction
proxy_set_header X-Proxy-Host      $host;               

# For headers rewriting (Location or Refresh)
proxy_redirect   http://$proxied_server_name/ http://$host/;

proxy_cookie_domain $proxied_server_name $host;  
# and for drupal auth, with cookies without sub-domain
proxy_cookie_domain $proxied_cookie_domain $host;

Für den stellvertretenden Vhost, genau wie in der Produktion

server_name  www.mydomain.tld;

Und in meinen Einstellungen.php

if (isset($_SERVER['HTTP_X_PROXY_HOST'])) {
  $base_url = 'http://' .$_SERVER['HTTP_X_PROXY_HOST'];
}

Mit diesem Conf kann ich alle Drupal -Dateien und Datenbank- und Serverkonfiguration zwischen einer Menge Drupal -Installation synchronisieren (Dev und Produktion in meinem Fall, aber möglicherweise alles, was Sie wollen).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit drupal.stackexchange
scroll top