centos6.5搭建ATMN和自启配置没有配置PHP

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/w1573007/article/details/54346416

一,搭建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.gz
APR-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.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
make && make install

httpd-2.4.23编译过程也要依赖于pcre-devel软件包,需要事先安装。

 yum -y install pcre-devel

编译安装httpd-2.4.23

tar xf httpd-2.4.23 .tar.gz
cd 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 mysql
chkconfig –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_111
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export PATH=$PATH:$JAVA_HOME/bin
export 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.htm
http://jingyan.baidu.com/article/1974b2898f5eadf4b1f774de.html
http://blog.csdn.net/leveretz/article/details/53003797
http://blog.sina.com.cn/s/blog_5d95e3130102wioc.html
http://blog.csdn.net/zgl_dm/article/details/8167128
http://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/profile

nginx=/usr/soft/nginx/sbin/nginx
conf=/usr/soft/nginx/conf/nginx.conf
case $1 in
start)
    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 nginx
chkconfig --add nginx
chkconfig --level 2345 nginx on

添加模块–with-http_stub_status_module
在解压的文件夹下
make clean //清除objs文件夹
./configure –prefix=/usr/soft/nginx –with-http_stub_status_module
make
即可
重启

./nginx -s stop
./nginx 

在nginx.conf里添加:

location /nginx-status {
stub_status on;
access_log off;
}

浏览器:http://127.0.0.1:81/nginx-status

猜你喜欢

转载自blog.csdn.net/w1573007/article/details/54346416
今日推荐