[otrs] otrs and debian virtual hosting

917 views
Skip to first unread message

Carlos Gomes - STI Unesp Franca

unread,
Apr 17, 2012, 4:06:56 PM4/17/12
to ot...@otrs.org
Hello Everyone!

Iv set up different subdomains so i can point users to the customer.pl page for ticket management, and another subdomain for otrs administration. Iv followed many suggestions and documentations for apache, but cant manage to use different hosts for both index.pl and customer.pl, can anyone help me , if set up similar environment ?

my apache configs are as this:

subdomain: admin.suporte.franca.unesp.br
#mod do endereco de suporte (/etc/apache2/sites-available/admin.suporte.franca.unesp.
br)
#
<VirtualHost *:80>
        ServerAdmin cgo...@franca.unesp.br
        ServerName  admin.suporte.franca.unesp.br
        ServerAlias admin.suporte.franca.unesp.br

        # Indexes + Directory Root.
        DirectoryIndex /otrs/index.pl
        DocumentRoot /opt/otrs/bin/cgi-bin/

        # CGI Directory
        # ScriptAlias /otrs/ /opt/otrs/bin/cgi-bin/
        <Location /otrs>
        SetHandler perl-script
                PerlResponseHandler ModPerl::Registry
                PerlOptions +ParseHeaders
                PerlSetupEnv On
        </Location>

    <Directory />
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        AllowOverride None
        AddHandler cgi-script .pl
    </Directory>

        # Logfiles
        ErrorLog  /var/log/otrs/admin/error.log
        CustomLog /var/log/otrs/admin/access.log combined
</VirtualHost>


subdomain suporte.franca.unesp.br :
#mod so endereco de suporte (/etc/apache2/sites-available/suporte.franca.unesp.br)
#
<VirtualHost *:80>
        ServerAdmin cgo...@franca.unesp.br
        ServerName  suporte.franca.unesp.br
        ServerAlias suporte.franca.unesp.br

        # Indexes + Directory Root.
        DirectoryIndex /otrs/customer.pl
        DocumentRoot /opt/otrs/bin/cgi-bin/

        # CGI Directory
        # ScriptAlias /otrs/ /opt/otrs/bin/cgi-bin/
        <Location /otrs>
        SetHandler perl-script
                PerlResponseHandler ModPerl::Registry
                PerlOptions +ParseHeaders
                PerlSetupEnv On
        </Location>

    <Directory />
        AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        AddHandler cgi-script .pl
    </DirectOry>

        # Logfiles
        ErrorLog  /var/log/otrs/customer/error.log
        CustomLog /var/log/otrs/customer/access.log combined
</VirtualHost>

but both opens the index.pl file...

iv also used this thread as refference:
http://lists.otrs.org/pipermail/otrs/2005-October/009192.html

but seems quite old, and only one vhost wont suit me for logging purposes.


--
[]'s
---------------------------------
Carlos Gomes
Assistente de Informática II - STI
skype: cgomes.unesp
55(16)3706-8783
UNESP/Franca - FCHS

Douglas Nascimento

unread,
Apr 17, 2012, 4:44:44 PM4/17/12
to User questions and discussions about OTRS.
Eu não tenho certeza, mas acho que em DirectoryIndex você deveria colocar apenas index.pl ou customer.pl, sem o "/otrs/".  Exemplo:

DirectoryIndex index.pl
DirectoryIndex customer.pl


---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs



--
Atenciosamente,
Douglas Nascimento de Jesus
beaglenetwork.blogspot.com

Carlos Gomes - STI Unesp Franca

unread,
Apr 17, 2012, 6:38:52 PM4/17/12
to User questions and discussions about OTRS.
tambem nao funcionou. ja tentei o caminho relativo completo e etc...

2012/4/17 Douglas Nascimento <dougl...@gmail.com>

Carlos Gomes - STI Unesp Franca

unread,
Apr 23, 2012, 9:06:37 AM4/23/12
to User questions and discussions about OTRS.
Well fellas, iv found a huge mistake i didnt payed attention before, while installing otrs via debian packages, it automatically adds code to /etc/apache2/conf.d with code to open up the otrs interface as the default virtual host, so no matter what I put up on the sites-avaiable would overcome this configs, silly me :)

So, iv removed the otrs.conf from conf.d, so I can manage my own virtual hosts and get the results I wanna achive, as suporte.franca.unesp.br would point to customer.pl, admin.suporte.franca.unesp.br would point up to the index.pl admin interface.

Now my problem is a little different, on both virtual servers Iv tryed to copy some configs from this otrs.conf, but the give me an error 500, and the old code Iv made to set up the virtual hosts opens the page as I wanted, but no css and rendering works. Is there a way to put up, and what configs, on the virtual hosts configuration so the sites loads fully?

my config files in sites-avaiable are now as this:

admin.suporte.franca.unesp.br
#mod do endereco de suporte (/etc/apache2/sites-available/admin.suporte.franca.unesp.br)
#
<VirtualHost *:80>
        ServerAdmin cgo...@franca.unesp.br
        ServerName  admin.suporte.franca.unesp.br
        ServerAlias admin.suporte.franca.unesp.br

        # Indexes + Directory Root.
        DirectoryIndex index.pl

        DocumentRoot /opt/otrs/bin/cgi-bin/

        # CGI Directory
        # ScriptAlias /otrs/ /opt/otrs/bin/cgi-bin/
        <Location /otrs>
                SetHandler perl-script
                PerlResponseHandler ModPerl::Registry
                PerlOptions +ParseHeaders
                PerlSetupEnv On
        </Location>

        <Directory />
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                AllowOverride None
                AddHandler cgi-script .pl
        </Directory>

        # Logfiles
        ErrorLog  /var/log/otrs/admin/error.log
        CustomLog /var/log/otrs/admin/access.log combined
</VirtualHost>


and this for suporte.franca.unesp.br, notice that this one iv copyed the full otrs.conf file from conf.d, and changed some lines so it fires up the customer.pl.
# Config script para o vhost de suporte aos usuarios
# Criado em 17/04/2012 - cgo...@franca.unesp.br
#

<VirtualHost *:80>
# if mod_perl is used
<IfModule mod_perl.c>

    # load all otrs modules
    Perlrequire /opt/otrs/scripts/apache2-perl-startup.pl

    # Apache::Reload - Reload Perl Modules when Changed on Disk
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload
    PerlModule Apache2::RequestRec

    # set 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>

    # set mod_perl2 option for generic interface
    <Location /otrs/nph-genericinterface.pl>
        PerlOptions -ParseHeaders
    </Location>

</IfModule>

# directory settings
<Directory "/opt/otrs/bin/cgi-bin/">
        AllowOverride None
        Options +ExecCGI -Includes
        Order allow,deny
        Allow from all
        ErrorDocument 403 /index.pl
        DirectoryIndex customer.pl
        AddHandler  perl-script .pl .cgi    
        PerlResponseHandler ModPerl::Registry
        PerlOptions +ParseHeaders
        PerlOptions +SetupEnv
</Directory>
<Directory "/opt/otrs/var/httpd/htdocs/">
    AllowOverride None
    Order Deny,Allow
   Deny from all
   Allow from 200.145.119.128/27
</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>

# MaxRequestsPerChild (so no apache child will be to big!)
# MaxRequestsPerChild 4000
</VirtualHost>
 
So, with this config iv i request the admin. subdomain it gives me to download the .pl file, and suporte points ok to the customer.pl, but i cant login and the css isnt loaded. The domains are up for public.

Thanks very much for your help douglas, but I thin the mailing would preffer english language so all others could read and document.

Im strugling for some days now, with no success... could find more documentations about virtual hosting that are suitable for my debian ambient. any help appreciated
 

Boris Wagener

unread,
Apr 23, 2012, 9:19:28 AM4/23/12
to User questions and discussions about OTRS.
Hi,

i've found a nice GUI on Weekend

www.webmin.com

You can manage the v-hosts via Webinterface.
Maybe it helps:-)

2012/4/23 Carlos Gomes - STI Unesp Franca <cgo...@franca.unesp.br>

Carlos Gomes - STI Unesp Franca

unread,
Apr 23, 2012, 10:16:50 AM4/23/12
to User questions and discussions about OTRS.
Well, I have never good experiences with webmin... not sure if with a perl website it would help

Im still studying to find out the correct configurations for the virtual hosts under debian
thanks anyway

2012/4/23 Boris Wagener <boris....@googlemail.com>

Carlos Gomes - STI Unesp Franca

unread,
Apr 24, 2012, 5:33:58 PM4/24/12
to User questions and discussions about OTRS.
anyone?

Steven Carr

unread,
Apr 25, 2012, 3:55:41 AM4/25/12
to User questions and discussions about OTRS.
So on our debian boxes I personally hate the way debian handles vhosts so I rip their configuration out and put in my own for the vhost part. Below are my standard build docs for apache on debian, YMMV. And to create extra vhosts I just add a new config file for each vhost to /srv/vhosts/config/

################################################################################
# apache configuration

# install apache
aptitude install apache2 libapache2-mod-php5 php5 php5-mcrypt php5-cli php5-curl php5-gd php5-imagick php5-imap php5-ldap php5-mhash php5-mysql php5-snmp php5-sqlite php5-tidy php5-xcache php5-xmlrpc php5-xsl ldap-utils imagemagick mysql-client

# create vhost containers
mkdir -p /srv/vhosts/config
mkdir -p /srv/vhosts/sites/00_default/htdocs
cp /var/www/index.html /srv/vhosts/sites/00_default/htdocs/index.html
mkdir -p /srv/vhosts/sites/00_default/cgi-bin
mkdir -p /srv/vhosts/logs

# enable/disable modules
a2dissite 000-default
a2dissite default
a2enmod auth_basic
a2enmod authn_file
a2enmod authz_default
a2enmod cgi
a2enmod deflate
a2enmod include
a2enmod php5
a2enmod rewrite
a2enmod ssl
a2enmod vhost_alias
a2enmod authnz_ldap
a2enmod status
a2enmod mem_cache
a2dismod userdir

# update apache config to use own vhosts
vi /etc/apache2/apache2.conf
# Include the virtual host configurations:
#Include /etc/apache2/sites-enabled/
Include /srv/vhosts/config/

# add in extra compression support
vi /etc/apache2/conf.d/deflate
<Location />
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/atom_xml
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php
    AddOutputFilterByType DEFLATE application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE application/x-httpd-eruby
    AddOutputFilterByType DEFLATE text/html
</Location>

# default vhost config
vi /srv/vhosts/config/00_default

<VirtualHost *:80>
    ServerAdmin help...@domain.com
   
    DocumentRoot /srv/vhosts/sites/00_default/htdocs/
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /srv/vhosts/sites/00_default/htdocs/>
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /srv/vhosts/sites/00_default/cgi-bin/
    <Directory /srv/vhosts/sites/00_default/cgi-bin>
        AllowOverride None
        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch

        Order allow,deny
        Allow from all
    </Directory>
   
    # flip all traffic to https
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
   
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
   
    CustomLog /srv/vhosts/logs/00_default_access.log combined

    ServerSignature On
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin help...@domain.com
   
    DocumentRoot /srv/vhosts/sites/00_default/htdocs/
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /srv/vhosts/sites/00_default/htdocs/>
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /srv/vhosts/sites/00_default/cgi-bin/
    <Directory /srv/vhosts/sites/00_default/cgi-bin>
        AllowOverride None
        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch

        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /srv/vhosts/logs/00_default_ssl_access.log combined

    SSLEngine on
    SSLCertificateFile    /etc/apache2/ssl/server.pem
    SSLCertificateKeyFile /etc/apache2/ssl/server.key.insecure
   
    SSLProtocol -all +SSLv3 +TLSv1
    SSLCipherSuite SSLv3:+HIGH:+MEDIUM

    # SSL Engine Options:
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
        SSLOptions +StdEnvVars
    </Directory>

    # SSL Protocol Adjustments:
    BrowserMatch ".*MSIE.*" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0

</VirtualHost>
</IfModule>

# secure it up abit
vi /etc/apache2/conf.d/security
ServerTokens Minimal
ServerSignature Off
TraceEnable Off

# php tweaks
vi /etc/php5/apache2/php.ini
magic_quotes_gpc = off
post_max_size = 64M
upload_max_filesize = 64M

# directory fancy index tweaks
vi /etc/apache2/mods-available/autoindex.conf
IndexOptions FancyIndexing FoldersFirst VersionSort NameWidth=* DescriptionWidth=* ScanHTMLTitles XHTML

# change php gc timeout
vi /etc/php5/apache2/php.ini
session.gc_maxlifetime = 28800

# add www-data to the users group
adduser www-data users

# reset permissions
chmod -R 775 /srv/vhosts
chown -R www-data:users /srv/vhosts

# restart apache
/etc/init.d/apache2 restart





On 24 April 2012 22:33, Carlos Gomes - STI Unesp Franca <cgo...@franca.unesp.br> wrote:
anyone?

Carlos Gomes - STI Unesp Franca

unread,
Apr 26, 2012, 1:10:38 PM4/26/12
to User questions and discussions about OTRS.
nice!

Ill give a try on this configuration approach.. only one doubt, where you dont use DirectoryIndex, how do you set up the different domains to open different .pl files from the otrs interface?

2012/4/25 Steven Carr <sjc...@gmail.com>
---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Steven Carr

unread,
Apr 26, 2012, 6:07:39 PM4/26/12
to User questions and discussions about OTRS.
You could do some kind of simple redirect either using mod_rewrite or a simple meta refresh?

Steve
Reply all
Reply to author
Forward
0 new messages