get rid of /otrs/ in url

Moderator: crythias

Post Reply
biffen
Znuny newbie
Posts: 4
Joined: 02 Mar 2011, 10:04
Znuny Version: 3.0.6

get rid of /otrs/ in url

Post by biffen »

Hi,

I like to know how to configure otrs so its possible to install (or adjust after if only possible) and use 2 vhosts without having /otrs/ in url path. Is it possible?

Customerlogin:
change
customer.example.com/otrs/
to
customer.example.com/

Agent/admin login:
change
agent.example.com/otrs/
to
agent.example.com
mario156
Znuny advanced
Posts: 134
Joined: 16 Feb 2009, 11:40

Re: get rid of /otrs/ in url

Post by mario156 »

You just need to set the DocumentRoot of your vhosts to the otrs path instead of using ScriptAlias / Alias.

If you need to adress more with this vhost of course this would be impractical. Then you could make a redirect to /otrs/ in the default-DocumentRoot via a index-page.
SYSTEM:

OTRS: 3.0.6
OS: openSuSE 11.3
Web-Srv./DB: Apache2/mySQL 5
biffen
Znuny newbie
Posts: 4
Joined: 02 Mar 2011, 10:04
Znuny Version: 3.0.6

Re: get rid of /otrs/ in url

Post by biffen »

Thank you for reply!

I use Ubuntu 10.04, downloaded otrs tar.gz (3.06), uncompress to /opt, rename to otrs.

In controbuted script, (/opt/otrs/scripts/apache2-httpd.include.conf) path looks like this:

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

..so what is the correct path for DocumentRoot?

I also notied, that /opt/otrs/var/httpd/htdocs/index.html is configured to redict /otrs/index.pl, and
/opt/otrs/Kernel/Config/Defaults.pm has:

$Self->{ScriptAlias} = 'otrs/';
$Self->{'Frontend::WebPath'} = '/otrs-web/';

Im confused.. :?
mario156 wrote:You just need to set the DocumentRoot of your vhosts to the otrs path instead of using ScriptAlias / Alias.

If you need to adress more with this vhost of course this would be impractical. Then you could make a redirect to /otrs/ in the default-DocumentRoot via a index-page.
biffen
Znuny newbie
Posts: 4
Joined: 02 Mar 2011, 10:04
Znuny Version: 3.0.6

Re: get rid of /otrs/ in url

Post by biffen »

I guess its not possible, to much dependence.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: get rid of /otrs/ in url

Post by crythias »

Dependence? anything in Defaults.pm can be copied to Config.pm, where it can be changed.

In *general*, you don't have to worry about otrs-web in the apache config.

In apache config for otrs, you could change ScriptAlias and Location to /

and add this line in Config.pm
$Self->{ScriptAlias} = '/';
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
indy1979
Znuny newbie
Posts: 1
Joined: 07 Mar 2011, 23:21
Znuny Version: 2.1.3

Re: get rid of /otrs/ in url

Post by indy1979 »

Could also use an .htaccess file...

Here's mine:

Code: Select all

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/otrs
RewriteRule (>*) /otrs/$1
biffen
Znuny newbie
Posts: 4
Joined: 02 Mar 2011, 10:04
Znuny Version: 3.0.6

Re: get rid of /otrs/ in url

Post by biffen »

Well, tried to modify/remove alias but ended up with wrong path to graphic templates - result templates not working, modify to / ends up with error in apache when restart, not working thou conflict with other aliases.
crythias wrote:Dependence? anything in Defaults.pm can be copied to Config.pm, where it can be changed.

In *general*, you don't have to worry about otrs-web in the apache config.

In apache config for otrs, you could change ScriptAlias and Location to /

and add this line in Config.pm
$Self->{ScriptAlias} = '/';
solefald
Znuny newbie
Posts: 25
Joined: 15 Apr 2011, 23:47
Znuny Version: 3.0.7

Re: get rid of /otrs/ in url

Post by solefald »

Here is now i got it to work, including DirectoryIndex, so you dont have to type index.pl every time.
crythias wrote:$Self->{ScriptAlias} = '/';
Above "ScriptAlias" setting did not work for me. I had to set it to

Code: Select all

$Self->{ScriptAlias} = '';
and:

Code: Select all

Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"
Alias / "/opt/otrs/bin/cgi-bin/"
Notice that Alias and ScriptAlias order has changed with Alias now on top, and ScriptAlias also became Alias.

After this, you have to tell mod_perl to run in /opt/otrs/bin/cgi-bin/
Location section below would not work, because it will break all CSS, so you can just comment the whole thing out

Code: Select all

# <Location /otrs>
#       ErrorDocument 403 /otrs/customer.pl
#        ErrorDocument 403 /otrs/index.pl
#        DirectoryIndex index.pl
#        SetHandler  perl-script
#        PerlResponseHandler ModPerl::Registry
#        Options +ExecCGI
#        PerlOptions +ParseHeaders
#        PerlOptions +SetupEnv
#        Order allow,deny
#        Allow from all
# </Location>
Instead of the <Location> directive, we will just copy needed parts into Directory section AND change SetHandler to AddHandler.

Code: Select all

<Directory "/opt/otrs/bin/cgi-bin/">
    AllowOverride None
    Options +ExecCGI -Includes
    Order allow,deny
    Allow from all
    #
    # Below is what we copied from the <Location> section
    #  
    ErrorDocument 403 /index.pl
    DirectoryIndex index.pl
    AddHandler  perl-script .pl .cgi     <----- change ScriptHandler setting here.
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    PerlOptions +SetupEnv
</Directory>
I also changed DocumentRoot in my virtual host config to

Code: Select all

DocumentRoot /opt/otrs/bin/cgi-bin/
Restart apache and you should be good.
No errors in the logs, and going to http://otrs.example.com takes you straight to the OTRS Agent login screen.
RHEL 5.8 :( / OTRS 3.2.0beta2 / SystemMonitoring
bleitner
Znuny newbie
Posts: 17
Joined: 29 Apr 2012, 18:09
Znuny Version: 3.1.4
Real Name: bob
Company: temboo

Re: get rid of /otrs/ in url

Post by bleitner »

Got this to work to get to the agent logon screen, but how do you get to the customer logon screen now?
Post Reply