0

I installed Jenkins on a remote server running Debian 6.0.6 with a ready-to-use Apache 2 instance by using the following instructions:

wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
apt-get update
apt-get install jenkins

Then I did some configuration:

a2enmod proxy
a2enmod proxy_http
a2enmod vhost_alias 

I created the file /etc/apache2/sites-available/jenkins:

<VirtualHost *:80>
    ServerName mydomain.de/jenkins
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass /jenkins http://mydomain.de:8080/jenkins
</VirtualHost>

And finally restarted Apache with /etc/init.d/apache2 restart.

Now I cannot reach it via Webbrowser. Neither of the following lines works:

mydomain.de/jenkins
mydomain.de:8080
mydomain.de:8080/jenkins

Using the first address triggers the following error message in /var/log/apache2/error.log:

File does not exist: /var/www/main/jenkins

EDIT: I just found out that starting the browser on the remote server I can access Jenkins by visiting http://localhost:8080. So Jenkins works, only the redirection is still erroneous.

Bastian
  • 95
  • 2
  • 4
  • 13
  • 1
    I don't think you can use `ServerName mydomain.de/jenkins` maybe set it up as `jenkins.mydomain.de` with the proper DNS entry.. – NickW May 10 '13 at 10:04
  • Well I used a [guide for hudson](http://www.zzorn.net/2009/11/setting-up-hudson-on-port-80-on-debian.html) like [another guy](http://stackoverflow.com/questions/12446352/cannot-access-jenkins) in this forum did. – Bastian May 10 '13 at 10:31
  • You didn't read it very well, nowhere in that hudson guide does it say to put a `ServerName` directive like you have used. Get rid of the `/jenkins` at the end, just type it in yourself in the browser. – NickW May 10 '13 at 10:36
  • Thank you, you were right! Actually I used serveral guides which is why the configuration got mixed up a bit. Do you know where to start if I want to use `jenkins.mydomain.de`? – Bastian May 10 '13 at 12:00
  • 1
    Well, first set up a DNS entry, an A record under yourdomain.de, then use the proxypass directive like this `ProxyPass / http://mydomain.de:8080/jenkins` or something similar. – NickW May 10 '13 at 13:06
  • Are there any reason not to use `mod_ajp` instead of `mod_proxy`? Jetty, which I belive is what are used in Jenkins stand alone Java Container mode, do have support for AJP and so do Apache2. (sorry if it is belived to be OT) – Anders Feb 18 '15 at 18:09

1 Answers1

2

ServerName Directive

Description: Hostname and port that the server uses to identify itself
Syntax: ServerName [scheme://]fully-qualified-domain-name[:port]
Context: server config, virtual host Status: Core Module: core

You do not need, in fact cannot use, a directory as part of a FQDN.

From Wikipedia:

A fully qualified domain name (FQDN), sometimes also referred as an absolute domain name,[1] is a domain name that specifies its exact location in the tree hierarchy of the Domain Name System (DNS). It specifies all domain levels, including the top-level domain and the root zone.[2]

NickW
  • 10,263
  • 1
  • 20
  • 27