Thursday, July 14, 2011

LDAP with AD setup on Linux

REMOVE SSSD:

If you're on RHEL 6 or CentOS 6, you should first remove sssd. 

yum remove sssd
yum remove sssd-client


LINUX SETUP:


authconfig --enableldap --enableldapauth --enablelocauthorize --ldapserver=ldapserver1,ldapserver2,ldapserver3 --ldapbasedn="ou=blah,dc=example,dc=com" --update

OR

authconfig-tui




CONFIRM NSSWITCH.CONF:


/etc/nsswitch.conf:

    passwd:     files ldap
    shadow:     files ldap
    group:      files ldap



If it reads anything other than "files ldap", you did something wrong.






FINAL CONFIGURATION:

/etc/pam_ldap.conf or /etc/ldap.conf (depending on version):
   
    host ldapserver1 ldapserver2 ldapserver3
    base ou=blah,dc=example,dc=com
    binddn username@example.com  ... this is a non-privileged user ... not an admin
    bindpw type_username's_password
    timelimit 120
    bind_timelimit 120
    bind_policy soft
   

    # RFC 2307 (AD) mappings
    nss_map_objectclass posixAccount user
    nss_map_objectclass shadowAccount user
    nss_map_attribute uid sAMAccountName
    nss_map_attribute homeDirectory unixHomeDirectory
    nss_map_attribute shadowLastChange pwdLastSet
    nss_map_objectclass posixGroup group
    nss_map_attribute uniqueMember member
    pam_login_attribute sAMAccountName
    pam_filter objectclass=User
    pam_password md5


Comment out the lines below in the file:

    uri ldap://ldapserver1/ ldap://ldapserver2/ ldap://ldapserver3/ (not needed)
    ssl no (not needed)
    tls_cacertdir /etc/openldap/cacerts (not needed)






Final note, others have edited the file /etc/sysconfig/authconfig and modified the FORCELEGACY to yes, but I didn't need to.

Tuesday, July 5, 2011

Oatmeal Raisin Cookies

INGREDIENTS

1 cup Buttered Crisco
1 cup brown sugar
1 cup white sugar
2 eggs
1 teaspoon vanilla
1 1/2 cups flour
1 teaspoon salt
1 teaspoon Arm and Hammer baking soda
1 1/2 cups Quaker Oats
1 teaspoon cinnamon
1-2 cups of raisins
1/2 teaspoon nutmeg
PAM cooking spray

RECIPE

  1. Sift one and a half cups of flour - leave in sifter
  2. Put one teaspoon of baking soda into sifter
  3. Put one teaspoon of salt into sifter
  4. Put one teaspoon of cinnamon into sifter
  5. Put a half teaspoon of nutmeg into sifter
  6. Sift everything together
  7. Put one cup of white sugar into mixing bowl
  8. Put one cup of brown sugar into mixing bowl
  9. Put one cup of Buttered Crisco into bowl
  10. Start mixer ... only white sugar, brown sugar, buttered crisco in at this point
  11. Put 2 eggs into mixer - one at a time - remove white
  12. Add mixed flour/etc. from steps 1-6
  13. Mix
  14. Add one and a half cups of Quaker Oats into mixing bowl
  15. Mix
  16. Add one teaspoon of Vanilla Extract into mixing bowl
  17. Mix
  18. Add one cup of raisins into mixing bowl (personally I'd add a cup and a half to two cups)
  19. Mix
  20. Spray cookie sheet with PAM
  21. Put cookies on cookie sheet in little balls
  22. Cook for roughly 15 minutes ... every oven is going to cook differently
  23. Take off of cookie tray while still warm

    Strawberry Cake

    INGREDIENTS
    1    box yellow cake mix
    1    box strawberry jello
    1    package frozen strawberries (12 oz.) - SAVE ½ CUP FOR ICING
    ¼    cup water
    ¾    cup Wesson vegetable oil
    4    eggs - ADD ONE AT A TIME
    3    tablespoons of flour
    1    cube melted butter
    1    box (bag) of powdered sugar (2 lbs.)
    1    PAM Spray

    CAKE MIX
    Take butterstick out and let it get soft
    Soak frozen strawberries in warm water
    Pour out yellow cake mix
    Create hole in middle of cake mix
    Pour jello in hole in middle
    Save 6oz. strawberries for icing - IN REFRIGERATOR
    Put 3 tablespoons of flour into cake mix in middle
    Put ¾ cup of Wesson oil into cake mix
    Pour in ¼ cup of water
    Use beater
    Add 6oz. strawberries
    Use beater
    Add 1 egg to mix - beat - continue until all 4 eggs are in mix
    Spray PAM on cooking pans
    Put butter into oven
    Bake as directed on cake box
    Take out butter
    Bake at 350 degrees
    CHECK COOKING OF CAKES 5 - 10 MINUTES EARLY
    Stick toothpick in - if it comes out clean, the cake is done
    Let cake cool

    ICING
    Put melted butter into a large bowl
    Add 2 cups of powdered/sifted sugar
    Sift & add 1 cup powdered sugar
    Stir
    Sift & add 1¼ cups of powdered sugar
    Stir
    Add few strawberries
    Stir
    Add few strawberries
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add rest of strawberries
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add 1 cup of powdered/sifted sugar
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add ¾ cup of powdered/sifted sugar
    Stir
    Add ¼ cup of powdered/sifted sugar
    Stir
    Add ¼ cup of powdered/sifted sugar
    Stir
    Add ? cup of powdered/sifted sugar
    Stir
    This should be enough sugar, but if icing is not extremely difficult to stir - add more
    Add icing AFTER CAKES HAVE COOLED
    Put icing between each layer

    From 2 lb. bag of powdered sugar, only about ½ cup is left

    Lemon Icebox Pie

    INGREDIENTS

    1 can (6 ounces) frozen lemonade concentrate - yellow
    1 tub (8 ounces) whipped topping, thawed - Cool Whip
    1 can (14 ounces) sweetened condensed milk
    1 graham cracker pie shell, purchased or homemade, 9-inch

    RECIPE

    Mix lemonade, Cool Whip, and condensed milk with mixer until all the bumps are out.
    Pour into pie crust and freeze.
    That's it!

    Tuesday, June 28, 2011

    Apache create wildcard cert and convert to Windows

    A good conversion site is:  https://www.sslshopper.com/ssl-converter.html


    Make the Apache cert:

    1.  cd /etc/httpd/conf/ssl/
    2. openssl genrsa -out wildcard.com.key 2048
      1. This generates a 2048-bit key with no password
    3. openssl req -new -key wildcard.com.key -out wildcard.com.csr
      1. Make sure your Common Name is:  *.wildcard.com
      2. Don't put a password in the extra attributes
    4. Buy the wildcard cert from a Certificate authority and use the contents of the wildcard.com.csr file to get your cert ... make sure it shows *.wildcard.com before you buy
    5. The Certificate authority will provide a zip file with the wildcard.com.crt and any intermediate certs (gd_bundle.crt)

    Create the PEM file:

    1. cat wildcard.com.key > wildcard.com.bundle.pem
    2. cat wildcard.com.crt >> wildcard.com.bundle.pem
    3. cat gd_bundle.crt >> wildcard.com.bundle.pem
    4. You now have a .pem file by the name of wildcard.com.bundle.pem

    Create a Windows usable certificate:

    1. openssl pkcs12 -export -in wildcard.com.bundle.pem -out wildcard com.bundle.p12 -name *.wildcard.com
    2. NOTE:  make sure not to put an export password
    3. You now have a wildcard.com.bundle.p12 file

    Import certificate into Windows:

    1. Login to Windows as an Administrator
    2. At the run prompt, type:  mmc
    3. File --> Add/remove add-ins
    4. Choose Certificates --> Local computer
    5. Go to the Personal --> Certificates directory
    6. Right click the Certificates directory and choose import
    7. Import the wildcard.com.bundle.p12 file (you'll need to modify the selection to see it)
    8. Mark the Certificate as Exportable
    9. Use Extended Attributes IF asked
    10. Once the import is complete, you can now go to your individual IIS sites and use the *.wildcard.com certificate

    Wednesday, September 1, 2010

    Apache rewrites

    In the virtualhost

    <VirtualHost *:80>
    ServerName domain1.com
    ServerAlias *.domain1.com
    DocumentRoot /path_to_documentroot
    ErrorDocument 404 /path_to_documentroot
    ErrorDocument 403 /path_to_documentroot
    RewriteEngine on
    redirectMatch 301 ^/$ http://www.domain2.com     ... this one only redirects the page itself ... no subdirectories
    ##redirectMatch 301 ^(.*)$ http://www.domain2.com  ... this one redirects the main page and all subpages
    ErrorLog logs/domain1.com_error_log
    CustomLog logs/domain1.com_log common
    AddType application/x-httpd-php .php .php4 .php3 .phtml .htm .html .cmh
    </VirtualHost>

    In .htaccess

    Options +FollowSymLinks
    RewriteEngine On

    RewriteCond %{REQUEST_URI} ^/subdirectory1/(.*)$
    RewriteRule ^(.*)  http://www.domain2.com/subdirectorynew [R=301,L]

    RewriteCond %{REQUEST_URI} ^/subdirectory2/(.*)$
    RewriteRule ^(.*)  http://www.domain2.com/subdirectorynew [R=301,L]

    Friday, February 12, 2010

    Fixing Exchange 2003 Permissions/Activesync

    Part 1:

    Method 2: Use Adsutil.vbs
    1. Back up your IIS Metabase. To do this, follow these steps:


      1. Start IIS Manager.
      2. Right-click Default Web Site, point to All Tasks, and then click Save Configuration to a File.

    1. Delete the virtual directories for Outlook Web Access. To do this, right-click Exadmin in the left pane of IIS Manager, and then click Delete. Click Yes when you are prompted with the question of whether you want to delete this item.

      Repeat this step for the following virtual directories:


      1. Exchange
      2. ExchWeb
      3. Microsoft-Server-ActiveSync
      4. OMA
      5. Public

    1. Quit IIS Manager.
    2. Click Start, click Run, type cmd, and then press ENTER.
    3. Change to the following folder. In this example, Drive is the hard disk drive where Windows is installed:

    Drive:\inetpub\adminscripts
    1. Type adsutil, and then press ENTER.

      Important By default, CScript is not the default scripting host for Windows Server 2003. To run the adsutil command, CScript must be configured as the default scripting host. To do this, click Yes if you are prompted to register CScript as you default host for VBscript, and then click OK.

      Note If you receive a list of adsutil command options, CScript is already configured as the default scripting host for VBscript.
    2. Type adsutil delete ds2mb, and then press ENTER.

      Note To set the default scripting host to WScript, type WScript //H:WScript at the command prompt, press ENTER, and then click OK.
    3. Click Start, point to All Programs, point to Administrative Tools, and then click Services.
    4. To restart the Microsoft Exchange System Attendant service, follow these steps:


      1. Click Start, click Run, type services.msc, and then click OK.
      2. Right-click Microsoft Exchange System Attendant, and then click Restart.
      3. When you are prompted to restart the dependant Exchange Server services, click Yes.

        Note When you restart the Microsoft Exchange System Attendant service, the Microsoft Exchange Information Store service is also restarted. In this scenario, your Exchange Server users lose connectivity to their Exchange Server mailboxes.

        The virtual directories are re-created. To verify that the virtual directories are re-created, start IIS Manager, and then view the Default Web site folder.

        Important If the virtual directories are not re-created after 15 minutes, restart the computer.

    1. Reset the access permissions to Anonymous. To do this, follow these steps:


      1. Start IIS Manager, right-click ExchWeb, click Properties, and then click the Directory Security tab.
      2. Under Authentication and access control click Edit, and then verify that the Enable anonymous access check box is turned on.
      3. Click to select the Integrated Windows authentication check box, click OK, and then click Apply.
      4. If an Inheritance Overrides dialog box appears, click Select All, and then click OK.
      5. Under Authentication and access control, click Edit, and then click to clear the Integrated Windows authentication check box.
      6. Click OK two times, and then quit IIS Manager.


    Use a Web browser to verify that you can connect to your Outlook Web Access server. If you are also running other mobility services, verify that you can connect to these services by using an appropriate client.

    Part 2:

    Add/modify a registry value to point to the exchange-oma
    1. Click Start, click Run, type regedit, and then click OK.
    2. Locate the following registry subkey:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MasSync\Parameters
    3. On the right panel, make sure ExchangeVDir points to /exchange-oma. If the value of ExchangeVDir is ExchDAV, you should change it to /exchange-oma.

    Note: the ExchangeVDir and exchange-oma are case sensitive. In the Value data box, you must enter a forward slash (/) following by exchange-oma. Click OK.
    4. If there is not ExchangeVDir, you need to create it. Right-click Parameters, click to New, and then click String Value.

    Type ExchangeVDir, and then press ENTER. Right-click ExchangeVDir, and then click Modify.
    5. Quit Registry Editor.
    6. Restart the IIS Admin service. To do this, follow these steps:
    a. Click Start, click Run, type services.msc, and then click OK.
    b. In the list of services, right-click IIS Admin service, and then click Restart.


    Part 3:

    Creating a secondary virtual directory for ActiveSync and OMA access
    1. Start Internet Information Services (IIS) Manager from Administrative Tools.
    2. Locate the Exchange virtual directory, for example, Web Sites\Default Web Site\Exchange
    3. Right-click the Exchange folder click All Tasks, and then click Save Configuration to a File.
    4. In the File name box, type a name. For example, type ExchangeVDir. Click OK.
    5. Right-click the root of this Web site. Typically, this is Default Web Site. Click New, and then click Virtual Directory (from file).
    6. In the Import Configuration dialog box, click Browse, locate the file that you created in step 4, click Open, and then click Read File.
    7. Under Select a configuration to import , click Exchange, and then click OK.

    A dialog box will appear that states that the "virtual directory already exists."
    8. In the Alias box, type a name for the new virtual directory that you want Exchange ActiveSync and Outlook Mobile Access to use. In our case, it is exchange-oma. Click OK.
    9. Right-click the new virtual directory. In this example, click exchange-oma. Click Properties.
    10. Click the Directory Security tab.
    11. Under Authentication and access control, click Edit.
    12. Make sure that only the following authentication methods are enabled, and then click OK:


    Integrated Windows authentication


    Basic authentication

    13. Under Secure communications, click Edit. Make sure that Require secure channel (SSL) is not enabled, and then click OK.
    14. Click OK, and then close the IIS Manager.