- yum groupinstall -y "Development Libraries" "Development Tools" "X Software Development"
- lftp 172.16.0.1/pub/Sources/new_lamp 只限此实验环境内,可去官网下载哦
- mget apr-1.4.6.tar.bz2 apr-util-1.4.1.tar.bz2
- # tar xf apr-1.4.6.tar.bz2
- # cd apr-1.4.6
- # ./configure --prefix=/usr/local/apr
- # make && make install
- # tar xf apr-util-1.4.1.tar.bz2
- # cd apr-util-1.4.1
- #./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
- # make && make install
- #yum install pcre-devel -y
- #yum install openssl-devel -y
- #tar xf httpd-2.4.3.tar.bz2
- #cd httpd-2.4.3
- # ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-mpm:s-shared=all --with-mpm=event
- # make && make install
- vim /etc/httpd/httpd.conf,添加如下行即可:
- PidFile "/var/run/httpd.pid"
- #!/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
- # vim /etc/httpd/httpd.conf
- 注释下列信息(默认设置为所有拒绝访问,这里需要注释掉)
- #<Directory />
- # AllowOverride none
- # Require all denied
- #</Directory>
- 启用:
- Include /etc/httpd/extra/httpd-vhosts.conf
- 编辑:
- # vim /etc/httpd/extra/httpd-vhosts.conf
- 注释原来信息添加新信息
- <VirtualHost *:80>
- ServerAdmin admin.magedu.com
- DocumentRoot "/web/vhosts/www1"
- ServerName www1.magedu.com
- ErrorLog "/var/log/httpd/www1.err"
- CustomLog "/var/log/httpd/www1.access" common
- <Location /server-status> 此处为server-status输出的信息
- SetHandler server-status
- AllowOverride Authconfig
- AuthType Basic
- AuthName "Limit..."
- AuthUserFile "/web/users"
- Require valid-user
- </Location>
- <Directory /web/vhosts/www1>
- Order Deny,Allow
- Deny from all
- Allow from 172.16.0.0/16
- </Directory>
- </VirtualHost>
- <VirtualHost 172.16.8.1:80>
- ServerAdmin admin.magedu.com
- DocumentRoot "/web/vhosts/www2"
- ServerName www2.magedu.com
- ErrorLog "/var/log/httpd/www2.err"
- CustomLog "/var/log/httpd/www2.access" common
- <Directory "/var/www/html/www2">
- Allow from all
- </Directory>
- </VirtualHost>
- # mkdir -pv /var/log/httpd
- #mkdir -pv /web/vhosts/www2
- #mkdir -pv /web/vhosts/www1
- #echo "www1.magedu.com" > /web/vhosts/www1/index.html
- #echo "www2.magedu.com" > /web/vhosts/www2/index.html
- 首先定义环境变量:
- #echo "export PATH=$PATH:/usr/local/apache/bin" > /etc/profile.d/httpd.sh
- #. /etc/profile
- htpasswd -c -m /web/users status
- htpasswd : -c 第一次创建的时候使用,以后再用表示覆盖源文件
- 账号密码为status:status
- # mkdir -p /mydata/data
- # 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.28-linux2.6-i686.tar.gz -C /usr/local/
- # cd /usr/local/
- # ln -sv mysql-5.5.28-linux2.6-i686/ /usr/local/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
- 查看更改配置文件:
- # vim /etc/my.cnf
- 更改
- thread_concurrency = 2 //第39行
- datadir = /mydata/data //新加一行
- # cd /usr/local/mysql
- # cp support-files/mysql.server /etc/rc.d/init.d/mysqld
- # chmod +x /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
- # vim /etc/profile.d/mysql.sh 添加如下
- export PATH=$PATH:/usr/local/apache/bin:/usr/local/mysql/bin
- # . /etc/profile
- # service mysqld start 重新启动
- # mysql 确认mysql正常运行(quit退出)
- # mysqladmin -uroot -p password
- 123456
- libmcrypt-2.5.7-5.el5.centos.i386.rpm
- libmcrypt-devel-2.5.5-5.el5.centos.i386.rpm
- mhash-0.9.2-6.el5.centos.i386.rpm
- mhash-devel-0.9.2-6.el5.centos.i386.rpm
- mcrypt-2.6.8-1.el5.i386.rpm
- # rpm -Uvh
- 下载路径:ftp://172.16.0.1/pub/Sources/memcached。
- libevent-2.0.17-2.i386.rpm
- libevent-devel-2.0.17-2.i386.rpm
- # tar xf php-5.4.8.tar.bz2
- # cd php-5.4.8
- # ./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 --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts
- # make
- # make install
- # cp php.ini-production /etc/php.ini
- # vim /etc/httpd/httpd.conf
- 添加如下二行
- AddType application/x-httpd-php .php //378行
- AddType application/x-httpd-php-source .phps
- 将DirectoryIndex index.html修改为:
- DirectoryIndex index.php index.html
- # cd /web/vhosts/www1
- # vim index.php
- <?php
- phpinfo();
- ?>
- lftp 172.16.0.1:/pub/Sources/new_lamp>
- phpMyAdmin-3.5.1-all-languages.tar.bz2
- tar xf /root/phpMyAdmin-3.5.1-all-languages.tar.bz2
- mv phpMyAdmin-3.5.1-all-languages/* ./
- # tar xf phpMyAdmin-3.5.1-all-languages.tar.bz2
- # mkdir /web/vhosts/www1/pma
- # mv phpMyAdmin-3.5.1-all-languages/* /web/vhosts/www1/pma
- #mysql
- #create database mydb;
- #grant all on mydb.* to root@'localhost' identified by '123456';
- #flush privileges;
- # service mysqld restart