Linux source code installation apache+mysql+php5 and several forums installed

  
 

1, Ready to work

Download the latest version of apache software httpd-2.2.17.tar.bz2

Download mysql software mysql-5.1.50-linux-i686-glibc23.tar .gz

Download php software php-5.3.5.tar.bz2

Download wordpress blog installation software wordpress-3.0.4-zh_CN.zip

Download forum installation software phpwind_GBK_8.3.zip and other software

2, install apache software

(1) extract apache software

#tar –jxf httpd-2.2.17.tar.bz2

#cd httpd-2.2.17

(2) Configure source./configure –prefix=/usr/local/apache –sysconfdir=/etc/httpd –enable-so –enable-modules=most –enable-mod-shared=most –enable-proxy –enable-rewrite

where –prefix=/usr/local/apache refers to the installation location of apache Set the location of the apache configuration file for /usr/local/apache

--sysconfdir=/etc/httpd

--enble-so Let appache load dso function

--enable-modules=most Let apache load most modules

--enable-mod-shared=most Compile most modules into dso

--enable -rewrite Enable apache overloading function

--enable-proxy Enable apache proxy function


(3) Compile apache source

#make

(4) Install apache

#Make install

(5) Set the environment variable and the link of the apache library file header file help file, etc.

A, set the environment variable

#vim /etc/profile Open the /etc/profile file

Add a line PATH=$PATH:/usr/local/apache/binSave and exit

B, link apche header file

#ln –sv /usr/local/apache/include /usr/include/httpd

C, link apache library file to system library file< Br>

#vim /etc/ld.so.d/httpd.conf

Enter /usr/local/apache/lib

in the documentation and save and exit

(6) Create httpd startup file

Vim /etc/rc.d/init.d/httpd

Enter the following code in the file

#!/Bin/bash

. /etc/rc.d/init.d/functions

apachectl='/usr/local/apache/bin/apachectl'

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

prog=httpd

pidfile=${PIDFILE-/usr/local/apache/logs/httpd.pid}

lockfile=${LOCKFI LE-/var/lock/subsys/httpd}

RETVAL=0

start() {

echo -n $"Starting $prog: "

daemon --pidfile=${pidfile} $httpd $OPTIONS

RETVAL=$?

echo

[ $RETVAL = 0 ] && Touch ${lockfile}

return $RETVAL

}

stop() {

echo -n $"Stopping $prog: "< Br>

killproc -p ${pidfile} -d 10 $httpd

RETVAL=$?

echo

[ $RETVAL = 0 ] && Rm -f ${lockfile} ${pidfile}

}

reload() {

echo -n $"Reloading $prog: "

if ! $httpd -t >&/dev/null; then

RETVAL=$?

echo $"not reloading due to configuration syntax error"

failure $"not reloading $httpd due to configuration syntax error"

else

killproc -p ${pidfile} $httpd -HUP

RETVAL=$?

fi

echo

}


# See how we were called.

case "$1 " in

start)

start

;;

stop)

stop

;;< Br>

status)

status -p ${pi Dfile} $httpd

RETVAL=$?

;;

restart)

stop

start

;;

condrestart)

if [ -f ${pidfile} ] ; then

stop

start

fi

;;

reload)

reload

;;

graceful

Copyright © Windows knowledge All Rights Reserved