zwei fragen

Allgemein Fragen, deutsche News, Ankündigungen & Events zum OTRS
Post Reply
lefson
Znuny newbie
Posts: 1
Joined: 21 Jul 2017, 09:15
Znuny Version: 5s PL21

zwei fragen

Post by lefson »

Hallo guten morgen.

Ich hab hier zwei fälle die mir grade ganz schön Kopfzerbrechen bereiten. Aktuell nutzen wir noch eine alte 3er Version die jetzt auf 5s aktualisiert werden soll. In dem Zuge soll auch die Adresse von www.domain.com/otrs/ auf otrs.domain.com geändert werden. Meine Fragen sind daher:

1.) wie bekomme ich OTRS in eine Subdomain
2.) wenn es in einer Subdomain ist, wie kann ich OTRS so ändern dass /otrs/index.pl nicht angezeigt wird.

Bisher hab ich versucht die Config in eine vhost zu quetschen aber irgendwie funktioniert das nicht

Code: Select all

<VirtualHost *:80>
        ServerAdmin otrs@gurkenland.space
        ServerName otrs.gurkenland.space
        ServerAlias otrs.gurkenland.space

        DocumentRoot /var/www/blog/
        ServerSignature on

        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/blog-access.log combined
        ErrorLog ${APACHE_LOG_DIR}/blog-error.log

        RewriteEngine On
        RewriteRule ^ otrs.gurkenland.space%{REQUEST_URI} [R=301,L]
</VirtualHost>

<VirtualHost *:443>
        ServerAdmin otrs@gurkenland.space
        ServerName otrs.gurkenland.space
        ServerAlias otrs.gurkenland.space

        SSLEngine on
        SSLCertificateFile /etc/letsencrypt/live/otrs.gurkenland.space/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/otrs.gurkenland.space/privkey.pem

        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/otrs-ssl-access.log combined
        ErrorLog ${APACHE_LOG_DIR}/otrs-ssl-error.log

        # --
        # added for OTRS (http://otrs.org/)
        # --

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

        <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

                <IfModule mod_version.c>
                    <IfVersion < 2.4>
                        Order allow,deny
                        Allow from all
                    </IfVersion>
                    <IfVersion >= 2.4>
                        Require all granted
                    </IfVersion>
                </IfModule>
                <IfModule !mod_version.c>
                    Order allow,deny
                    Allow from all
                </IfModule>
            </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

            <IfModule mod_version.c>
                <IfVersion < 2.4>
                    Order allow,deny
                    Allow from all
                </IfVersion>
                <IfVersion >= 2.4>
                    Require all granted
                </IfVersion>
            </IfModule>
            <IfModule !mod_version.c>
                Order allow,deny
                Allow from all
            </IfModule>

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

        </Directory>

        <Directory "/opt/otrs/var/httpd/htdocs/">
            AllowOverride None

            <IfModule mod_version.c>
                <IfVersion < 2.4>
                    Order allow,deny
                    Allow from all
                </IfVersion>
                <IfVersion >= 2.4>
                    Require all granted
                </IfVersion>
            </IfModule>
            <IfModule !mod_version.c>
                Order allow,deny
                Allow from all
            </IfModule>

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

            # Make sure CSS and JS files are read as UTF8 by the browsers.
            AddCharset UTF-8 .css
            AddCharset UTF-8 .js

            # Set explicit mime type for woff fonts since it is relatively new and apache may not know about it.
            AddType application/font-woff .woff

        </Directory>

        # Allow access to public interface for unauthenticated requests on systems with set-up authentication.
        # Will work only for RegistrationUpdate, since page resources are still not be loaded.
        # <Location /otrs/public.pl>
        #     <IfModule mod_version.c>
        #         <IfVersion < 2.4>
        #             Order allow,deny
        #             Allow from all
        #         </IfVersion>
        #         <IfVersion >= 2.4>
        #             Require all granted
        #         </IfVersion>
        #     </IfModule>
        #     <IfModule !mod_version.c>
        #         Order allow,deny
        #         Allow from all
        #     </IfModule>
        # </Location>

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

            # Cache css thirdparty for 4 hours, including icon fonts
            <Directory "/opt/otrs/var/httpd/htdocs/skins/*/*/css/thirdparty">
                <FilesMatch "\.(css|CSS|woff|svg)$">
                    Header set Cache-Control "max-age=14400 must-revalidate"
                </FilesMatch>
            </Directory>

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

            # Cache js thirdparty for 4 hours
            <Directory "/opt/otrs/var/httpd/htdocs/js/thirdparty/">
                <FilesMatch "\.(js|JS)$">
                    Header set Cache-Control "max-age=14400 must-revalidate"
                </FilesMatch>
            </Directory>
        </IfModule>

        # Limit the number of requests per child to avoid excessive memory usage
        MaxRequestsPerChild 4000
</VirtualHost>
wurzel
Znuny guru
Posts: 3224
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: zwei fragen

Post by wurzel »

Hi,

bei mir siehts so aus (mit SSL, geht aber für :80 auch, und hab meine Domain anonymisiert) und funktioniert:

Code: Select all

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName otrs.mydomain.bayern
        ServerAdmin florian@gmx.bayern

ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"
DocumentRoot /opt/otrs/var/httpd/htdocs/
(...)
mein DocumentRoot weist auf index.html und da ist ein redirect auf index.pl

wie man es macht, dass index.pl nicht angezeigt wird in der URL? Weiß ich nicht :(

viele Grüße
Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
cbg
Znuny expert
Posts: 169
Joined: 25 Jun 2016, 23:29
Znuny Version: 5.0.9

Re: zwei fragen

Post by cbg »

wurzel wrote:Hi,

bei mir siehts so aus (mit SSL, geht aber für :80 auch, und hab meine Domain anonymisiert) und funktioniert:

Code: Select all

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName otrs.mydomain.bayern
        ServerAdmin florian@gmx.bayern

ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"
DocumentRoot /opt/otrs/var/httpd/htdocs/
(...)
mein DocumentRoot weist auf index.html und da ist ein redirect auf index.pl

wie man es macht, dass index.pl nicht angezeigt wird in der URL? Weiß ich nicht :(

viele Grüße
Flo

Hi Leute,

das ist relativ einfach:

1) musst du in in deine virtuelle Hosts-configurations Datei. Meistens ist es die zzz_otrs.config im Verzeichnis /etc/apache2/conf.d/

2) da muss du diesen Eintrag suchen: ErrorDocument 403 /otrs/index.pl

3) Dies auf "ErrorDocument 404 /otrs/index.pl" ändern.

Apache jetzt mal neu starten.
Post Reply