Server Administration
  Home arrow Server Administration arrow Page 3 - Generating Your Own Security Certifica...
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Download TestComplete 
JMSL Numerical Library 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SERVER ADMINISTRATION

Generating Your Own Security Certificates For Use With Apache/HTTPS
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2004-01-27

    Table of Contents:
  • Generating Your Own Security Certificates For Use With Apache/HTTPS
  • Prepare the Working Environment
  • Install OpenSSL
  • Install Apache
  • Request, Sign and Install the Certificate
  • Configure Apache
  • Start/Stop Apache

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Generating Your Own Security Certificates For Use With Apache/HTTPS - Install OpenSSL


    (Page 3 of 7 )

    Compile and install the OpenSSL toolkit.

    # cd openssl-0.9.7d
    # ./config --prefix=/usr/local/ssl
    # make && make install

    The OpenSSL toolkit implements the Secure Socket Layer and Transport Layer Security protocols and general-purpose cryptographic libraries. The Makefile's prefix parameter sets the installation directory to /usr/local/ssl. Other configuration parameters may be passed if desired.

    Configure OpenSSL.

    # vi /usr/local/ssl/ssl/openssl.cnf

    dir             =   /usr/local/ssl/CA
    certs           =   $dir/certs
    crl_dir         =   $dir/crl
    database        =   $dir/index.txt
    new_certs_dir   =   $dir/newcerts

    certificate     =  $dir/private/CA.crt
    serial          =  $dir/serial
    crl             =  $dir/CA.crl
    private_key     =  $dir/private/CA.key
    RANDFILE        =  $dir/private/.rand

    default_days    =  183
    preserve        =  yes
    policy          =  policy_anything

    OpenSSL's configuration file is openssl.cnf. The default configuration provides a good starting point; setting the options illustrated above will help provide an adequate configuration.

    Prepare the Certificate Authority (CA) directory.

    # mkdir -p /usr/local/ssl/CA/{private,newcerts}
    # cd /usr/local/ssl/CA
    # chmod 700 private
    # touch index.txt
    # echo "64" > serial

    A Certificate Authority will be needed to digitally sign and generate valid SSL certificates and it's activities will take place within the directory specified by the configuration file.

    The index.txt file keeps track of the certificates issued by the CA. The value stored in the serial file is a hexadecimal number that will be issued as the next certificate's serial number (the hex value 64 is equal to decimal value 100).

    Generate a signing key for use by the CA.

    # ../bin/openssl genrsa -des3 -out private/CA.key

    Generating RSA private key, 1024 bit long modulus
    .........++++++
    .....++++++
    e is 65537 (0x10001)
    Enter pass phrase for private/CA.key: *****
    Verifying - Enter pass phrase for private/CA.key: *****

    A 1024-bit long DES3 encrypted key is generated. It is important to keep the private key and password safe as it will be used to sign all future certificates. If the key is compromised, the integrity of the CA is compromised.

    Generate a self-signed root certificate granting the CA its authority.

    # ../bin/openssl req -new -x509 -days 999 \
    > -key private/CA.key -out private/CA.crt

    Enter pass phrase for private/CA.key: *****
    You are about to be asked to enter information that
    will be incorporated into your certificate request.
    What you are about to enter is what is called a
    a Distinguished Name or a DN.  There are quite a few
    fields but you can leave some blank.  For some fields
    there will be a default value.  If you enter '.', the
    field will be left blank.
    -----
    Country Name (2 letter code) [AU]: US
    State/Province Name (full name) [Some-State]: New York
    Locality Name (eg, city) []: Syracuse
    Organization Name (eg, company) []: .
    OrganizationalUnitName (eg, section) []: .
    Common Name (eg, YOUR name) []: Timothy Boronczyk
    Email Address []: mail@example.com

    OpenSSL is used to request and sign a new x509 certificate with the previously generated key. This grants the CA the ability to sign future certificate requests.

    More Server Administration Articles
    More By bluephoenix


       · Are we missing somthing? Looks like the tutorial and PDF are truncated at step...
       · 
       · I contacted Matt... all fixed! Thanks!-Tim
       · Hi,I already do like your manual here but i have problem on final step...
       · Volume,I've had that message once before on an internal machine I've set up for...
     

    SERVER ADMINISTRATION ARTICLES

    - Developing a Contingency Plan
    - Implementing an Information Security Managem...
    - HTTP State Management with Cookies
    - Information Security Standards
    - IP Network Scanning and Security Reconnaissa...
    - An Overview of Open Source Security
    - An Overview of Free Network Scanning Tools
    - Information Security: A Coherent Approach
    - Advanced IP Network Scanning Methods
    - Using Emulation and More to Analyze Network ...
    - Third Party IP Network Scanning Methods
    - Methods of IP Network Scanning
    - IP Network Scanning
    - sendmail Security Options
    - Security Features of sendmail





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT