[root@localhost ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database wpdb;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> USE wpdb
Database changed
MariaDB [wpdb]> GRANT ALL ON wpdb TO 'wpuser'@'192.168.2.110';
Query OK, 0 rows affected (0.01 sec)
MariaDB [wpdb]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [wpdb]> exit
Bye
(5)测试
九、安装xcache
(1)未安装xcache时进行测试
[root@localhost wordpress]# ab -c 200 -n 10000 pma.mylinuxops.com/pma
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking pma.mylinuxops.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache/2.4.6
Server Hostname: pma.mylinuxops.com
Server Port: 80
Document Path: /pma
Document Length: 238 bytes
Concurrency Level: 200
Time taken for tests: 7.286 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Non-2xx responses: 10000
Total transferred: 4780000 bytes
HTML transferred: 2380000 bytes
Requests per second: 1372.57 [#/sec] (mean)
Time per request: 145.712 [ms] (mean)
Time per request: 0.729 [ms] (mean, across all concurrent requests)
Transfer rate: 640.71 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 11 86.2 5 3018
Processing: 14 80 285.2 60 7231
Waiting: 1 78 285.2 58 7231
Total: 31 91 298.6 65 7247
Percentage of the requests served within a certain time (ms)
50% 65
66% 69
75% 71
80% 72
90% 80
95% 89
98% 269
99% 470
100% 7247 (longest request) (2)安装xcache并测试
[root@localhost wordpress]# yum install -y php-xcache
[root@localhost wordpress]# systemctl restart httpd
[root@localhost wordpress]# ab -c 200 -n 10000 pma.mylinuxops.com/pma
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking pma.mylinuxops.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache/2.4.6
Server Hostname: pma.mylinuxops.com
Server Port: 80
Document Path: /pma
Document Length: 238 bytes
Concurrency Level: 200
Time taken for tests: 4.907 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Non-2xx responses: 10000
Total transferred: 4780000 bytes
HTML transferred: 2380000 bytes
Requests per second: 2037.87 [#/sec] (mean)
Time per request: 98.142 [ms] (mean)
Time per request: 0.491 [ms] (mean, across all concurrent requests)
Transfer rate: 951.27 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 23 7.4 22 53
Processing: 26 74 14.3 71 290
Waiting: 1 64 14.7 62 280
Total: 41 97 14.4 94 325
Percentage of the requests served within a certain time (ms)
50% 94
66% 99
75% 105
80% 107
90% 113
95% 117
98% 121
99% 127
100% 325 (longest request) 十、为pma提供https
(1) 为服务器申请数字证书;
(a) 创建私有CA
[root@localhost wordpress]# cd /etc/pki/CA
[root@localhost CA]# (umask 077; openssl genrsa -out private/cakey.pem 2048)
Generating RSA private key, 2048 bit long modulus
...................................................................+++
...............................................................................................................+++
e is 65537 (0x10001)
[root@localhost CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 3650
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:Shanghai
Locality Name (eg, city) [Default City]:Shanghai
Organization Name (eg, company) [Default Company Ltd]:mylinuxops
Organizational Unit Name (eg, section) []:ops
Common Name (eg, your name or your server's hostname) []:ca.mylinuxops.com
Email Address []:caadmin.mylinuxops.com
[root@localhost CA]# touch serial index.txt
[root@localhost CA]# echo 01 > serial (b) 在服务器创建证书签署请求
[root@localhost CA]# cd /etc/httpd/
[root@localhost httpd]# mkdir ssl
[root@localhost httpd]# cd ssl
[root@localhost ssl]# (umask 077; openssl genrsa -out httpd.key 1024)
Generating RSA private key, 1024 bit long modulus
......................++++++
.................++++++
e is 65537 (0x10001)
[root@localhost ssl]# openssl req -new -key httpd.key -out httpd.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:Shanghai
Locality Name (eg, city) [Default City]:Shanghai
Organization Name (eg, company) [Default Company Ltd]:mylinuxops
Organizational Unit Name (eg, section) []:ops
Common Name (eg, your name or your server's hostname) []:pma.mylinuxops.com
Email Address []:pmadmin@mylinuxops.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []: (c) CA签证
[root@localhost ssl]# cd /etc/pki/CA/
[root@localhost CA]# openssl ca -in /etc/httpd/ssl/httpd.csr -out certs/httpd.crt
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 1 (0x1)
Validity
Not Before: Apr 14 05:42:48 2018 GMT
Not After : Apr 14 05:42:48 2019 GMT
Subject:
countryName = CN
stateOrProvinceName = Shanghai
organizationName = mylinuxops
organizationalUnitName = ops
commonName = pma.mylinuxops.com
emailAddress = pmadmin@mylinuxops.com
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
84:1A:5D:C1:73:2A:B2:17:F9:5E:18:5F:2C:85:C3:6A:A6:83:9D:B5
X509v3 Authority Key Identifier:
keyid:E4:00:05:49:AF:4D:2A:44:92:9C:B7:FD:63:E2:D5:7A:6F:54:84:6E
Certificate is to be certified until Apr 14 05:42:48 2019 GMT (365 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated (2) 配置httpd支持使用ssl,及使用的证书;