This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathenvironment
100 lines (97 loc) · 3.91 KB
/
environment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[安装Apache2.4.25]
<see:http://httpd.apache.org/docs/2.4/install.html>
1.安装依赖
yum install gcc pcre pcre-devel perl openssl openssl-devel
2.下载安装包
wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.25.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-1.5.2.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.gz
3.安装
tar -zxf httpd-2.4.25.tar.gz
tar -zxf apr-1.5.2.tar.gz
tar -zxf apr-util-1.5.4.tar.gz
mv apr-1.5.2 httpd-2.4.25/srclib/apr
mv apr-util-1.5.4 httpd-2.4.25/srclib/apr-util
cd httpd-2.4.25
./configure --prefix=/usr/local/httpd --with-ssl --with-included-apr
make && make install
<note:apr和apr-util应该下载最新版,否则mpm可能用不了event模式>
4.控制命令
cd /usr/local/httpd/bin
./apachectl -k start|stop|restart
[安装nginx1.10.3]
<see:http://nginx.org/en/docs/configure.html>
1.安装依赖
yum install gcc zlib zlib-devel pcre pcre-devel
2.下载安装包
wget http://nginx.org/download/nginx-1.10.3.tar.gz
3.安装
tar -zxf nginx-1.10.3.tar.gz
cd nginx-1.10.3
./configure --prefix=/usr/local/nginx --with-pcre --with-zlib --with-http_ssl_module
make && make install
4.控制命令
/usr/local/nginx/sbin
./nginx 启动
./nginx -s stop 立即终止
./nginx -s quit 平滑终止
./nginx -s reload 重新加载配置文件
./nginx -s reopen 重新打开日志文件
[安装PHP7.1.1]
1.安装依赖
yum install gcc libxml2 libxml2-devel bzip2 bzip2-devel zlib zlib-devel libmcrypt libmcrypt-devel openssl openssl-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel libcurl libcurl-devel freetype freetype-devel
2.下载安装包
wget http://hk2.php.net/distributions/php-7.1.1.tar.gz
3.安装
tar -zxf php-7.1.1.tar.gz
cd php-7.1.1
<note:下面的一句是配置为apache模块运行>
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-bz2 --with-zlib --with-mcrypt --with-openssl --enable-mbstring --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-calendar --enable-exif --with-gd --with-jpeg-dir --with-png-dir --enable-gd-native-ttf --with-freetype-dir --enable-bcmath --with-curl --enable-ftp --enable-sockets --enable-libxml
<note:下面的一句配置是以php-fpm方式运行>
./configure --prefix=/usr/local/php --with-bz2 --with-zlib --with-mcrypt --with-openssl --enable-mbstring --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-calendar --enable-exif --with-gd --with-jpeg-dir --with-png-dir --enable-gd-native-ttf --with-freetype-dir --enable-bcmath --with-curl --enable-ftp --enable-sockets --enable-libxml --enable-fpm
make && make install
4.控制命令<用于以php-fpm方式运行时>
cd /usr/local/php/sbin
./php-fpm 启动
kill -QUIT pid 平滑终止
kill -INT|TERM pid 立即终止
kill -USR1 pid 重新打开日志文件
kill -USR1 pid 平滑重载所有worker进程并重新载入配置和二进制模块
<note:pid为主进程id>
5.使用PECL安装扩展
5.1.依赖
yum install autoconf
5.2.安装memcached
yum install libmemcahced libmemcached-devel
cd /usr/local/php/bin
./pecl -install memcached
<note:要把extension=memcached.so写入php.ini>
5.3.安装APCu
cd /usr/local/php/bin
./pecl install APCu
<note:要把extension=apcu.so写入php.ini>
[安装MYSQL5.7.17]
<see:https://dev.mysql.com/doc/refman/5.7/en/binary-installation.html>
1.安装依赖
yum install libaio
2.下载二进制安装包
https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
3.安装
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
cd /usr/local
tar -zxf /path/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
ln -s mysql-5.7.18-linux-glibc2.5-x86_64 mysql
cd mysql
mkdir mysql-files
chmod 750 mysql-files
chown -R mysql .
chgrp -R mysql .
bin/mysqld --initialize --user=mysql
bin/mysql_ssl_rsa_setup
chown -R root .
chown -R mysql data mysql-files
bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/init.d/mysql.server
4.控制命令
/etc/init.d/mysql.server start|stop|restart