-
July 8th, 2002, 05:14 PM
#1
Installing Apache (1.3.22) and PHP (4.1.1)
Installing Apache With PHP
==========================
This tutorial assumes PHP 4 and Apache 1.3x are being installed on a
Linux system.
It also assumes that either MySQL or PostgreSQL have already been
installed.
1. Download Apache
------------------
Download the apache source in .tar.gz format from http://httpd.apache.org.
If you download Apache 2, bear in mind that you may need to change the
version numbers accordingly in all of the commands for the installation
section.
2. Download PHP
---------------
Download the PHP source from http://www.php.net in .tar.gz format.
If you download a different version to the one used in this tutorial,
remember to change the version numbers accordingly when executing commands
for the installation procedure.
3. Pre-Install
--------------
Copy both .tar.gz files to the same directory
Ensure you are logged in as a user with enough privileges to compile
software (most users are).
4. Extract The Archives
-----------------------
run the following commands:
Code:
tar xfz- apache_1.3.22.tar.gz
tar xfz- php-4.11.tar.gz
This *should* be the same as:
Code:
gunzip -c apache_1.3.22.tar.gz | tar xf -
gunzip -c php-4.11.tar.gz | tar xf -
5. Configure Apache
-------------------
Type the following:
Code:
cd ./apache_1.3.22
./configure --prefix=/usr/local/apache
6. Configure PHP
----------------
To configure with MySQL, type the following:
Code:
cd ../php-4.1.1
./configure --with-apache=../apache_1.3.22 --enable-inline-optimization
--with-mysql=/usr
If you use PostgreSQL, type:
Code:
cd ../php-4.1.1
./configure --with-apache=../apache_1.3.22 --enable-inline-optimization
--with-pgsql=/usr
In both cases, remember to change the =/usr to the directory where the
MySQL or PostgreSQL directory can be found, e.g. if PostgreSQL is
installed in /usr/local/pgsql, you will type /usr/local.
7. Build And Install PHP
------------------------
Type the following:
Once this has run, the compiled Apache PHP module will be copied to the
Apache source directory, and the PEAR libraries will be installed in an
appropriate place.
8. Reconfigure Apache
---------------------
You now need to reconfigure Apache, telling it about the PHP module:
Code:
cd ../apache_1.3.22
./configure --prefix=/usr/local/apache
--activate-module=src/modules/php4/libphp4.a
9. Compile Apache
-----------------
Apache can now be compiled and installed using the following:
10. Configure Apache
--------------------
Configure Apache's httpd.conf file, which should be located at
/usr/local/apache/conf/httpd.conf
You will need to set your particular options depending on your server, see
the Apache documentation for more details.
You will also need to add the following line to the httpd.conf:
Code:
AddType application/x-httpd-php .php
You may also want to edit the line that says:
Code:
DirectoryIndex index.html
to read:
Code:
DirectoryIndex index.html index.php
11. Check PHP Configuration
---------------------------
There should be a file called php.ini somewhere in the directory tree
under which PHP installed itself, probably /usr/local/php.
Check this file for settings you may need to change, although the default
file is fine for most purposes. Some security-minded people may wish to
disable certain options.
12. Start Apache
----------------
Start apache as follows:
Code:
su
/usr/local/apache/bin/apachectl start
A. Appendix A - Stopping Apache
-------------------------------
If you need to stop apache, type:
Code:
su
/usr/local/apache/bin/apachectl stop
B. Appendix B - Installing PHP Into An Existing Apache
------------------------------------------------------
If you already have a working installation of Apache, and do not want to
spend hours reconfiguring, you can simply change the ./configure line of
the PHP configuration to:
Code:
./configure --with-apxs --enable-inline-optimization --with-mysql=/usr
Remember to change the mysql to pgsql if you use PostgreSQL, and to change
the /usr to the relevant path for your system.
If you have done this, you do not need to configure or build Apache, the
PHP module will be installed with the apxs script into your existing
Apache server.
Remember that you will still need to add the line:
Code:
AddType application/x-httpd-php .php
and:
Code:
DirectoryIndex index.html index.php
to your httpd.conf file.
C. Appendix C - About This Document
-----------------------------------
Author: Andrew Bennieston
Date: 08-07-2002
Time: 17:07
Distribution: AntiOnline, Firestorm UK
-
July 8th, 2002, 05:19 PM
#2
ZIP File
Zip file of the tutorial, in text format, without the site codes (e.g. [code])
-
July 8th, 2002, 05:54 PM
#3
Err.. all versions below 1.3.26 have a serious bug, as reported on several threads on this site. Be sure to use any version >= 1.3.26, and not 1.3.22.
httpd.Apache.org:
SECURITY ADVISORY: June 20, 2002
(...) Due to the existence of exploits circulating in the wild for some platforms, the risk is considered high. The Apache Software Foundation has released versions 1.3.26 and 2.0.39 that address and fix this issue, and all users are urged to upgrade immediately. These versions are available for download; see below. (...)
I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.
-
July 8th, 2002, 06:00 PM
#4
That is why I mentioned the different version numbers... Personally I use Apache 1.3.26
I also downloaded 2.x yesterday but haven't got round to installing it yet.
-
July 11th, 2002, 10:48 PM
#5
Awesome. Soon Im going to write a tutorial on Installing Apache with PHP, MySQL, phpBB, and a few others on both a Windows and Linux system.
-
July 11th, 2002, 11:37 PM
#6
Banned
Um, JC, for windows there are precompiled apache binaries. All you gotta do is click and have fun. Plus they have crazy documentation when you install on apache issues.
And MySql has its own installer for windows.
EDIT:Added in the mysql installer thing
But PhpBB would be cool though. ANd helpful for member looking to start their own online communities.
-
July 13th, 2002, 02:53 PM
#7
Great Tutorial Rewandythal... This has prompted me to begin a similar project that might please all of you.
PhpBB would be cool though. ANd helpful for member looking to start their own online communities.
Awesome. Soon Im going to write a tutorial on Installing Apache with PHP, MySQL, phpBB, and a few others on both a Windows and Linux system.
I will be working on a Win2000Server box that I intend to install Apache 2.0.39, MySQL-Max 3.23.51, and Invision Board ver 10-final. Before I dive into this project head first
does anyone have any quick suggestions for my future config??
If not...Who knows? There might even be a tutorial from my newbie self on this subject...ya think?
I have a question; are you the bug, or the windshield?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|