Apache
  Home arrow Apache arrow Page 6 - Getting Started with Apache 2.0, Part 1
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
APACHE

Getting Started with Apache 2.0, Part 1
By: Harish Kamath
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 27
    2005-03-07


    Table of Contents:
  • Getting Started with Apache 2.0, Part 1
  • Getting Off the Blocks
  • Compiling Apache
  • Configuration Options
  • The "httpd.conf" Configuration File: a Quick Overview
  • PHP 5.0.3 with Apache 2.0.52
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    Getting Started with Apache 2.0, Part 1 - PHP 5.0.3 with Apache 2.0.52
    ( Page 6 of 7 )

    At the onset, I promised that I would demonstrate how to configure PHP 5.0 with Apache 2.0  - and I always keep my promises!

    Before I continue any further, I must highlight a warning by "The PHP Group" that the combination of PHP and Apache 2.0 is not recommended in a production environment. You can read the reasons behind this "stern" warning in the official PHP FAQ:
    http://www.php.net/manual/en/faq.installation.php#
    faq.installation.apache2

    And if you are still not satisfied, read this interesting discussion at the following URL:
    http://simon.incutio.com/archive/2004/03/31/phpAndApache2

    If you are still looking to get your hands dirty with this combination, despite all my warnings and caveats - welcome aboard.

    This is where you must run a quick check on your existing Apache installation: did you build it to load modules dynamically by specifying the "--enable-so" option? If not, quickly fire the following commands to get moving:

    $ cd /usr/local/src/httpd-2.0.52/

    $ ./configure --prefix=/usr/local/apache --enable-so

    $ make

    $ make install

    I'll also assume that you've already installed the following:

    Next, you'll need to download the source code for the latest version of PHP (currently 5.0.3) from the following URL: http://www.php.net/downloads.php.

    Unzip the PHP 5 source code on your server and run the "configure" command as shown below.


     
    $ cd /usr/local/sac/

    $ tar -xzvf /tmp/php-5.0.3.tar.gz

    $ cd php-5.0.3/

    $ ./configure --prefix=/usr/local/php5 --with-
    apxs2=/usr/local/apache/bin/apes --with-
    mysql=/usr/local/mysql --with-glib --with-dir-
    dir=/usr/local/lib

    Note that I have not enabled many PHP libraries in the above "configure" command. If you plan to use them extensively, it would be wise to review the options that are listed at this URL: http://in.php.net/manual/en/configure.php, before moving ahead. Note that these options have been listed for PHP 4 compilation; however, they should work for PHP 5 also.

    Now, you'll have to run the "make" and "make install" commands.

    $ make

    $ make install

    Ready to rock-n-roll? Not so fast. There is still one last bit of configuration of the Apache Web server that enables it to identify PHP files and pass them to the PHP module for interpretation. This is only possible by editing the ubiquitous "httpd.conf" Apache configuration file in your favorite text editor and adding the following line:

    AddType application/x-httpd-php .php

    Now, you can re-start Apache using the "apachectl" script and load the following "phpinfo.php" script (saved in the root folder of the Web server) in a browser:

    <?php

    phpinfo();

    ?>

    Instead of getting a screen full of cryptic error messages or warnings, if you get the following screen, rest assured that you have successfully installed PHP 5.0 with Apache 2.0.



    Finally, you can visit the following URL if you wish to learn more about installing PHP with Apache 2.0:
    http://in.php.net/manual/en/install.unix.apache2.php.



     
     
    >>> More Apache Articles          >>> More By Harish Kamath
     

       

    APACHE ARTICLES

    - Creating a VAMP (Vista, Apache, MySQL, PHP) ...
    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...





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