Apache Konfiguration VirtualHost

Hilfe zu OTRS Problemen aller Art
Post Reply
andreasotrs
Znuny newbie
Posts: 80
Joined: 20 Dec 2012, 16:13
Znuny Version: 3.3.9

Apache Konfiguration VirtualHost

Post by andreasotrs »

Hallo,

ich möchte gerne OTRS auf einem Server aktivierten auf dem auch andere Webapplikationen sind. D.h. OTRS soll einen eigenen virtuelle Namen bzw. DNS haben.
Leider ist mir nicht klar, wie ich nun mit der Datei zzz_otrs.conf umgehen muss.

In der Datei /etc/httpd/conf/httpd.conf wird angegeben, dass Apache unter Konfigurationsdateien in conf.d einlesen soll
Include conf.d/*.conf

In dem Verzeichnis /etc/httpd/conf.d liegen die Konfigurationsdateien für die einzelnen Webapplikationen. Dort liegt auch die OTRS Datei zzz_otrs.conf.
Kann ich den Definiationsdatei für den VirtualHost in die zzz_otrs.conf Datei schreiben oder benötige ich eine weitere Datei?
Die VirtualHost Konfiguration sieht etwa so aus:

Code: Select all

Listen *:4443
<VirtualHost *:4443>
	DocumentRoot /opt/otrs
	ServerName tsb.abc.de
	ServerAdmin unix@abc.de

	<Directory "/opt/otrs">
		Options Indexes FollowSymLinks
		AllowOverride None
		Order allow,deny
		Allow from all
		DirectoryIndex index.php
	</Directory>

</VirtualHost>
Kann mir bitte jemand helfen?

OTRS Version 3.2.2 wird auf Red Hat Linux 5.5 genutzt.
Mit freundlichem Gruß
Andreas

OTRS Prod 4.0.6
OTRS Test 4.0.6
Red Hat Linux 6.1
DB MySQL
Yabba
Znuny newbie
Posts: 64
Joined: 17 Mar 2011, 12:07
Znuny Version: 3.1.7
Real Name: Michael Kohn

Re: Apache Konfiguration VirtualHost

Post by Yabba »

Wer auch immer die conf erstellt halt, damit bekommst du OTRS nicht ans laufen ;-)

Schau dir mal /opt/otrs/scripts/apache2-httpd.include.conf an...

Diese entweder als Vorlage nehmen oder in der vhost-Konfiguration des Apache includen.
OTRS 3.3.6 / FAQ 2.3.3 / ImportExport 3.3.5 / SystemMonitoring 2.5.3 / Support 1.5.4
OS: Debian 7 Wheezy / DB: MySQL 5.5 / Webserver: Apache 2.2
andreasotrs
Znuny newbie
Posts: 80
Joined: 20 Dec 2012, 16:13
Znuny Version: 3.3.9

Re: Apache Konfiguration VirtualHost

Post by andreasotrs »

Jetzt habe ich die im oberen Bereich der zzz_otrs.conf Datei den Beginn vom VirtualHost eingebaut.

Code: Select all

# --
# added for OTRS (http://otrs.org/)
# $Id: apache2-httpd.include.conf,v 1.27 2013/01/04 13:03:06 mg Exp $
# --

Listen *:80
<VirtualHost *:80>
   ServerName tsb.abc.de
   ServerAdmin unix@abc.de
ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"

# activate this if you are using an Oracle database
#SetEnv ORACLE_HOME /path/to/your/oracle/
#SetEnv ORACLE_SID YOUR_SID
#SetEnv NLS_LANG AMERICAN_AMERICA.UTF8
#SetEnv NLS_DATE_FORMAT 'YYYY-MM-DD HH24:MI:SS'

<IfModule mod_perl.c>
....
</IfModule>

<Directory "/opt/otrs/bin/cgi-bin/">
...
</Directory>

<Directory "/opt/otrs/var/httpd/htdocs/">
...
</Directory>

<IfModule mod_headers.c>
...
</IfModule>
# Limit the number of requests per child to avoid excessive memory usage
MaxRequestsPerChild 4000
</VirtualHost>
/etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: Syntax error on line 87 of /etc/httpd/conf.d/zzz_otrs.conf:
MaxRequestsPerChild cannot occur within <VirtualHost> section
[FAILED]

Dann habe ich das MaxRequestsPerChild 4000 auskommentiert und jetzt startet der Apache, aber ich bekomme noch keine Verbindung zum OTRS.
Ist das MaxRequestsPerChild 4000 wichtig? Wohin kann ich das setzen?
Mit freundlichem Gruß
Andreas

OTRS Prod 4.0.6
OTRS Test 4.0.6
Red Hat Linux 6.1
DB MySQL
Yabba
Znuny newbie
Posts: 64
Joined: 17 Mar 2011, 12:07
Znuny Version: 3.1.7
Real Name: Michael Kohn

Re: Apache Konfiguration VirtualHost

Post by Yabba »

Hi,

MaxRequestsPerChild 4000 einfach außerhalb des <VirtualHost> Containers setzen - wofür es gut ist, steht ja in der Kommentarzeile ;-)

Warum du keine Verbindung bekommst? Tja - kann viele Ursachen haben... Bekommst du eine Fehlermeldung? Gibt es Logeinträge vom Apache,
wenn du versuchst http://tsb.abc.de/otrs/index.pl aufzurufen?
Dann habe ich das MaxRequestsPerChild 4000 auskommentiert und jetzt startet der Apache, aber ich bekomme noch keine Verbindung zum OTRS.
Ist das MaxRequestsPerChild 4000 wichtig? Wohin kann ich das setzen?
OTRS 3.3.6 / FAQ 2.3.3 / ImportExport 3.3.5 / SystemMonitoring 2.5.3 / Support 1.5.4
OS: Debian 7 Wheezy / DB: MySQL 5.5 / Webserver: Apache 2.2
andreasotrs
Znuny newbie
Posts: 80
Joined: 20 Dec 2012, 16:13
Znuny Version: 3.3.9

Re: Apache Konfiguration VirtualHost

Post by andreasotrs »

mit der folgenden zzz_otrs.conf Datei funktioniert der VirtualHost

Code: Select all

# --
# added for OTRS (http://otrs.org/)
# $Id: apache2-httpd.include.conf,v 1.27 2013/01/04 13:03:06 mg Exp $
# --
Listen *:6443
<VirtualHost *:6443>
#    DocumentRoot /opt/otrs/bin/cgi-bin/
    ServerName tsb.abc.de
    ServerAlias tsb
	ServerAdmin unix@abc.de
	ErrorLog /var/log/httpd/otrs_errors
	CustomLog /var/log/httpd/otrs_access common

ScriptAlias /otrs "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"

# activate this if you are using an Oracle database
#SetEnv ORACLE_HOME /path/to/your/oracle/
#SetEnv ORACLE_SID YOUR_SID
#SetEnv NLS_LANG AMERICAN_AMERICA.UTF8
#SetEnv NLS_DATE_FORMAT 'YYYY-MM-DD HH24:MI:SS'

<IfModule mod_perl.c>

    # Setup environment and preload modules
    Perlrequire /opt/otrs/scripts/apache2-perl-startup.pl

    # Reload Perl modules when changed on disk
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload

    # general mod_perl2 options
    <Location /otrs>
#        ErrorDocument 403 /otrs/customer.pl
        ErrorDocument 403 /otrs/index.pl
        SetHandler  perl-script
        PerlResponseHandler ModPerl::Registry
        Options +ExecCGI
        PerlOptions +ParseHeaders
        PerlOptions +SetupEnv
        Order allow,deny
        Allow from all
    </Location>

    # mod_perl2 options for GenericInterface
    <Location /otrs/nph-genericinterface.pl>
        PerlOptions -ParseHeaders
    </Location>

</IfModule>

<Directory "/opt/otrs/bin/cgi-bin/">
    AllowOverride None
    Options +ExecCGI -Includes
    Order allow,deny
    Allow from all

    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/javascript text/css text/xml application/json text/json
    </IfModule>
</Directory>

<Directory "/opt/otrs/var/httpd/htdocs/">
    AllowOverride None
    Order allow,deny
    Allow from all

    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/javascript text/css text/xml application/json text/json
    </IfModule>
</Directory>

<IfModule mod_headers.c>
    <Directory "/opt/otrs/var/httpd/htdocs/skins/*/*/css-cache">
        <FilesMatch "\.(css|CSS)$">
            Header set Cache-Control "max-age=2592000 must-revalidate"
        </FilesMatch>
    </Directory>

    <Directory "/opt/otrs/var/httpd/htdocs/js/js-cache">
        <FilesMatch "\.(js|JS)$">
            Header set Cache-Control "max-age=2592000 must-revalidate"
        </FilesMatch>
    </Directory>
</IfModule>

</VirtualHost>

# Limit the number of requests per child to avoid excessive memory usage
MaxRequestsPerChild 4000
Mit freundlichem Gruß
Andreas

OTRS Prod 4.0.6
OTRS Test 4.0.6
Red Hat Linux 6.1
DB MySQL
Post Reply