http

练习:分别使用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

http

# 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

http

# 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

http

# openssl ca httpd.csr -out /etc/pki/CA/certs/httpd.crt 

http

# cp /etc/pki/CA/certs/httpd.crt /etc/httpd/ssl/


# vim /etc/httpd/conf/ssl.conf

http

http

# 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的程序包

http

# 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  ;开始安装

http

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  ;开始安装

http

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

http

# yum -y install php-mbstring php-mcrypt

在浏览器中访问 www.gm3.com/phpma  ;开始安装

http

CentOs6:

yum -y install httpd php php-mysql mysql-server mod_ssl 

其他的步骤同CentOS7

二、对discuzX的主页做压测;

    分别给出并发10, 100, 200, 500等每秒的响应数

http

http

原创文章,作者:megedugao,如若转载,请注明出处:http://www.178linux.com/50388