Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Source code installation httpd2.4.4

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Don't gossip and get to the point.

Prepare the tool

Httpd_-2.4.4.tar.bz2

Apr-1.4.6.tar.gz (a portable runtime for apache)

Apr-util-1.5.1.tar.gz

Mkdir / mnt/cdrom

Mount / dev/cdrom / mnt/cdrom/ (establish CD mount point)

Cd / mnt/cdrom/Server/

Ll apr*

Rpm-ivh apr-devel-1.2.7-11.e15_3.1.i386.rpm (install apr development package)

Install the apr-1.4.6 runtime

Tar-zxvf apr-1.4.6.tar.gz-C/usr/local/src/

Cd / usr/local/src/apr-1.4.6/

Configure apr-1.4.6

Ll

Less README

. / configure (installed by default to the automatically generated apr directory under the / usr/local directory)

Make

Make install

Cd

Install apr-util-1.5.1

Tar-zxvf apr-util-1.5.1.tar.gz-C / usr/local/src/

Cd / usr/local/src/apr-util-1.5.1/

Ll

Ls

. / configure

. / configure-- with- apr=/usr/local/apr/bin/apr-1-config (to specify the full path to apr-config)

Make

Make install

Cd

Install pcre and its development package (don't ask why you install this, it will be a problem if you don't install it. )

Ll / mnt/cdrom/Server/pcre*

Rpm-ivh / mnt/cdrom/Server/pcre-6.6-2.el5_1.7.i386.rpm

Rpm-ivh / mnt/cdrom/Server/pcre-devel-6.6-2.e15_1.7.i386.rpm

Install http2.4.4

Tar-jxvf httpd-2.4.4.tar.bz2-C / usr/local/src/

Cd / usr/local/src/httpd-2.4.4/

Cd / usr/local/apr

Vim / etc/ld.so.conf.d/apr.conf

Write path / usr/local/apr/lib (let the system call the runtime)

Ldconfig loading

. / configure-- prefix=/usr/local/apache-- sysconfdir=/etc/httpd (configuration file directory)-- with-apr=/usr/local/apr/bin/apr-1-config (to specify the full path to apr-config)

Make

Make install

Cd / usr/local/

Cd bin/

. / apachectl start

Netstat-tupln | grep 80 (check whether port 80 is enabled)

Apachectl is called at this time, so we want to call our own script to start apache?

Then write a script.

Cd / etc/init.d

Vim httpd

#! / bin/bash

# descriptionion: httpd server

# chkconfig:-88 90

HTTPD='/usr/local/apache/bin/httpd'

CONFFILE='etc/httpd/httpd.conf'

. / etc/init.d/FUNCTIONS

Start () {

[- f / var/lock/subsys/http] & & echo "httpd is starting...."

Echo-n "httpd is starting."

Sleep 1

$HTTPD-f $CONFFILE & & RETVAL=0 | | RETVAL=1

[$RETVAL-eq 0] & & touch / var/lock/subsys/http & & echo-e "\ 033 [31m [ok]\ 033 [0m" | | echo-e "\ 033 [31m [fail]\ 033 [0m"

}

Stop () {

Echo-n "httpd is stoping."

Sleep 1

Killproc httpd & & RETVAL=0 | | RETVAL=1

[$RETVAL-eq 0] & & rm-rf / var/lock/subsys/http | | echo-e "\ 033 [31m [fail]\ 033 [0m"

}

Case $1 in

Start)

Start

Stop)

Stop

Restart)

Stop

Start

*)

Echo "Usage:start | stop | restart"

Esac

Chmod axix httpd

Chkconfig-add httpd (set the httpd service to boot automatically)

End

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report