centos 部署环境搭建

把一些安装步骤记录下来,以后查看

 

1.因为是新机器所有先来查看一下硬盘的情况

 

Disk /dev/xvda: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00078f9c

 

    Device Boot      Start         End      Blocks   Id  System

/dev/xvda1   *           1        2611    20970496   83  Linux

 

Disk /dev/xvdb: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

再来看一下挂载情况

 

df -HT

 

Filesystem     Type   Size  Used Avail Use% Mounted on

/dev/xvda1     ext4    22G  2.8G   18G  14% /

tmpfs          tmpfs  4.2G     0  4.2G   0% /dev/shm

/dev/xvdb      ext4   106G   63M  101G   1% /mnt/qixieke_com

 

 将其卸载

fuser -k /mnt/qixieke_com

umount /mnt/qixieke_com 

 

永久挂载

vim /etc/fstab

 

#

# /etc/fstab

# Created by anaconda on Thu Aug 14 21:16:42 2014

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

UUID=94e4e384-0ace-437f-bc96-057dd64f42ee / ext4 defaults,barrier=0 1 1

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

 

none                  /proc/xen               xenfs   defaults        0 0

 

/dev/xvdb       /mnt/qixieke_com    ext4   defaults 1 2

加入一条永久挂载

 

重启  reboot

 

------------------------------------------------------------------------------------------------------

开始安装需要环境

 

jdk8 

 

vim /etc/profile文件在最后一行加入

 

##setinng jdk

export JAVA_HOME=/jdk

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$PATH:$JAVA_HOME/bin

 

export CATALINA_HOME=/home/tiny/tomcat8

 

source /etc/profile 执行

 

安装tengine 

 

yum install openssl-devel

 

./configure --prefix=/mnt/qixieke_com/tools/tengine-2.1.0_compile --without-http_rewrite_module

 

make && make install

 

安装mysql 

 

yum -y install make gcc-c++ cmake bison-devel  ncurses-devel gcc \

       autoconf automake zlib* fiex* libxml* libmcrypt* libtool-ltdl-devel*

 

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.16.tar.gz

tar xvf mysql-5.6.16.tar.gz

cd mysql-5.6.16

 

cmake \

-DCMAKE_INSTALL_PREFIX=/mnt/qixieke_com/tools/mysql-5.6.16_complie \

-DMYSQL_DATADIR=/mnt/qixieke_com/tools/mysql-5.6.16_complie/data \

-DSYSCONFDIR=/mnt/qixieke_com/tools/mysql-5.6.16_complie \

-DWITH_MYISAM_STORAGE_ENGINE=1 \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_MEMORY_STORAGE_ENGINE=1 \

-DWITH_READLINE=1 \

-DMYSQL_UNIX_ADDR=/mnt/qixieke_com/tools/mysql-5.6.16_complie/mysql.sock \

-DMYSQL_TCP_PORT=3306 \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_PARTITION_STORAGE_ENGINE=1 \

-DEXTRA_CHARSETS=all \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci

 

make && make install

 

groupadd mysql

useradd -r -g mysql mysql

cd /usr/local/mysql

chown -R mysql:mysql .

scripts/mysql_install_db --user=mysql --ldata=/mnt/qixieke_com/mysql5.xxx/data

chown -R root .

chown -R mysql data

 

my.cnf

 

[client]

port=3306

socket=/mnt/qixieke_com/mysql-5.6.16_complie/mysql.sock

default-character-set = utf8

 

[mysqld]

port=3306

bind-address=0.0.0.0

max_connections=2000

wait_timeout=1000

character-set-server=utf8

basedir=/mnt/qixieke_com/mysql-5.6.16_complie

datadir=/mnt/qixieke_com/mysql-5.6.16_complie/data

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

 

############# default settings  ################

# time zone

default-time-zone = system

character-set-server = utf8

default-storage-engine = InnoDB

 

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

 

cp support-files/mysql.server /etc/init.d/mysql
/etc/init .d /mysql start
 
./bin/mysql
 
 mysql> use mysql;   mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';   mysql> FLUSH PRIVILEGES;
 
安装php
 
yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
 
 
./configure --prefix=/mnt/qixieke_com/tools/php-5.6.6_complie --enable-fpm --with-iconv=/mnt/qixieke_com/tools/libiconv-1.14_complie --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-curl --with-gd --enable-gd-native-ttf --with-mysql=/mnt/qixieke_com/tools/mysql-5.6.16_complie   --with-libxml-dir --with-mysqli --with-gd   --with-jpeg-dir   --with-png-dir   --with-freetype-dir   --with-iconv-dir   --with-zlib-dir   --with-bz2   --with-openssl   --with-mcrypt=/mnt/qixieke_com/tools/libmcrypt_complie   --enable-soap   --enable-gd-native-ttf   --enable-mbstring   --enable-sockets   --enable-exif   --disable-ipv6
 
make && make install
 
cp php.ini-production /usr/local/lib/php.ini
 
cp /mnt/qixieke_com/tools/php-5.6.6_complie/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
 
cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
 
 chmod a+x /etc/init.d/php-fpm
 
 
 
 

你可能感兴趣的:(ke)