PHP
  Home arrow PHP arrow Page 7 - The Soothingly Seamless Setup of Apach...
The Best Selling PC Migration Utility.
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
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? 
PHP

The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP
By: Israel Denis Jr. and Eugene Otto
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 41
    2000-06-07

    Table of Contents:
  • The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP
  • Assumptions
  • Prerequisites
  • How it Works
  • Game Plan
  • PHP Installation (*NIX)
  • Apache
  • Testing Our Work: Is Apache working?
  • Is SSL Working?
  • Are PHP and MySQL Working Together?
  • Conclusion

  • 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

    PCmover - $15 Off with Coupon Code CJPH7Q

    The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP - Apache
    (Page 7 of 11 )

    So far so good, time to configure and install Mod_SSL and Apache. If your server is going to be in the U.S., you will need to have the rsaref-2.0 files. You can search on http://ftpsearch.lycos.com/ for "rsaref20.tar.Z" Make sure you get the *nix distribution.

    +---------------------------------------------------------------------------------------------------------+
    |IGNORE THE RSAREF SECTION IF YOU ARE NOT IN THE U.S.|
    +---------------------------------------------------------------------------------------------------------+

    Create the "rsaref" directory where you will extract the files. Note that this assumes you have downloaded to the temp directory where you are currently at.
    # mkdir rsaref-2.0
    # cd rsaref-2.0
    # gzip -dc ../rsaref20.tar.Z | tar xvf -

    Now configure and build the OpenSSL library. When you're a U.S. citizen you have to build OpenSSL in conjunction with the RSAref library.
    # cd rsaref-2.0
    # cp -rp install/unix local
    # cd local
    # make
    # mv rsaref.a librsaref.a
    # cd ../..,

    +-------------------------------------------------------------------------------------------------------------+
    |END OF THE RSAREF SECTION, PLEASE CONTINUE READING|
    +--------------------------------------------------------------------------------------------------------------+

    Time to set up OpenSSL. Remember, this is what you will use to create temporary certificates and CSR files. The "--prefix" specifies the main installation directory.

    NOTE: Only include the "-L'pwd'/../rsaref-2.0/local/rsaref -fPIC'" line if you are a U.S. citizen.
    # gunzip -dc openssl-0.9.5a.tar.gz | tar xvf -
    # cd openssl-0.9.x
    #./config --prefix=/usr/local/ssl \
    -L`pwd`/../rsaref-2.0/local/rsaref -fPIC
    Now make it, test it, and install it.
    # make
    # make test
    # make install
    # cd ..

    We will configure the Mod_SSL module and then specify it to be a loadable module with the Apache configuration.
    # gunzip -dc mod_ssl-2.6.4-1.3.12.tar.gz |tar xvf -
    # cd
    # ./configure --with-apache=../apache_1.3.12
    # cd ..


    Now we can add more Apache modules to the Apache source tree. The optional "--enable-shared=ssl" option enables the building of mod_ssl as a DSO `libssl.so." Read the INSTALL and htdocs/manual/dso.html documents in the Apache source tree for more information about DSO support in Apache. We strongly advise ISPs and package maintainers to use the DSO facility for maximum flexibility with Mod_SSL, but notice that DSO is not supported by Apache on all platforms.
    # cd apache_1.3.12
    # SSL_BASE=../openssl-0.9.x \
    RSA_BASE=../rsaref-2.0/local \
    ./configure \
    --enable-module=ssl \
    --activate-module=src/modules/php4/libphp4.a \
    --enable-module=php4 \
    --prefix=/usr/local/apache \
    --enable-shared=ssl
    [...you can add more options here...]


    Make Apache, then make certificates, and install...
    # make
    If you have done everything right you will a message similar to the following:
    +----------------------------------------------------------------------------------------------------------------+
    |Before you install the package you now should prepare the SSL|
    |certificate system by running the 'make certificate' command.|
    |For different situations the following variants are provided:|
    ||
    |% make certificate TYPE=dummy (dummy self-signed Snake Oil cert)|
    |% make certificate TYPE=test (test cert signed by Snake Oil CA)|
    |% make certificate TYPE=custom (custom cert signed by own CA)|
    |% make certificate TYPE=existing (existing cert)|
    |CRT=/path/to/your.crt [KEY=/path/to/your.key]|
    |Use TYPE=dummy when you're a vendor package maintainer,|
    |the TYPE=test when you're an admin but want to do tests only,|
    |the TYPE=custom when you're an admin willing to run a real server|
    |and TYPE=existing when you're an admin who upgrades a server.|
    |(The default is TYPE=test)|
    ||
    |Additionally add ALGO=RSA (default) or ALGO=DSA to select|
    |the signature algorithm used for the generated certificate.|
    ||
    |Use 'make certificate VIEW=1' to display the generated data.|
    ||
    |Thanks for using Apache & mod_ssl. Ralf S. Engelschall|
    |rse@engelschall.com|
    |www.engelschall.com|
    ||
    +----------------------------------------------------------------------------------------------------------------+

    Now you can create a custom certificate. This option will prompt your for location, company, and a couple other things. Certificates are explained in a separate tutorial.
    # make certificate TYPE=custom
    Now install Apache..
    # make install
    If everything went well, the message that you should see is something similar to this:
    +--------------------------------------------------------------------------------------------+
    |You now have successfully built and installed the|
    |Apache 1.3 HTTP server. To verify that Apache actually|
    |works correctly you now should first check the|
    |(initially created or preserved) configuration files|
    ||
    |/usr/local/apache/conf/httpd.conf|
    |and then you should be able to immediately fire up|
    |Apache the first time by running:|
    ||
    |/usr/local/apache/bin/apachectl start|
    |Or when you want to run it with SSL enabled use:|
    ||
    |/usr/local/apache/bin/apachectl startssl|
    |Thanks for using Apache. The Apache Group|
    |http://www.apache.org/|
    +--------------------------------------------------------------------------------------------+

    Now it's time to see if Apache and PHP are working, however, we need to edit the httpd.conf of srm.conf to ensure we added the PHP type to the configuration.

    Look at the httpd.conf and uncomment the following lines. If you have followed along with exactly the same instructions as this document, your httpd.conf file will be located in the "/usr/local/apache/conf" directory. The file has the addtype for PHP4 commented out, please uncomment it out at this time. It should look something like this:
    >
    > # And for PHP 4.x, use:
    > #
    ---> AddType application/x-httpd-php .php
    ---> AddType application/x-httpd-php-source .phps
    >
    >

    Now we are ready to start the Apache server to see if its working. First we will start the server without the SSL support to see if it comes up. We will check for PHP support and then we will stop the server and start it with the SSL support enabled and see if we got everything working. The configtest will check that all the configuration is setup properly.
    # cd /usr/local/apache/bin
    # ./apachectl configtest
    Syntax OK

    # ./apachectl start
    ./apachectl start: httpd started


    More PHP Articles
    More By Israel Denis Jr. and Eugene Otto


     

       

    PHP ARTICLES

    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway