实现LAMP编译安装
- # rpm -Uvh apr-1.4.6-1.i386.rpm apr-util-1.4.1-1.i386.rpm
- # rpm -Uvh apr-devel-1.4.6-1.i386.rpm apr-util-devel-1.4.1-1.i386.rpm
- # vim /etc/yum.repos.d/local.repo
- [base]
- name=Server
- baseurl=file:///media/Server
- gpgcheck=0
- enabled=1
- [VT]
- name=VT
- baseurl=file:///media/VT
- gpgcheck=0
- enabled=1
- [Cluster]
- name=Cluster
- baseurl=file:///media/Cluster
- gpgcheck=0
- enabled=1
- [ClusterStorage]
- name=ClusterStorage
- baseurl=file:///media/ClusterStorage
- gpgcheck=0
- enabled=1
- # tar xvf httpd-2.4.1.tar.bz2
- # cd httpd-2.4.1
- # yum install pcre-devel -y
- # yum groupinstall "Development Tools"
- # yum groupinstall "Development Libraries"
- # ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib
- # make
- # make install
- # vim /etc/httpd/httpd.conf
- PidFile "/var/run/httpd.pid"
- # vim /etc/rc.d/init.d/httpd
- #!/bin/bash
- #
- # httpd Startup script for the Apache HTTP Server
- #
- # chkconfig: - 85 15
- # description: Apache is a World Wide Web server. It is used to serve \
- # HTML files and CGI.
- # processname: httpd
- # config: /etc/httpd/conf/httpd.conf
- # config: /etc/sysconfig/httpd
- # pidfile: /var/run/httpd.pid
- # Source function library.
- . /etc/rc.d/init.d/functions
- if [ -f /etc/sysconfig/httpd ]; then
- . /etc/sysconfig/httpd
- fi
- # Start httpd in the C locale by default.
- HTTPD_LANG=${HTTPD_LANG-"C"}
- # This will prevent initlog from swallowing up a pass-phrase prompt if
- # mod_ssl needs a pass-phrase from the user.
- INITLOG_ARGS=""
- # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
- # with the thread-based "worker" MPM; BE WARNED that some modules may not
- # work correctly with a thread-based MPM; notably PHP will refuse to start.
- # Path to the apachectl script, server binary, and short-form for messages.
- apachectl=/usr/local/apache/bin/apachectl
- httpd=${HTTPD-/usr/local/apache/bin/httpd}
- prog=httpd
- pidfile=${PIDFILE-/var/run/httpd.pid}
- lockfile=${LOCKFILE-/var/lock/subsys/httpd}
- RETVAL=0
- start() {
- echo -n $"Starting $prog: "
- LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch ${lockfile}
- return $RETVAL
- }
- stop() {
- echo -n $"Stopping $prog: "
- killproc -p ${pidfile} -d 10 $httpd
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
- }
- reload() {
- echo -n $"Reloading $prog: "
- if ! LANG=$HTTPD_LANG $httpd $OPTIONS -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
- ;;
- status)
- status -p ${pidfile} $httpd
- RETVAL=$?
- ;;
- restart)
- stop
- start
- ;;
- condrestart)
- if [ -f ${pidfile} ] ; then
- stop
- start
- fi
- ;;
- reload)
- reload
- ;;
- graceful|help|configtest|fullstatus)
- $apachectl $@
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
- exit 1
- esac
- exit $RETVAL
- # chmod +x /etc/rc.d/init.d/httpd
- # chkconfig --add httpd
- # chkconfig httpd on
- # setenforce 0
- # service httpd start
- # partprobe /dev/sda
- # pvcreate /dev/sda5
- # vgcreate myvg /dev/sda5
- # lvcreate -L 2G -n mysql myvg
- # mke2fs -j /dev/myvg/mysql
- # mkdir /mydata/data -pv
- # mount /dev/myvg/mysql /mydata
- # groupadd -r mysql
- # useradd -g mysql -r -s /sbin/nologin -M -d /mydata/data mysql
- # chown -R mysql:mysql /mydata/data
- # tar xf mysql-5.5.19-linux2.6-i686.tar.gz -C /usr/local
- # cd /usr/local/
- # ln -sv mysql-5.5.19-linux2.6-i686 mysql
- # cd mysql
- # chown -R mysql:mysql .
- # scripts/mysql_install_db --user=mysql --datadir=/mydata/data
- # chown -R root .
- # cd /usr/local/mysql
- # cp support-files/my-large.cnf /etc/my.cnf
- thread_concurrency = 2
- datadir = /mydata/data
- # cd /usr/local/mysql
- # cp support-files/mysql.server /etc/rc.d/init.d/mysqld
- # chkconfig --add mysqld
- # chkconfig mysqld on
- # service mysqld start
- # vim /etc/man.config
- MANPATH /usr/local/mysql/man
- # ln -sv /usr/local/mysql/include /usr/include/mysql
- # echo '/usr/local/mysql/lib' > /etc/ld.so.conf.d/mysql.conf
- # ldconfig -v
- # vim /etc/profile
- PATH=$PATH:/usr/local/apache/bin:/usr/local/mysql/bin
- # source /etc/profile
- # rpm –ivh libmcrypt-2.5.7-5.el5.i386.rpm libmcrypt-devel-2.5.7-5.el5.i386.rpm
- # tar xf php-5.3.10.tar.bz2
- # cd php-5.3.10
- # ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt
- # make
- # make test
- # make install
- # cp php.ini-production /usr/local/php/lib/php.ini
- # vim /etc/httpd/httpd.conf
- AddType application/x-httpd-php .php
- AddType application/x-httpd-php-source .phps
- DirectoryIndex index.php index.html
- # service httpd restart
- #cd /usr/local/apache/htdocs
- #vim index.php
- <?php
- phpinfo()
- ?>