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
/etc/init
.d
/mysql
start