When Apache was developed in early 1995, it was modified by the code of NCSA HTTPd 1.3, the most popular HTTP server at that time, so it was a server. RHEL 4 is a stable system, so it is essential to install apache in RHEL 4.
Previously installed in rh9 and now installed apache once in RHEL 4. To be honest, the configuration is not complicated, but you have to pay attention to some details.
Preparations:
1. RHEL4 is newly installed. Due to the latest version, apache, php, and mysql of RHEL4 are not installed. Only the Development Kit gcc is installed. After that, download the latest version of each suite for manual installation.
2. Download the related software packages. The software package list and version are as follows:
Httpd-2.2.4.tar.gz
Php-5.2.1.tar.gz
Non-free software ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz, account can be downloaded)
MySQL-client-standard-4.1.22-0.rhel4.i386.rpm
MySQL-devel-standard-4.1.22-0.rhel4.i386.rpm
MySQL-server-standard-4.1.22-0.rhel4.i386.rpm
MySQL-shared-compat-4.1.22-0.rhel4.i386.rpm
MySQL-shared-standard-4.1.22-0.rhel4.i386.rpm
Note that mysql should be fully packaged, otherwise the dependency check error will be reported.
3. Start to install each software package, in the order of mysql ---- apache ---- php ---- Configuration Service ---- ZendOptimize. You need to select the path to install it in/usr/local.
1. Install Mysql in an rpm package. Run the rpm-ivh command to install Mysql in sequence. If the dependency check is incorrect, replace the installation package. You can add a user to test the installation package.
Mysqladmin-u root password "123456"
Ii. Installing apache in RHEL 4 is a compressed source code package. You need to decompress the package and then manually compile and install it. The process is as follows:
Tar-zxvf httpd-2.2.4.tar.gz (unpackage)
Cd httpd-2.2.4 (go to directory)
./Configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite
(. /Configure -- prefix =/usr/local/apache2 is to set the installation path, -- enable-so is to dynamically mount the SO library to support cgi functions, -- enable-rewrite, activate rewrite Records)
Make & make install compilation and installation)
3. install php as follows:
Tar zxvf php-5.2.1.tar.gz (unpack)
Cd php-5.2. (go to the directory)
./Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql -- with-zlib
(. /Configure -- prefix =/usr/local/php indicates the installation path, -- with-apxs2 =/usr/local/apache2/bin/apxs is used to provide Apache server configuration information to other modules. The auxiliary script apxs is located in the bin directory under the Apache installation path. -- with-mysql is used to set up the PHP module supported by the MySQL client. You can choose to add -- with-zlib to activate zlib to optimize PHP)
Make & make install compilation and installation)
Cp php. ini-dist/urs/local/lib/php. ini copy the initial PHP file of the template to a place that can be found by PHP and name it php. ini)
4. install apache in RHEL 4 and edit the apache configuration file httpd. conf:
The httpd. conf file is located in the conf directory under the Apache installation path. For example, the directory below is/usr/local/apache/conf.
# Cd/usr/local/apache/conf
# Vi httpd. conf
In this way, the file is opened and the following parts are Edited:
* Modify the ServerName and add the server name.
* Identify and run the PHP script to tell Apache the suffix of a common file. It is used to identify the PHP script in the future and continue to find the following comments and instructions in the file:
# AddType allows you to tweak mime. types without actually editing it, or
# Make certain files to be certain types.
# AddType application/x-tar. tgz
Add two lines of text after this
AddType application/x-httpd-php. php. phtml
AddType application/x-httpd-php-source. phps
This is used to identify. php and. phtml files.
* Find DirectoryIndex index.html, and add index. php to the end to make index. php a response page.
* Find DocumentRoot "/usr/local/apache2/htdocs"
Change/usr/local/apache2/htdocs to the path where your webpage files are stored.
* Change the following username and group
User apache
Group apache
Save the httpd. conf file.
Start and end an Apache server
#/Usr/local/apache/bin/apachectl stop
#/Usr/local/apache/bin/apachectl start
Edit a test page
Content:
Save the. php file to/usr/local/apache2/htdocs to test the server.
5. Install ZendOptimizer to optimize the php service.
Tar-zxvf ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz
Cd ZendOptimizer-3.2.6-linux-glibc21-i386
./Install. sh
In this article, the author not only introduces the detailed steps for installing apache in RHEL 4, but also introduces other necessary software in RHEL 4, hope to help you.
- Set up the Samba server of ORACLE11g with RHELRHEL 5
- Rhelrhel ftp Server SETUP steps and Problem Analysis (1)
- RHELRHEL 5 is a perfect combination of FTP
- Problem Analysis: in this way, use RHELRHEL 4 to configure Postfix in four perfect steps
- Seven steps for RHEL to set up RHEL4 system Sendmail