练习:分别使用CentOS 7和CentOS 6实现以下任务
一、配置三个基于名称的虚拟主机
(a) discuzX
(b) wordpress
(c) https: phpMyAdmin
# yum -y install httpd php php-mysql mariadb-server mod_ssl
# systemctl start httpd
# systemctl start mariadb
# mysqladmin -u root password rootgm
# vim /etc/httpd/conf/httpd.conf
#DucomentRoot "…"
# vim /etc/httpd/conf/vhosts.conf
# mkidr -p /www/gm{1,2,3}
CA认证
# cd /etc/pki/CA
# touch /etc/pki/CA/{serial,index.txt}
# echo 01 > /etc/pki/CA/serial
# (umask 077; openssl genrsa -out private/cakey.pem 2048)
# openssl req -new -x509 -key private/cakey.pem -out cacert.pem
# mkdir /etc/httpd/ssl
# cd /etc/httpd/ssl
# (umask 077; openssl genrsa -out httpd.key pem2048)
# openssl req -new -key httpd.key -out httpd.csr
# openssl ca httpd.csr -out /etc/pki/CA/certs/httpd.crt
# cp /etc/pki/CA/certs/httpd.crt /etc/httpd/ssl/
# vim /etc/httpd/conf/ssl.conf
# vim /etc/hosts
10.1.252.101 www.gm1.com
10.1.252.101 www.gm2.com
10.1.252.101 www.gm3.com
获取Discuz、wordpress、phpMyAdmin的程序包
# mv Discuz_X3.2_SC_UTF8.zip /www/gm1
# mv wordpress-4.3.1-zh_CN.zip /www/gm2
# mv phpMyAdmin-4.0.5-all-languages.zip /www/gm3
1、安装Discuz
# cd /www/gm1
# unzip Discuz_X3.2_SC_UTF8.zip
# cd upload
# chown apache config data uc_client uc_server
创建所需数据库和管理该数据库的帐号和密码
# mysql -u root -p
>rootgm
>craete database discuz
>grant all on discuz.* to 'hlr'@'localhost' identified by 'hlr423'
在浏览器中访问 www.gm1.com/upload ;开始安装
2、安装wordpress
# cd /www/gm2
# unzip wordpress-4.3.1-zh_CN.zip
# chown apache /www/gm2/wordpress
创建所需数据库和管理该数据库的帐号和密码
# mysql -u root -p
>rootgm
>craete database wordpress
>grant all on wordpress.* to 'gm'@'localhost' identified by 'gm625'
在浏览器中访问 www.gm2.com/wordpress ;开始安装
3、安装phpMyAdmin
# cd /www/gm3
# unzip phpMyAdmin-4.0.5-all-languages.zip
# mv phpMyAdmin-4.0.5-all-languages phpma
# cd phpma
# cp config.sample.inc.php config.inc.php
# openssl rand -base64 8
LwQlqS7DdsY=
# vim config.inc.php
# yum -y install php-mbstring php-mcrypt
在浏览器中访问 www.gm3.com/phpma ;开始安装
CentOs6:
yum -y install httpd php php-mysql mysql-server mod_ssl
其他的步骤同CentOS7
二、对discuzX的主页做压测;
分别给出并发10, 100, 200, 500等每秒的响应数
原创文章,作者:megedugao,如若转载,请注明出处:http://www.178linux.com/50388