[SOLVED] OTRS breaks when adding virtualhost?

Moderator: crythias

Locked
prowse
Znuny newbie
Posts: 6
Joined: 21 Mar 2015, 07:04
Znuny Version: 4.0.6
Real Name: Josh Prowse
Company: IOPENER IT Consulting

[SOLVED] OTRS breaks when adding virtualhost?

Post by prowse »

Hey folks, I just installed OTRS 4.0.6 on an Ubuntu 14.04 LTS VPS and it was working great when I loaded it by the ip with the otrs path, like:

http://1.2.3.4/otrs

I then added a virtualhost to hold the actual web site that OTRS will be supporting, and that website loads fine at:

http://1.2.3.4

but now http://1.2.3.4/otrs shows page not found.

I'm sure this is a simple thing to fix, but I'm not a virtualhost expert, and I'm not sure how the otrs.conf file in the conf-available folder interacts with the domain.conf file in the sites-available folder.

My /etc/apache2/conf-available/otrs.conf file is the one taken from the installation guide, and contains those two lines:

Code: Select all

ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"
My /etc/apache2/sites-available/domain.conf file looks like this (actual domain replaced with example.com):

Code: Select all

# domain: example.com
# public: /var/www/example.com/public_html/

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@example.com
  ServerName  http://www.example.com
  ServerAlias example.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/example.com/public_html
  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/example.com/log/error.log
  CustomLog /var/www/example.com/log/access.log combined
</VirtualHost>
Thanks in advance for your expertise in getting this product up and running!

-Josh
Last edited by prowse on 29 Mar 2015, 06:49, edited 1 time in total.
wurzel
Znuny guru
Posts: 3273
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: OTRS breaks when adding virtualhost?

Post by wurzel »

Hi,

virtual hosts need a ServerName. In your example it is http://www.example.com
IP Address will not work any more.

See apache docu for this.

Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12

-- 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.
prowse
Znuny newbie
Posts: 6
Joined: 21 Mar 2015, 07:04
Znuny Version: 4.0.6
Real Name: Josh Prowse
Company: IOPENER IT Consulting

Re: OTRS breaks when adding virtualhost?

Post by prowse »

Thanks wurzel, I changed this but it did not fix the problem.

What DID fix my problem is moving the

Code: Select all

otrs.conf
file from the

Code: Select all

/etc/apache2/conf-available
into the

Code: Select all

/etc/apache2/sites-available
folder, and running

Code: Select all

sudo a2disconf otrs.conf
and

Code: Select all

sudo a2ensite otrs.conf
and then restarting apache.

I'm not sure why this file was in this folder, but moving it instantly fixed everything.
Locked