tar xf httpd-2.4.10.tar.gz
cd httpd-2.4.10
./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre=/usr/local/pcre/ --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=event
5.2 make && make install
编辑/etc/httpd24/httpd.conf,添加如下行即可:shift+g定位到行尾
PidFile "/var/run/httpd.pid"
5.3 编辑一个/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/httpd24/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
groupadd www
whereis nologin
useradd -g www -s /sbin/nologin www
mkdir /usr/local/nginx/
cd nginx-1.7.12
./configure --prefix=/usr/local/nginx --user=www --group=www --sbin-path=/usr/local/nginx/sbin --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --error-log-path=/usr/local/nginx/nginx-error.log --with-http_ssl_module --with-pcre=/soft/lamp_linux/pcre-8.32 --with-zlib=/soft/lamp_linux/zlib-1.2.8 --with-openssl=/soft/lamp_linux/openssl-1.0.2e
make && make install
mkdir /usr/local/nginx/access 保持日志
mkdir /usr/local/nginx/vhost 保持虚拟配置文件
vi /etc/rc.d/init.d/nginx
启动脚本:
----------------------------------
#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.0.0.2 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /var/run/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|status|help}"
exit 1
esac
exit $RETVAL
--------------------------------------
授权:
chmod 755 /etc/rc.d/init.d/nginx
chkconfig nginx on
service nginx restart
三,安装MySQL
9,安装MySQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
tar zxvf mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz -C /usr/local/
cd /usr/local/
ln -sv mysql-5.6.15-linux-glibc2.5-x86_64/ mysql
groupadd -r mysql
useradd -g mysql -r -s /sbin/nologin -M -d /usr/local/mysql/data mysql
chown -R mysql:mysql .
cd mysql
cp support-files/my-default.cnf /etc/my.cnf
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
yum -y install libaio-devel
scripts/mysql_install_db --user=mysql
service mysqld start
./bin/mysqladmin -u root password 'hadoop123'
./bin/mysql -u root -p
四,安装php
10,安装bzip2
1
yum -y install bzip2-devel
11,安装libmcrypt
1
2
3
4
tar zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure --prefix=/usr/local/libmcrypt
make && make install
12,安装libiconv
1
2
3
4
tar xf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make && make install
13,安装libxml
1
2
3
cd libxml2-2.9.0
./configure --prefix=/usr/local/libxml2 --with-zlib=/usr/local/zlib/
make && make install
14,安装curl
1
2
3
4
tar zxvf curl-7.42.0.tar.gz
cd curl-7.42.0
./configure --prefix=/usr/local/curl
make && make install