Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have an existing apache webserver, and I am trying to add YouTrack to it. Knowing anything about YouTrack is likely not relevant for this question, except that it's running Jetty 6.1.

So I have it working correctly on it's port. Note, the domain and all the DNS is done internally, the webserver is not exposed to the main internet. If I browse to:

http://my.web.site:7935/

Everything works perfectly, and the connection doesn't go through apache at all. I am trying to use mod_proxy to be able to browse, and I get redirected.

http://my.web.site/youtrack/ --> http://my.web.site/rootGo

Which is not found on my server (obviously); rootGo is related to youtrack. If I manually type in the correct url, this gets redirected:

http://my.web.site/youtrack/rootGo/ --> http://my.web.site/youtrack/login

Which shows a login box but it can't seem to find any of the CSS or other helper files.

Here's what I added to my existing <VirtualHost *:80>. Note: nothing else on this webserver is using mod_proxy:

    ProxyRequests Off
    ProxyVia On
    ProxyPreserveHost On

    # Set the permissions for the proxy
    <Proxy *>
      Order deny,allow
     Allow from all
    </Proxy>

    ProxyPass /youtrack/ http://my.web.site:7935/
    ProxyPassReverse /youtrack/ http://my.web.site:7935/

    <Location /youtrack>
      Order allow,deny
      Allow from all
    </Location>

Is this a problem with my configuration or with YouTrack? I tried to follow the instructions on the YouTrack website but they're pretty minimal and just refer me to the Jetty documentation which hasn't been super helpful either.

share|improve this question
    
The problem with the redirect is what the ProxyPassReverse directive is trying to fix. Your syntax looks correct to me, but that particular directive is the one that would need to have corrections. –  Stephen Ostermiller Mar 13 at 20:52
    
If JS, CSS, and links are not working on your pages, you will likely also need to configure this module: apache.webthing.com/mod_proxy_html It has the ability to rewrite links in the pages that are being proxied. –  Stephen Ostermiller Mar 13 at 20:56
    
You also might want to try running it on a subdomain rather than in a subdirectory. It is often easier to get the proxy directives working when you don't have to change the path portion of the URL. –  Stephen Ostermiller Mar 13 at 20:57
    
@StephenOstermiller Thanks for your answer. If I try to switch to a subdomain I'd have to change my DNS configuration, right? –  durron597 Mar 13 at 21:24
    
@StephenOstermiller I know that I configured mod_proxy_http but I'm not sure I configured mod_proxy_html, do you think that's the problem? –  durron597 Mar 13 at 21:30

1 Answer 1

Using the Standalone version for Youtrack (comes with Tomcat) and Apache, i've succeeded serving Youtrack from a subdirectory (/youtrack) with the following steps:

  1. Stop the Youtrack service if it's running
  2. Enable the AJP connector by uncommenting the following line in server.xml if it is commented (default: enabled)

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    
  3. Rename the webapps/ROOT directory to webapps/youtrack
  4. Start Youtrack
  5. Login to Youtrack using the address

    http://my.web.site:7935/
    
  6. Change the URL in your Youtrack settings to

    http://my.web.site/youtrack
    
  7. Stop Apache
  8. Edit httpd.conf and add the following lines:

    ProxyRequests Off
    ProxyPreserveHost On
    
    ProxyPass /youtrack ajp://my.web.site:8009/youtrack
    ProxyPassReverse /youtrack ajp://my.web.site:8009/youtrack
    
  9. Start Apache

Now you should be able to reach Youtrack from

   http://my.web.site/youtrack
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.