• Photos Photos
  • Linked In Linked In
  • Google + Google +
  • Facebook Facebook
  • Flickr Flickr
  • Vimeo Vimeo

www.gavinwill.me.uk

Photography, IT, Bikes and more.

  • Pages

    • About
    • Blog
    • Contact
    • Home
  • Archives

    • January 2013
    • September 2012
    • August 2012
    • July 2012
    • June 2012
    • May 2012
    • April 2012
    • March 2012
    • February 2012
    • January 2012
    • December 2011
    • November 2011
  • Search:

Posts

  • View Archive

Monthly: September 2012

Mantis Active Directory Authentication

Mantis is a well developed and supported web based bug tracking system. The benefit of Active Directory Authenticaion is obvious but there is the added benefit that it can pull in the primary email address from Active Directory therefore ensuring the email address will allways correct for accounts that you have in mantis.

First Mantis needs php5-ldap installed

apt-get install php5-ldap

apt-get install php5-ldap

Then we need to modify /var/www/config_inc.php to add the LDAP authentication settings.

 # --- AD Auth ---
$g_login_method = LDAP;
$g_ldap_server = "ldap://domaincontroller1";
$g_ldap_port = 389;
$g_ldap_root_dn = "OU=Users,DC=Domain,DC=local";
$g_ldap_bind_dn = "CN=Mantis Service Account,OU=Service Accounts,DC=Domain,DC=local";
$g_ldap_bind_passwd ="*********";
$g_ldap_organization = "";
$g_ldap_protocol_version = 3;
$g_ldap_uid_field = "sAMAccountName";

# --- AD Auth --- $g_login_method = LDAP; $g_ldap_server = "ldap://domaincontroller1"; $g_ldap_port = 389; $g_ldap_root_dn = "OU=Users,DC=Domain,DC=local"; $g_ldap_bind_dn = "CN=Mantis Service Account,OU=Service Accounts,DC=Domain,DC=local"; $g_ldap_bind_passwd ="*********"; $g_ldap_organization = ""; $g_ldap_protocol_version = 3; $g_ldap_uid_field = "sAMAccountName";

The setting that pulls in the emails from Active Directory is:

$g_use_ldap_email = ON;

$g_use_ldap_email = ON;

Accounts are still manually created in Mantis but it uses LDAP for authentication. Therefore the usernames need to match up correctly. When a member of staff leaves you can simply disable / delete the Active Directory account but the details will still be availible in Mantis.

  • September 28, 2012
  • 1
  • 0

Limit Apache Bandwidth with mod_bw

Apache will normally serve a file at the maximum speed possible. I needed to rate limit an apache server to act as a fake QOS to ensure the line would not be saturated when serving large files. This is incredibly easy to do with mod_bw. First we need to install and enable mod_bw

 apt-get install libapache2-mod-bw
 a2enmod bw

apt-get install libapache2-mod-bw a2enmod bw

Then it is a simple task of specifying the limits in you virtualhost conf file.

BandWidthModule On
ForceBandWidthModule On
BandWidth 10.40.0.0/16 0
BandWidth all 1500000

BandWidthModule On ForceBandWidthModule On BandWidth 10.40.0.0/16 0 BandWidth all 1500000

The above enables the module, forces the module for all apache traffic and then finally we dont restrict the local network but restrict everyone else to 150KB/s.

Then simply restart apache

/etc/init.d/apache2 restart

/etc/init.d/apache2 restart

You can test by commenting out the line for the local network, restarting apache again and then try to download a large file and you should notice the browser is only about to download at around 150KB/s.

  • September 6, 2012
  • 0
  • 0

Copyright © 2021 www.gavinwill.me.uk.

  • LinkedIn
  • Google +
  • Facebook
  • Flickr
  • Vimeo
Back to Top