首页 技术 正文
技术 2022年11月15日
0 收藏 728 点赞 2,814 浏览 3940 个字

#!/bin/bash
#nginx:nginx-1.8.0.tar.gz
#mysql:mysql-5.5.50.tar.gz
#php:php-5.5.31.tar.gz
#the software package
dir = /software
if [ ! -f $dir ];then
        mkdir $dir
fi
#configure epel source
cd $dir
wget http://mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm
rpm -ivh epel-release-latest-6.noarch.rpm
yum repolist
#Install the development packages
yum -y install wget gcc-c++ ncurses ncurses-devel cmake make perl bison openssl openssl-devel gcc* libxml2 libxml2-devel curl-devel libjpeg* libpng* freetype*
#close iptables and selinux
service iptables stop
sed -i ‘s/SELINUX=enforcing/SELINUX=diabled/g’ /etc/sysconfig/selinux
setenforce 0
#install and configure mysql server
cd $dir
wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.50.tar.gz
if ! id mysql &> /deve/null;then
        useradd -d /usr/local/mysql -s /sbin/nologin mysql
fi
mkdir -p /mydata/data
mkdir -p /mydata/log
chown -R mysql.mysql /mydata/data
chown -R mysql.mysql /mydata/log
chmod 750 /mydata/data
chmod 750 /mydata/log
tar xf mysql-5.5.50.tar.gz
cd mysql-5.5.50
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/mydata/data \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DSYSCONFDIR=/etc \
-DWITH_SSL=yes

sed -i ‘s@datadir=/var/lib/mysql@datadir=/mydata/data@g’ /etc/my.cnf
sed -i ‘s@socket=/var/lib/mysql/mysql.sock@socket=/tmp/mysql.sock@g’ /etc/my.cnf

ln -s /usr/local/mysql/include/mysql /usr/include/mysql
cd /usr/local/mysql
scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/mydata/data
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
service mysqld start
echo “PATH=/usr/local/mysql/bin:$PATH” >> /etc/profile
mysqladmin -u root password Lsf@8816 #setting mysql root password
#install and configure nginx 1.8.1
#Install the prerequisite
yum -y install  gcc openssl-devel pcre-devel zlib-devel
cd $dir
groupadd nginx
useradd -g nginx -s /sbin/nologin nginx
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar xf nginx-1.8.1.tar.gz
cd nginx-1.8.1
./configure –prefix=/usr/local/nginx –pid-path=/var/run/nginx.pid –lock-path=/var/lock/nginx.lock  –user=nginx –group=nginx –with-http_ssl_module –with-http_dav_module –with-http_flv_module –with-http_realip_module –with-http_gzip_static_module –with-http_stub_status_module –with-mail –with-mail_ssl_module –with-debug –http-client-body-temp-path=/var/tmp/nginx/client –http-proxy-temp-path=/var/tmp/nginx/proxy –http-fastcgi-temp-path=/var/tmp/nginx/fastcgi –http-uwsgi-temp-path=/var/tmp/nginx/uwsgi –http-scgi-temp-path=/var/tmp/nginx/scgi  && make && make install
mkdir -p /var/tmp/nginx/client
/usr/local/nginx/sbin/nginx
#install and configure php
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gd gd2 gd-devel gd2-devel perl-CPAN pcre-devel
cd $dir
wget http://mirrors.sohu.com/php/php-5.5.31.tar.gz
tar xf php-5.5.31.tar.gz
cd php-5.4.25
./configure –prefix=/usr/local/php5 –enable-fpm –with-libxml-dir=/usr/local/lib –with-zlib-dir=/usr/local/lib –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config –with-gd –enable-soap –enable-sockets  –enable-xml –enable-mbstring –with-png-dir=/usr/local –with-jpeg-dir=/usr/local –with-curl=/usr/lib –with-freetype-dir=/usr/include/freetype2/freetype/ –enable-bcmath –enable-zip –enable-maintainer-zts && make && make install
cp php.ini-development /etc/php.ini
echo “error_log = /usr/local/nginx/logs/php_error.log” >> /etc/php.ini
echo “date.timezone=PRC” >> /etc/php.ini
 cd /usr/local/php5/etc/

cp php-fpm.conf.default  php-fpm.conf
/usr/local/php5/sbin/php-fpm

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,020
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,513
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,359
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,142
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,772
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,850