Skip to content

Apache 2.4 connector for Crowd with Debian packaging

License

Notifications You must be signed in to change notification settings

cm-xlabs/cwdapache

 
 

Repository files navigation

Apache Connector for Crowd

See Integrating Crowd with Apache for background information and usage instructions.

About

This project is a fork of Atlassian's Apache Connector for Crowd with the following changes:

  • Mathias Burger's Apache 2.4 compatibility patch has been applied.
  • I have written the necessary files to allow for packaging of this for Debian-based distributions. This has currently only been successfully tested against Ubuntu 14.04 (trusty) but more distributions will be officially supported soon.

Issues

Sadly, Atlassian have dropped support for this module. I'm not an experienced C coder myself, but I'd be happy to accept pull requests which are approved by various parties and integrate them into future verisons.

Building

The following instructions assume your current working directory is the directory where cwdapache is checked out, and that Git is available on the build machine (it's used during the build):

 git clone https://github.com/fgimian/cwdapache.git
 cd cwdapache

Building on CentOS 6

Last tested on CentOS 6.5:

yum install autoconf automake curl-devel httpd-devel libtool libxml2-devel subversion-devel curl libxml2 mod_dav_svn
libtoolize
autoreconf --install
./configure
make

Building on CentOS 7

Last tested on CentOS 7.1:

yum install autoconf automake curl-devel httpd-devel libtool libxml2-devel subversion-devel curl libxml2 mod_dav_svn
libtoolize
autoreconf --install
./configure
make

Building on AMAZON and httpd 2.4

First you have to modify: packages/mod_authnz_crowd.spec

--- a/packages/mod_authnz_crowd.spec
+++ b/packages/mod_authnz_crowd.spec
@@ -8,8 +8,8 @@ URL:            https://confluence.atlassian.com/display/CROWD/Integrating+Crowd
 Source0:        %{name}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

-BuildRequires:  autoconf automake curl-devel httpd-devel libtool libxml2-devel subversion-devel
-Requires:       curl httpd-devel libtool libxml2 mod_dav_svn
+BuildRequires:  autoconf automake curl-devel httpd24-devel libtool libxml2-devel subversion-devel
+Requires:       curl httpd24-devel libtool libxml2 mod24_dav_svn

 Group:          System Environment/Daemons

now you can

yum install autoconf automake curl-devel httpd24-devel libtool libxml2-devel subversion-devel curl libxml2 mod24_dav_svn
libtoolize
autoreconf --install
./configure
make

After installing

Apache 2.2 Config Example

    <Location />
      AuthName "Crowd protected login"
      AuthType Basic
      AuthBasicProvider crowd
      CrowdAppName YOUR_CROWD_APP
      CrowdAppPassword YOUR_CROWD_PASSWORD
      CrowdURL YOUR_CROWD_URL
      Require crowd-group YOUR_CROWD_GROUPS
      AuthzUserAuthoritative Off
      CrowdSSLVerifyPeer off
      Satisfy any
      Order deny,allow
      Deny from all
      Allow from YOUR_IP
    </Location>

Apache 2.4 Config Example

    <Location />
        <RequireAll>
          AuthName "Crowd protected login"
          AuthType Basic
          AuthBasicProvider crowd
          CrowdAppName YOUR_CROWD_APP
          CrowdAppPassword YOUR_CROWD_PASSWORD
          CrowdURL YOUR_CROWD_URL
          CrowdSSLVerifyPeer off
          Require crowd-group YOUR_CROWD_GROUPS
          <RequireAny>
            Require ip YOUR_IP
            Require ip YOUR_IP2
          </RequireAny>
        </RequireAll>
    </Location>

You have to load the module using this snipped. No automatically module enablement anymore.

    LoadModule authnz_crowd_module /usr/lib64/httpd/modules/mod_authnz_crowd.so

Optional: How to Build an RPM

If you'd like to build an RPM for later installation:

yum install rpm-build
echo "%_topdir $HOME/rpmbuild" > ~/.rpmmacros
mkdir -p ~/rpmbuild/{SOURCES,BUILD,SRPMS,RPMS}
rm mod_authnz_crowd-*.tar.gz
make dist # builds source distribution which is used as the source for the RPM
cp mod_authnz_crowd-*.tar.gz ~/rpmbuild/SOURCES
sed "s/Version:        .*/Version:        $(./version-gen)/" packages/mod_authnz_crowd.spec > packages/mod_authnz_crowd-current.spec
rpmbuild -ba --target x86_64 packages/mod_authnz_crowd-current.spec # or '--target x86' for a 32 bit build
rm packages/mod_authnz_crowd-current.spec
echo "Your RPMS should be in..." && ls -R ~/rpmbuild/SRPMS ~/rpmbuild/RPMS

Building on CentOS 5

Last tested on CentOS 5.10.

Follow the instructions for CentOS 6, but:

  • you must use a more recent version of libtool. libtool 2.2.6b is what CentOS 6 ships with at time of writing, and is known to work.

Building on Ubuntu 14.04 (trusty) or Debian 6 (squeeze):

aclocal
libtoolize
autoheader
automake --force-missing --add-missing
autoreconf
./configure
make

Optional: How to Build a Debian package for Ubuntu 14.04 (trusty)

If you'd like to build a Debian for later installation:

sudo apt-get install devscripts equivs
sudo mk-build-deps -i -r
dpkg-buildpackage -us -us
echo "Your Debian package should be in..." && ls ../libapache2-mod-auth-crowd_*.deb

Installing

make install

After installing

Apache config example

<Directory /var/www/htdocs/>
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

    AuthName "__AUTHNAME__"
    AuthType Basic
    AuthBasicProvider crowd

    CrowdAppName __APPNAME__
    CrowdAppPassword __APPPWD__
    CrowdURL https://__CROWDSERVER__/crowd/
    CrowdCertPath __CERTPATH__

    CrowdAcceptSSO On
    CrowdCreateSSO On

    Require valid-user
    #configure groups in apache 2.4 as follows:
    #Require crowd-group __GROUP__
</Directory>

Modify apache config, do NOT USE .htaccess!

service apache2 reload

About

Apache 2.4 connector for Crowd with Debian packaging

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 74.1%
  • Shell 12.5%
  • Python 11.2%
  • C++ 1.3%
  • Other 0.9%