Apache
  Home arrow Apache arrow Page 6 - Getting Started with Apache 2.0, Part ...
Dev Shed Forums 
Administration  
AJAX  
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 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
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: 4 stars4 stars4 stars4 stars4 stars / 26
    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:
      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


    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


       · It is great to see some documentation on how to get started with Apache, as I was...
       · Hi there,What is the issue that you are facing with the installation of Apache?...
     

       

    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-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway