This message is a cross-post from the Help forum, but I figured it deserves its own post, because i did not find this information anywhere and it may be useful for someone else.
Here is how to remove "/otrs/" from your URI, retaining all functionality and making DirectoryIndex work, so you dont have to type index.pl every time.
OTRS Config settings:
Framework -> Core -> ScriptAlias needs to be blank.
Code: Select all
$Self->{ScriptAlias} = '';
Apache otrs.conf changes:
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 became Alias.
Location section below is no longer needed, because it will break all CSS and jQuery, 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>
Commenting out <Location> directive will disable mod_perl, so to re-enable it we need to copy needed directives into the <Directory /opt/otrs/bin/cgi-bin/> 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>
Change DocumentRoot in your virtual host config (NOT otrs.conf) 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.
I hope this helps.