Several friends asked how to add PHP support to Redhat's own Apache, so I came up with this article

Source: Internet
Author: User
Tags linux
Apache Setup steps for running Perl and PHP3 programs directly under the Redhat 6.0+apache Web server
(Excerpt from the Computer World)

----Apache server is currently the world's most common web site software, in the UNIX environment to build a site will generally use the Apache server. Generally foreign commercial websites will use High-performance, high-capacity UNIX high-end server plus the Apache server. In the field of professional Web application development, the Perl language is currently the most common language for CGI application development, and when it comes to database development, we often use PHP3 programming to implement the application function.
----in the design process of Apache, there is dynamic loading module design idea, so that after the editing of the server background program is very small, the author under the Redhat6.0 of the Apache 1.3.6 dynamic loading module compiled and static loading module compiled, In the case of dynamic loading, the server daemon only has about 165K, while the static loading module, according to the number of loading modules, generally in the 800k-2m range. Fortunately, the Redhat 6.0 version of the default Apache server is the dynamic loading module compilation. However, Mod_perl and mod_php3 are not loaded, so you must first start the two modules before you develop Web applications.

----The author here to the start step summary of the following to facilitate the use of Linux for Web application development users.

----1: Install apache_1.3.6 and mod_perl, MOD_PHP3 modules

Mount–t Iso9660/dev/cdrom/mnt/cdrom
rpm–i/mnt/cdrom/redhat/rpms/apache*.rpm
rpm–i/mnt/cdrom/redhat/rpms/mod_perl*.rpm
rpm–i/mnt/cdrom/redhat/rpms/mod_php3*.rpm

----2: Edit/etc/httpd/conf/httpd.conf to set up the dynamic loading module and remove the annotation characters from the following lines. Note that the order of the statements should be the same as given below, and if not, adjustments should be made.
#LoadModule Perl_module modules/libperl.so
#LoadModule Php3_module modules/libphp3.so
#AddModule MOD_PERL.C
#AddModule mod_php3.c

----3: Edit/etc/httpd/conf/srm.conf to set the MIME type and location of the Perl program so that the server can identify Perl and PHP3 programs that are executed on the server side before being sent to the client browser. Remove the annotation characters from the following lines.
#AddType application/x-httpd-php3. php3
#AddType application/x-httpd-php. phtml

#Alias/perl//home/httpd/perl/
#< Location/perl >
# ....
# ...
#</location >

----4: Restart the background program
KILL–USR1 ' Cat/var/run/httpd.pid '
To see if it really has started.
# Ps-a | grep httpd
11180? 00:00:07 httpd
11263? 00:00:00 httpd
.....

----5: Testing the test procedure brought with the Mod_perl module
Mkdir/home/httpd/perl
Cp–r/usr/doc/mod_perl-1.19/eg/home/httpd/perl
chmod 755/home/httpd/perl/eg/*

----Start the browser, type the connection address http://localhost/perl/eg/registry.pl, when you see the form like the following output indicates that your module has been installed successfully.
Date:tue Mar 7 10:14:30 2000
%env:
Server_software = apache/1.3.6 (Unix)
(Red hat/linux) mod_perl/1.19
Gateway_interface = cgi-perl/1.1
Document_root =/home/httpd/html
Perl_send_header = On
REMOTE_ADDR = 10.110.1.45
.....


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.