##一,搭建apache httpd-2.2.23参考网站:http://www.cnblogs.com/kjcy8/p/5893624.html安装编译所需的开发环境yum groupinstall
##一,搭建apache httpd-2.2.23参考网站:http://www.cnblogs.com/kjcy8/p/5893624.html安装编译所需的开发环境
yum groupinstall -y 'Development Libraries' 'Development Tools' 'X Software Development
这里包括了gcc g++等编译器
httpd-2.4.4需要较新版本的apr和apr-util,因此需要事先对其进行升级。升级方式有两种,一种是通过源代码编译安装,一种是直接升级rpm包。这里选择使用编译源代码的方式进行APR: http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gzAPR-util:http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz
(1) 编译安装apr
tar xf apr-1.5.2tar.gz cd apr-1.5.2./configure --prefix=/usr/local/apr make && make install
(2) 编译安装apr-util
tar xf apr-util-1.5.4.tar.gzcd apr-util-1.5.4./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-configmake && make install
httpd-2.4.23编译过程也要依赖于pcre-devel软件包,需要事先安装。
yum -y install pcre-devel
编译安装httpd-2.4.23
tar xf httpd-2.4.23 .tar.gzcd httpd-2.4.23./configure --prefix=/usr/soft/apache或./configure --prefix=/usr/local/apache --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
访问:127.0.0.1:80##二,搭建mysql -5.6.34参考网站http://jingyan.baidu.com/article/a378c9609eb652b3282830fd.html卸载原有mysql ,一定要卸载安装mysql前需要查询系统中含有的有关mysql的软件
rpm -qa | grep -i mysql //grep -i是不分大小写字符查询,只要含有mysql就显示删除安装的 mysql使用 yum remove mysql-libs或者 rpm -e --nodeps mysql-libs-5.1.71-1.el6.i686 强力删除依赖
解压
tar –zxvf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gzcp mysql-5.6.34-linux-glibc2.5-x86_64 /usr/local/mysql –r
添加系统mysql组和mysql用户:
执行命令:groupadd mysql和useradd -r -g mysql mysql
安装数据库:
进入安装mysql软件目录:执行命令cd /usr/soft/mysql修改当前目录拥有者为mysql用户:执行命令 chown -R mysql:mysql ./安装数据库:执行命令 ./scripts/mysql_install_db --user=mysql修改当前目录拥有者为root用户:执行命令 chown -R root:root ./修改当前data目录拥有者为mysql用户:执行命令 chown -R mysql:mysql data到此数据库安装完毕启动mysql服务和添加开机启动mysql服务:添加开机启动:执行命令cp support-files/mysql.server /etc/init.d/mysql,把启动脚本放到开机初始化目录添加自动启动chkconfig --add mysqlchkconfig --level 2345 mysql on
启动mysql服务:执行命令service mysql start修改mysql的root用户密码,root初始密码为空的:执行命令:./bin/mysqladmin -u root password '密码'##三,java不在赘述##四,tomcat -8.5.6
解压到soft下,改名为tomcat启动:
cd /usr/soft/bin./startup.sh修改自起:改vim tomcat/bin/startup.sh 为:export JAVA_HOME=/usr/soft/jdk1.8.0_111export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.export PATH=$PATH:$JAVA_HOME/binexport CATALINA_HOME=/usr/soft/tomcat/usr/soft/tomcat/bin/catalina.sh start 在vim /etc/rc.d/rc.local中加入:/usr/soft/tomcat/bin/startup.sh
即可访问127.0.0.1:8080五,nginx -1.10.2参考网站:http://www.linuxidc.com/Linux/2015-03/114988.htmhttp://jingyan.baidu.com/article/1974b2898f5eadf4b1f774de.htmlhttp://blog.csdn.net/leveretz/article/details/53003797http://blog.sina.com.cn/s/blog_5d95e3130102wioc.htmlhttp://blog.csdn.net/zgl_dm/article/details/8167128http://blog.csdn.net/feng27156/article/details/38874921解压安装
tar zxf nginx-1.10.2.tar.gz
执行安装:
./configure --user=root --group=root--prefix=/usr/local/nginx-1.10.2 ./configure --user=root --group=root--prefix=/usr/local/nginx-1.10.2 /--with-http_stub_status_module--with-http_ssl_module./configure --user=root --group=root--prefix=/usr/local/nginx-1.10.2 --conf-path=/usr/local/nginx-1.10.2/nginx.conf/ --openssl-path=/usr/local/openssl-1.0.1c / --with-http_ssl_module / --with-pcre=/usr/local/pcre-8.21 / --with-http-stub-status-module
启动:
./sbin/nginx
如果端口占用修改nginx/conf/nginx.conf参考网站: http://www.jb51.net/article/78921.htm访问127.0.0.1:8090自起:
#!/bin/bash## chkconfig: 2345 21 79# description: nginx is a World Wide Web server. It is used to serve# /etc/init.d/nginx# chmod 755 nginx# cp nginxd /etc/init.d/# ln -s /etc/init.d/nginx /etc/rc.d/init.d/nginx# chkconfig --add nginxd# chkconfig --level 2345 nginxd on# Nginx is a World Wide Web server.source /etc/profilenginx=/usr/soft/nginx/sbin/nginxconf=/usr/soft/nginx/conf/nginx.confcase $1 instart) echo -n "Starting Nginx" $nginx -c $conf echo " done";;stop) echo -n "Stopping Nginx" killall -9 nginx echo " done";;test) $nginx -t -c $conf;;reload) echo -n "Reloading Nginx" ps auxww | grep nginx | grep master | awk '{print $2}' | xargs kill -HUP echo " done";;restart) echo -n "Restart Nginx" $0 stop sleep 1 $0 start echo " done";;show) ps -aux|grep nginx;;*)echo -n "Usage: $0 {start|restart|reload|stop|test|show}";;esac
###nginx更新模块nginx文件放入/etc/init.d/nginx
chmod a+x nginxchkconfig --add nginxchkconfig --level 2345 nginx on
添加模块--with-http_stub_status_module在解压的文件夹下make clean //清除objs文件夹./configure --prefix=/usr/soft/nginx --with-http_stub_status_modulemake即可重启
./nginx -s stop./nginx
在nginx.conf里添加:
location /nginx-status {stub_status on;access_log off;}
浏览器:http://127.0.0.1:81/nginx-status