Home php教程 php手册 好几位朋友都问到,如何在redhat自带的apache中加入PHP的支持,所以我找来了这篇文章

好几位朋友都问到,如何在redhat自带的apache中加入PHP的支持,所以我找来了这篇文章

Jun 21, 2016 am 09:13 AM
apache httpd mod nbsp perl

apache

在RedHat 6.0+Apache web服务器下直接运行perl程序与php3程序的设置步骤
(摘自计算机世界)

---- Apache服务器是目前世界上建立网站的最常用软件,在UNIX环境下建立网站一般都会采用Apache服务器。一般国外的商业网站都会采用高性能、大容量的UNIX高端服务器加上 Apache服务器。而在专业WEB应用开发领域,Perl语言是目前实现CGI应用开发的最常用语言,在牵涉到数据库开发时,我们常常又会使用PHP3编程实现应用功能。
---- 在Apache的设计过程中,就有动态加载模块的设计思想,这样使得编辑后的服务器后台程序很小,笔者在Redhat6.0下对Apache 1.3.6分别进行了动态加载模块编译和静态加载模块编译,在动态加载情况下服务器后台程序才有165K左右,而静态加载模块,根据加载模块的多少,一般在800K-2M范围。好在RedHat 6.0的发行版带的默认Apache服务器就是动态加载模块编译。不过并没有加载mod_perl与mod_php3,因此,在进行WEB应用开发前必须首先启动这两个模块。

---- 笔者在这里把启动步骤大约总结以下,以方便有志于使用LINUX进行WEB应用开发的网友们。

---- 1:安装Apache_1.3.6与mod_perl、mod_php3模块

  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:编辑/etc/httpd/conf/httpd.conf以设置动态加载模块,将下面几行的注释符#删除。注意,语句的顺序应当与下面给出的相同,如果不对,应进行调整。
  #LoadModule perl_module modules/libperl.so
  #LoadModule php3_module modules/libphp3.so
  #AddModule mod_perl.c
  #AddModule mod_php3.c

---- 3: 编辑/etc/httpd/conf/srm.conf以设置MIME类型和Perl程序的位置,使服务器可以辨认出Perl及php3程序,在发送给客户端浏览器前先在服务器端执行。将下面几行的注释符#删除。
  #AddType application/x-httpd-php3 .php3
  #AddType application/x-httpd-php .phtml
  
  #Alias /perl/ /home/httpd/perl/
  #
  # ….
  # …
  #

---- 4:重新启动后台程序
  kill –USR1 `cat /var/run/httpd.pid`
看看是否真的已经启动。
# ps -A | grep httpd
11180 ?        00:00:07 httpd
11263 ?        00:00:00 httpd
…..

---- 5:测试随mod_perl模块带来的测试程序
mkdir /home/httpd/perl
cp –R /usr/doc/mod_perl-1.19/eg /home/httpd/perl
chmod 755 /home/httpd/perl/eg/*

---- 启动浏览器,敲入连接地址http://localhost/perl/eg/registry.pl,当看到形如下面的输出时说明你的模块已经安装成功了。
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
…..



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Cyberpunk 2077 sees up to a 40% performance boost with new optimized path tracing mod Cyberpunk 2077 sees up to a 40% performance boost with new optimized path tracing mod Aug 10, 2024 pm 09:45 PM

One of the standout features ofCyberpunk 2077is path tracing, but it can put a heavy toll on performance. Even systems with reasonably capable graphics cards, such as the RTX 4080 (Gigabyte AERO OC curr. $949.99 on Amazon), struggle to offer a stable

Rabbit R1 gets modded to run games, performs better than expected Rabbit R1 gets modded to run games, performs better than expected Jun 29, 2024 am 07:50 AM

Earlier this month, a YouTuber named HowToMen showcased the Rabbit R1 running Android. With this mod, the device that was originally meant to be less distracting than a phone got to function like one. That isn't a bad thing, though, as Rabbit didn't

PHP Framework Performance Comparison: The Ultimate Showdown of Speed ​​vs. Efficiency PHP Framework Performance Comparison: The Ultimate Showdown of Speed ​​vs. Efficiency Apr 30, 2024 pm 12:27 PM

According to benchmarks, Laravel excels in page loading speed and database queries, while CodeIgniter excels in data processing. When choosing a PHP framework, you should consider application size, traffic patterns, and development team skills.

DIY Asus ROG Ally mod nearly doubles the battery capacity without leaving anything exposed DIY Asus ROG Ally mod nearly doubles the battery capacity without leaving anything exposed Aug 20, 2024 am 06:57 AM

The Asus ROG Ally features a 40 Wh battery, which typically results in about two hours of runtime. On the Ally X, however, Asus upgraded the battery to 80 Wh, pushing the battery life to around four hours, depending on the TDP. iFixit came up with a

How to conduct concurrency testing and debugging in Java concurrent programming? How to conduct concurrency testing and debugging in Java concurrent programming? May 09, 2024 am 09:33 AM

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

The evasive module protects your website from application layer DOS attacks The evasive module protects your website from application layer DOS attacks Apr 30, 2024 pm 05:34 PM

There are a variety of attack methods that can take a website offline, and the more complex methods involve technical knowledge of databases and programming. A simpler method is called a "DenialOfService" (DOS) attack. The name of this attack method comes from its intention: to cause normal service requests from ordinary customers or website visitors to be denied. Generally speaking, there are two forms of DOS attacks: the third and fourth layers of the OSI model, that is, the network layer attack. The seventh layer of the OSI model, that is, the application layer attack. The first type of DOS attack - the network layer, occurs when a large number of of junk traffic flows to the web server. When spam traffic exceeds the network's ability to handle it, the website goes down. The second type of DOS attack is at the application layer and uses combined

How to add a server in eclipse How to add a server in eclipse May 05, 2024 pm 07:27 PM

To add a server to Eclipse, follow these steps: Create a server runtime environment Configure the server Create a server instance Select the server runtime environment Configure the server instance Start the server deployment project

Application of algorithms in the construction of 58 portrait platform Application of algorithms in the construction of 58 portrait platform May 09, 2024 am 09:01 AM

1. Background of the Construction of 58 Portraits Platform First of all, I would like to share with you the background of the construction of the 58 Portrait Platform. 1. The traditional thinking of the traditional profiling platform is no longer enough. Building a user profiling platform relies on data warehouse modeling capabilities to integrate data from multiple business lines to build accurate user portraits; it also requires data mining to understand user behavior, interests and needs, and provide algorithms. side capabilities; finally, it also needs to have data platform capabilities to efficiently store, query and share user profile data and provide profile services. The main difference between a self-built business profiling platform and a middle-office profiling platform is that the self-built profiling platform serves a single business line and can be customized on demand; the mid-office platform serves multiple business lines, has complex modeling, and provides more general capabilities. 2.58 User portraits of the background of Zhongtai portrait construction

See all articles