xml地图|网站地图|网站标签 [设为首页] [加入收藏]

澳门皇家娱乐2编译安装Nginx1,4_X64编译安装php

来源:http://www.ccidsi.com 作者:集成经验 人气:154 发布时间:2019-06-26
摘要:安装参照他事他说加以调查: 说明: 说明: CentOS 6.3编写翻译安装Nginx1.2.2 MySQL5.5.25a PHP5.4.5   记录本身编写翻译安装笔记: 准备篇: 一、配置好IP、DNS 、网关,确认保证使用远程连接

安装参照他事他说加以调查:

说明:

说明:

CentOS 6.3编写翻译安装Nginx1.2.2 MySQL5.5.25a PHP5.4.5

 

记录本身编写翻译安装笔记:

准备篇:
一、配置好IP、DNS 、网关,确认保证使用远程连接工具能够接连服务器
CentOS 设置IP地址、网关、DNS教程:
二、配置防火墙,开启80端口、3306端口
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #同意80端口通过防火墙
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #同意3306端口通过防火墙
专程提示:诸多网上朋友把这两条规则加多到防火墙配置的最后一行,导致防火墙运维失败,准确的应当是加上到默许的22端口那条规则的上边
增多好之后防火墙规则如下所示:
系统运行 温馨提示:qihang01原创内容版权全部,转发请注脚出处及原来的小说链接
#########################################################
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
#########################################################
/etc/init.d/iptables restart #末段重启防火墙使配置生效
三、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
:wq 保存,关闭
shutdown -r now #重启系统
四 、系统预约
软件源代码包存放地点:/usr/local/src
源码包编写翻译安装地方:/usr/local/软件名字
五、下载软件包
1、下载nginx(前段时间稳固版)

2、下载pcre (支持nginx伪静态)

4、下载MySQL

5、下载php

6、下载cmake(MySQL编写翻译工具)

7、下载libmcrypt(PHPlibmcrypt模块)

六、安装编写翻译工具及库文件(使用CentOS yum命令安装)

yum -y install make apr* autoconf automake curl-devel gcc gcc-c zlib-devel openssl openssl-devel pcre-devel gd kernel keyutils patch perl kernel-headers compat* mpfr cpp glibc libgomp libstdc -devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype libjpeg* libpng* php-common php-gd ncurses* libtool* libxml2 libxml2-devel patch

安装篇
以下是用putty工具远程登入到服务器,在命令行下边操作的

一、安装cmake
cd /usr/local/src
tar zxvf cmake-2.8.8.tar.gz
cd cmake-2.8.8
./configure
make #编译
make install #安装

 

自个儿是使用yum安装的cmake

=======================================================

二、安装mysql

那边安装mysql的指标是为着早先时期增加编写翻译pdo_mysql所以只设置了轻便几步:
groupadd mysql #添加mysql组
useradd -g mysql mysql -s /bin/false #创办用户mysql并投入到mysql组,不允许mysql用户直接登入系统
mkdir -p /data/mysql #始建MySQL数据仓库储存放目录
chown -R mysql:mysql /data/mysql #安装MySQL数据库目录权限
mkdir -p /usr/local/mysql #创办MySQL安装目录
cd /usr/local/src
tar zxvf mysql-5.6.13.tar.gz #解压
cd mysql-5.6.13

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DINSTALL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1

参数说明:

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql        //安装目录
-DINSTALL_DATADI中华V=/usr/local/mysql/data         //数据仓库储存放目录
-DDEFAULT_CHARSET=utf8                        //使用utf8字符
-DDEFAULT_COLLATION=utf8_general_ci            //校验字符
-DEXTRA_CHAPRADOSETS=all                            //安装全体扩展字符集
-DENABLED_LOCAL_INFILE=1                        //允许从地点导入数据

#make

#make install

三、安装pcre

cd /usr/local/src
mkdir /usr/local/pcre #制造安装目录
tar zxvf pcre-8.33.tar.gz
cd pcre-8.33
./configure --prefix=/usr/local/pcre #配置
make
make install

=======================================================

安装Nginx

cd /usr/local/src
groupadd www #添加www组
useradd -g www www -s /bin/false #创制nginx运营账户www并加入到www组,不相同意www用户直接登陆种类
tar zxvf nginx-1.2.2.tar.gz
cd nginx-1.2.2
./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-openssl=/usr/ --with-pcre=/usr/local/src/pcre-8.31
留心:--with-pcre=/usr/local/src/pcre-8.31针对性的是源码包解压的门道,而不是设置的路径,不然会报错
make
make install
/usr/local/nginx/sbin/nginx #启动nginx
设置nginx开启运行
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
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/usr/local/nginx/logs/nginx.pid
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
if [ -e $nginx_pid ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/nginx
return $RETVAL
}
# Stop nginx daemons functions.
stop() {
echo -n $"Stopping $prog: "
killproc $nginxd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /usr/local/nginx/logs/nginx.pid
}
reload() {
echo -n $"Reloading $prog: "
#kill -HUP `cat ${nginx_pid}`
killproc $nginxd -HUP
RETVAL=$?
echo
}
# 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

操作系统:CentOS 6.3 三十人

操作系统:CentOS 6.2 三拾伍人

exit $RETVAL

:wq! #封存退出
chmod 775 /etc/rc.d/init.d/nginx #加之文件举办权限
chkconfig nginx on #安装开机运转
/etc/rc.d/init.d/nginx restart #重启
service nginx restart

=======================================================
五、安装libmcrypt
cd /usr/local/src
tar zxvf libmcrypt-2.5.8.tar.gz #解压
cd libmcrypt-2.5.8 #进入目录
./configure #配置
make #编译
make install #安装

=======================================================