You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Tags:  not added yet


Configuring Apache / httpd proxy on CentOS

CentOS version: CentOS 7.6.1810

Without SSL

1. Install httpd

sudo yum -y install httpd

2. Set ServerName

sudo echo 'ServerName codeBeamer' >> /etc/httpd/conf/httpd.conf

3. Configure proxy

Create a file with a text editor for example:

sudo vi /etc/httpd/conf.d/default-site.conf

And add the following content. Please replace the following things:

  • URL_OF_CODEBEAMER with the url of the codeBeamer that you would like to use
  • DOMAIN with the public domain of codeBeamer i.e. codebeamer.com
    <VirtualHost *:80>
        ProxyPreserveHost On
    
        ProxyPass / URL_OF_CODEBEAMER retry=1 acquire=3000 timeout=600 keepalive=On
        ProxyPassReverse / URL_OF_CODEBEAMER
    
        RequestHeader set Host DOMAIN
    </VirtualHost>

Example

Let's say there are servers, one has a running codeBeamer that is available on the http://172.20.10.10:8080 and the other server that has a running Apache, it is available on http://172.30.20.20:8080. test.codebeamer.com domain points to http://172.30.20.20:80


In this case the configuration should look like that:

<VirtualHost *:80>
    ProxyPreserveHost On

    ProxyPass / http://172.20.10.10:8080 retry=1 acquire=3000 timeout=600 keepalive=On
    ProxyPassReverse / http://172.20.10.10:8080

    RequestHeader set Host test.codebeamer.com
</VirtualHost>

Context path

In order to use a different context with proxy, codeBeamer docker image must be started with CB_CONTEXT_PATH parameter. Let's say you want to run your codeBeamer on the http://mydomain.com/codeBeamer, in this case the value of CB_CONTEXT_PATH=codeBeamer and the proxy setting looks like that

<VirtualHost *:80>
    ProxyPreserveHost On

    ProxyPass /codeBeamer http://172.20.10.10:8080/codeBeamer retry=1 acquire=3000 timeout=600 keepalive=On
    ProxyPassReverse /codeBeamer http://172.20.10.10:8080/codeBeamer

    RequestHeader set Host mydomain.com/codeBeamer
</VirtualHost>
Please note that CB_CONTEXT_PATH is only supported from 9.4 version

Websocket

Since v10 version websocket protocol is required for codeBeamer application. It must be configured in your proxy server. Please use the following code snippet

<VirtualHost *:80>
    ...

    RewriteEngine on
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule .* "ws://172.20.10.10:8080%{REQUEST_URI}" [P]
    ...

</VirtualHost>
Please note that rewrite_module must be enabled

With SSL

1. Install httpd

sudo yum -y install httpd

2. Install mod_ssl

sudo yum -y install httpd mod_ssl

3. Set ServerName

sudo echo 'ServerName codeBeamer' >> /etc/httpd/conf/httpd.conf

4. Configure proxy

Create a file with a text editor for example:

sudo vi /etc/httpd/conf.d/default-site.conf

And add the following content. Please replace the following things:

  • URL_OF_CODEBEAMER with the url of the codeBeamer that you would like to use
  • DOMAIN with the public domain of codeBeamer i.e. codebeamer.com
  • /path/of/certfile with the actual path of your certificate file
  • /path/of/keyfile with the actual path of your private key file
    <VirtualHost *:80>
        SSLEngine on
        SSLProxyEngine on
    
        SSLCertificateFile /path/of/certfile
        SSLCertificateKeyFile /path/of/keyfile
    
        RewriteEngine on
        RewriteCond %{HTTP:Upgrade} websocket [NC]
        RewriteCond %{HTTP:Connection} upgrade [NC]
        RewriteRule .* "ws://URL_OF_CODEBEAMER%{REQUEST_URI}" [P]
    
        ProxyPreserveHost On
        ProxyPass / URL_OF_CODEBEAMER retry=1 acquire=3000 timeout=600 keepalive=On
        ProxyPassReverse / URL_OF_CODEBEAMER
    
        RequestHeader set Host DOMAIN
    </VirtualHost>

Use SVN

In case you want to use SVN please follow the steps below

1. Install mod_dav_svn

sudo yum -y install mod_dav_svn

2. Create cb-svn.conf

Create a file with a text editor for example

sudo vi cb-svn.conf

Add the following content to cb-svn.conf.

Please replace the following things:

  • /path/of/.htaccess with your auth user file
  • /path/of/acl.svn with your SVN access file
  • /path/of/repositories/parent with your SVN repository parent folder
    <Location /svn>
    	DAV svn
    
    	AuthUserFile /path/of/.htaccess
    	AuthzSVNAccessFile /path/of/acl.svn
    
    	SVNParentPath /path/of/repositories/parent
    	AuthType Basic
    	AuthName "Subversion Repository"
    
    	Require valid-user
    </Location>

Move the file to /etc/httpd/conf.d/

sudo mv /path/to/your/cb-svn.conf /etc/httpd/conf.d/cb-svn.conf

3. Extend default-site.conf

Add the following lines to default-site.conf inside VirtualHost node

<Location /svn/>
    ProxyPass !
</Location>