JIRA display is weird when accessing through apache in front of tomcat

DrDave February 17, 2013

Hi folks,

I configured the first time in my life the apache webserver and tomcat using JIRA.

Now I have one bad issue left!

If I access JIRA through port 8080 (direct tomcat) all is ok.

If I access JIRA through port 80 (apache -> tomcat using AJP 1.3) the content I see is really bad.. It seems like I am getting no images and no formatting of text, no structure and so on..

Hope you can help me, thanks! :)

4 answers

1 accepted

0 votes
Answer accepted
DrDave March 5, 2013

Here is how it works!! :)

I am so happy as it works now..

I don't know why I have to use such a RewriteRule..

Maybe there is a smarter solution - I don't know.

<VirtualHost x.x.x.x:80>

# JIRA Proxy Configuration:

ServerName jira.hostname

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

RewriteEngine On

RewriteRule ^/jira(.*)$ ajp://localhost:8009/jira$1 [P,L]

#RewriteCond %{HTTPS} off

#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

ProxyRequests Off

ProxyPreserveHostOff

ProxyPass /ajp://jira.hostname:8009/jira/

ProxyPassReverse / http://jira.hostname/jira/

ProxyPassReverseCookiePath/jira /

</VirtualHost>

1 vote
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2013

Hi Dave.

i assume you've read this KB article

https://confluence.atlassian.com/display/JIRA/Configuring+Apache+Reverse+Proxy+Using+the+AJP+Protocol

did you set a "Context path" ?

can you post the proxy & proxyReverse settings for your host?

regards

DrDave February 19, 2013

Hi,

yeah, I was going through this KB article! :)

I did set a context path: <Context path="/jira" ......

Here is my vh:

<VirtualHost *.*.*.*:80>

# JIRA Proxy Configuration:

ServerAdmin jira@domain

ServerName jira.domain

<Proxy *>

Order deny,allow

Allow from all

</Proxy>

#RewriteEngine On

#RewriteCond %{HTTPS} off

#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

ProxyRequests Off

ProxyPass / ajp://domain:8009/jira/

ProxyPassReverse / ajp://domain:8009/jira/

</VirtualHost>

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2013
SSLProxyEngine On
ProxyRequests           Off
ProxyPreserveHost       On
ProxyPass               /jira           ajp://localhost:8009/jira
ProxyPassReverse        /jira           ajp://localhost:8009/jira

this is my config

why you connect to <domain> if your jira is on ajp at localhost?

i think you need the ProxyPreserveHost directive as well

DrDave February 20, 2013

hm.. I have no idea whats going on..

I have now exactly your settings.. except SSLProxyEngine (but I actually have no SSL)..

Look at this path...?

http://jira.domain/jira/s/de_DE3hs8ib-418945332/849/3/18a4dc2c708dd57454fa134bf0dad058/_/download/contextbatch/css/atl.dashboard/batch.cssFailed to load resource: the server responded with a status of 404 (Not Found)

http://jira.domain/jira/s/de_DE3hs8ib-418945332/849/3/c2e41f2cf09f8b3c8914470a6617682d/_/download/contextbatch/css/jira.global/batch.cssFailed to load resource: the server responded with a status of 404 (Not Found)

http://jira.domain/jira/s/de_DE3hs8ib-418945332/849/3/ab0080b1e7b99e740b69e71918df70da/_/download/contextbatch/css/atl.general/batch.cssFailed to load resource: the server responded with a status of 404 (Not Found)

DrDave February 20, 2013

Oh YES! It works now! :)

This is my config now! I removed the jira path! ... Because in tomcat I have a context path = /jira ...

Thank you very much!

ProxyRequests Off

ProxyPreserveHostOn

ProxyPass / ajp://localhost:8009/

ProxyPassReverse / ajp://localhost:8009/

DrDave February 20, 2013

is there maybe a problem using a context path = /jira and AJP together?

may I need ProxyPassReverseCookiePath ?

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2013
No there is no problem as you can see i use the same. Could you please remove the trailing / behind jira in proxyPass and proxyPassReverse? Take a look at my config lines.
DrDave February 22, 2013

it makes no difference... :(

in inspector :

path: /secure/Dashboard.jspathe only file which got found

all others, e.g:

path: /jira/s/de_DE3hs8ib-418945332/849/3/_/images/icon-jira-logo.png

HOW can I get rid of this /jira in the path. So.. why this prefix /jira is only on all files except Dashboard.jspa!?

I don't understand that....

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2013
Ok lets go through it again: 1. server base url is set correct? 2. context path is empty? 3. proxyPass derective is correct? In that case i'd suggest to purge your ${jira-install}/work/* directory after stoping jira. Restart it afterwards to force the tomcat to be rebuild
DrDave February 22, 2013

1. server base url: jira.localhost

2. I removed the context path = "/jira" - now its ""

3. proxypass is correct! it was correct all the time, if it would be wrong, I wouldn't see the jira startpage .. just without css, images etc... thats alone is my problem!

I deleted this and restartet tomcat etc..

It helped nothing.. :/

DrDave February 22, 2013

yes! exactly!

what I should search in my db? please explain.. thanks!

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2013
And you see that the images are tryin to be loaded from your-url/jira right? Could you check for it inside the database?
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2013
Must be some propertytext containing jiras base url.
DrDave February 22, 2013

In table propertytext are 7 rows.. but I can't see the base url.. what do you think..?

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2013
Don't know exactly atm. I will look for the right place as soon as i reach my home. Stay tuned
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2013
Oh great. That should be the right place. But is this the url you reach your jira?
DrDave February 22, 2013

okey! :)

I found something in propertystring:

| 10111 | http://jira.host

...

<body></body>
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2013
Wait a minute. Are you trying to add a subdomain to localhost?? A few lines before you said your base url is jira.localhost. Is that right?
DrDave February 22, 2013

Sorry for confusing.. I always use the hostname ;)

DrDave February 23, 2013
so.. jira.hostname .. always
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 24, 2013

thats strange. do you remeber adding any redirect or something in your vhost.cfg file that points on ${you_host}/jira ?

atm i got no idea where this should be comming from

0 votes
DrDave February 17, 2013
1. my root url is exact the url I call in browser 2. hmm.. css, js and images -> 404 not found.. but why!?
0 votes
Vishwajeet Singh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2013

I am not sure what do you mean by content is bad, here are few pointers to start with

1. Check the root url configured in general settings

2. User firebug or any other developer tool on browser to see, what response you are getting for media files.

DrDave February 17, 2013

1. my root url is exact the url I call in browser

2. hmm.. css, js and images -> 404 not found.. but why!?

Vishwajeet Singh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2013

Looks like the media requests are not reaching jira, can you check if there are any other mappings in Apache that might be conflicting.

DrDave February 18, 2013

I don't know where I should look for this.. In my vhosts.conf I have only the virtual host for jira defined.

Maybe completely wrong but.. Do I have to specify mime types in httpd.conf?

What I tried is to remove in my ajp forwarding the /jira at the end of my url.. so it worked, but I had to go to jira.domain/jira, and I want just to go to jira.domain

Isn't it strange?

Vishwajeet Singh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2013

It would help if you can share your vhost config , I hope you followed instructions mentioned here https://confluence.atlassian.com/display/JIRA/Integrating+JIRA+with+Apache

Suggest an answer

Log in or Sign up to answer