https://jo.bgplus.com/blog/setting-up-centos-7-apache-24-with-azure-ad-authentication
Archive for the ‘Software’ Category

Setting up Centos 7 Apache 2.4 with Azure AD Authentication
March 15, 2020
MacOS Sierra SSH issue solved
October 10, 2016Just upgraded to OSX Sierra and my ssh totally broke. The fix is easy. As a super user or with sudo apply that below at the end of file /etc/ssh/ssh_config:
KexAlgorithms +diffie-hellman-group1-sha1
HostKeyAlgorithms +ssh-dss

Crontab jobs for all US federal holidays
May 7, 2016Ever wonder how to run crontab jobs for all US federal holidays? Below is how:
1 0 1 1 * /bin/echo “New Year’s Day”
1 0 15,16,17,18,19,20,21 1 1 /bin/echo “Martin Luther King’s Day”
1 0 15,16,17,18,19,20,21 2 1 /bin/echo “President’s Day”
1 0 25,26,27,28,29,30,31 5 1 /bin/echo “Memorial Day”
1 0 4 7 * /bin/echo “Independance Day”
1 0 1,2,3,4,5,6,7 9 1 /bin/echo “Labor Day”
1 0 8,9,10,11,12,13,14 10 1 /bin/echo “Columbus Day”
1 0 11 11 * /bin/echo “Veterans Day”
1 0 22,23,24,25,26,27,28 11 4 /bin/echo “Thanksgiving”
1 0 25 12 * /bin/echo “Christmas”

Changing back to IPTables in Fedora 18
March 18, 2013By default Fedora 18 has changed to using firewalld to maintain the host firewall. While this may be a good thing some times we need the old ways to allow us to catch up. Especially when we haven’t the time to migrate complicated rules. Thankfully Fedora has not removed IPTables. The following set of commands should disable Firewalld and enable IPTables for those of us needing the breathing space to catch up.
systemctl disable firewalld.service
systemctl stop firewalld.service
systemctl enable iptables.service
systemctl enable ip6tables.service
systemctl start iptables.service
systemctl start ip6tables.service
Of course if you are like me and like to install minimal systems you may need to run this command first.
yum -y install iptables-services iptables-utils
Source: http://www.chesterproductions.net.nz/blogs/it/sysadmin/changing-back-to-iptables-in-fedora-18/616/

The definitive guide of connecting Apache via LDAP SSL to ActiveDirectory + Subversion
March 15, 2013I needed to integrate Apache with ActiveDirectory via LDAP SSL. The manual SUCKS! It does not say anything useful, except for the syntax of the directives.
This article was the most definitive of configuring the integration. But lacks the information about how to make the SSL work correctly.
Here’s the kicker, it is as simple as the following several elements(this is in the top of /etc/apache2/sites-available/default):
# Make sure ve don’t care about the server’s certificate, because we don’t
LDAPVerifyServerCert off
LDAPTrustedMode SSL
# The server’s client cert information: the cert and the matching private key
LDAPTrustedGlobalCert CERT_BASE64 /etc/apache2/sites-available/cert1.pem
LDAPTrustedGlobalCert KEY_BASE64 /etc/apache2/sites-available/key1.pem
These go into the ROOT. Do not try to put them in the Location, nor Directory, nor VirtualHost.
And the main change to enable the SSL transport:
AuthLDAPURL “ldaps://adserver.example:636/DC=adserver,DC=example?sAMAccountName?sub?(objectClass=*)” SSL
These are the steps:
1. Create the client Key and Certificate
The cert1.pem and key1.pem are created like described here:
openssl genrsa 1024 > key1.pem
openssl req -new -x509 -nodes -sha1 -days 365 -key key1.pem > cert1.pem
For an additional configuration reduction bonus you can have it in one single file:
cat cert1.pem key1.pem > pcert.pem
LDAPTrustedGlobalCert CERT_BASE64 /etc/apache2/sites-available/pcert.pem
2. Enable the correct modules on Apache HTTP Server 2.2.
On my Ubuntu system the module enabling is done like this:
Or uncomment these elements in the httpd.conf:
LoadModule actions_module modules/mod_actions.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule ldap_module modules/mod_ldap.so
And the modules that are prescribed by the Subversion.
3. The access restrictions and Subversion
The short info for configuring the access restrictions.
This will allow people in the users in SVN Writers to commit and SVN Readers will be able to checkout and connect.
<Location>
# This enables Subversion
DAV svn
# Location of the Subversion repository
SVNPath /home/ldaptest/
# How we are going to get authenticated
AuthBasicProvider ldap
AuthType Basic
AuthzLDAPAuthoritative on
AuthName “My Subversion server”
#The URL of the ActiveDirectory server
AuthLDAPURL “ldaps://adserver.example:636/DC=adserver,DC=example?sAMAccountName?sub?(objectClass=*)” SSL
# Credentials for the Apache HTTP to connect to the A/D to issue queries
AuthLDAPBindDN “subversion@adserver.example”
AuthLDAPBindPassword 555
# Limit all write operations to users within SVN Writers group
<LimitExcept>
require ldap-group CN=SVN Writers,CN=Users,DC=adserver,DC=example
</LimitExcept>
# Limit logon and reading to only users in SVN Readers group
require ldap-group CN=SVN Readers,CN=Users,DC=adserver,DC=example
</Location>
4. Add the following to the default site on Apache HTTP
The file is /etc/apache2/sites-available/default
Right at the TOP.
# Make sure ve don’t care about the server’s certificate, because we don’t
LDAPVerifyServerCert off
LDAPTrustedMode SSL
# The server’s client cert information: the cert and the matching private key
LDAPTrustedGlobalCert CERT_BASE64 /etc/apache2/sites-available/cert1.pem
LDAPTrustedGlobalCert KEY_BASE64 /etc/apache2/sites-available/key1.pem