3

I’m failing at redirecting my Jenkins to use my subdomain (build.core-network.us) and not require :8080 port slapped behind it.

I’m on Debian Wheezy.

I use Apache (proxy and proxy_http are installed) and this is my /etc/apache2/sites-available/build.core-network.us file:

<VirtualHost *:80>
  ServerName  build.core-network.us:80
  ServerAlias www.build.core-network.us
  ServerAdmin piotr@riddle.pl

  ProxyPass         /  http://localhost:8080/
  ProxyPassReverse  /  http://localhost:8080/
  ProxyRequests     Off

  <Proxy http://localhost:8080/*>
    Order deny,allow
    Allow from all
  </Proxy>

</VirtualHost>

I made sure that /etc/default/jenkins has --httpListenAddress=127.0.0.1 --httpPort=8080 as JENKINS_ARGS

And of course build.core-network.us has correct DNS entry (and it works fine when I add :8080 port to it).

I found 4 other posts like this with 4 different VirtualHost recommendations and either they’re not for me or I’m failing to use them properly.

Update 1: I found errors in error.log:

[Fri Sep 26 17:33:59 2014] [notice] SIGUSR1 received.  Doing graceful restart
[Fri Sep 26 17:33:59 2014] [notice] Apache/2.2.22 (Debian) configured -- resuming normal operations
[Fri Sep 26 17:33:59 2014] [error] proxy: ap_get_scoreboard_lb(0) failed in child 11990 for worker proxy:reverse
[Fri Sep 26 17:33:59 2014] [error] proxy: ap_get_scoreboard_lb(0) failed in child 11991 for worker proxy:reverse

Update 2: I did sudo /etc/init.d/apache2 stop and then start, didn’t help.

  • So whats apache doing? 500, 404? Tell us the output! Look at apache access log and error log. – 3h4x Sep 26 '14 at 21:14
  • No errors in error log. Access log is OK too. When I visit my subdomain I’m simply getting normal "It works! This is the default web page for this server. (…)" page. – ridddle Sep 26 '14 at 21:19
1

I believe the error is here:

 ServerName  build.core-network.us:80

Drop the :80, that's not part of the Host: header. What's happening is that this isn't matching your request, and your system is falling through to another virtualhost (the first one loaded, if nothing explicitly matches).

www.build.core-network.us should be working now, which you can also use to test.


Also, you don't need the <Proxy> section, that is only for forward proxy.

In most cases ProxyRequests is off already, so that's probably redundant, but doesn't hurt.

0

You forgot about the application path.
Default is /jenkins.

For example.
Proxypass /jenkins http://localhost:8080/jenkins

  • This is not my experience. I used to access my Jenkins at build.core-network.us:8080/ and nothing behind it. Application wasn’t using /jenkins at the very end. Proof from my browser history: i.imgur.com/f4klEZz.png – ridddle Sep 26 '14 at 21:30
  • Is jenkins working and you can access it? – 3h4x Sep 26 '14 at 21:33
  • Before I started meddling, yes, I could access it. The service is running. However, I found error in error.log, updated my post just now. – ridddle Sep 26 '14 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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