练习:分别使用CentOS 7和CentOS 6实现以下任务
(1) 配置三个基于名称的虚拟主机;
(a) discuzX
(b) wordpress
(c) https: phpMyAdmin
(2) 对discuzX的主页做压测;
分别给出并发10, 100, 200, 500等每秒的响应数;
(a)
部署应用:步骤
discuzX, phpMyAdmin
[root@centos7 ~]#lftp 10.1.0.1/pub
cd Sources—cd sources— cd pub
mget Discuz_X3.2_SC_UTF8.zip phpMyAdmin-4.0.5-all-languages.zip
unzip Discuz_X3.2_SC_UTF8.zip
[root@centos7 ~]# cp -a upload/ /apps/a7.com/htdocs/discuz
网站: http://10.1.252.172/discuz
安装向导点确定
进入后要求所有都的是√
chown apache config/
chown apache data/ -R
chown apache uc_server/ -R
chown apache uc_client/
再刷新就都是绿色√了
下一步,全新安装
连接mysql服务器设置密码
MariaDB [(none)]> GRANT ALL ON ultrax.* TO 'dzuser'@'localhost' IDENTIFIED BY 'dzpass';
MariaDB [(none)]> GRANT ALL ON ultrax.* TO 'dzuser'@'127.0.0.1' IDENTIFIED BY 'dzpass';
创建数据库
MariaDB [(none)]> CREATE DATABASE ultrax;
此时网页的用户名密码就可以分别改为dzuser 和dzpass
系统邮箱,管理员邮箱改为admin@mgedu.com
管理员密码 admin888
安装完右下角点进论坛
账号密码 admin admin888
[root@centos7 ~]# cd /apps/a7.com/htdocs/discuz/install/
[root@centos7 install]# mv index.php{,.bak}
mysql
use mysql
MariaDB [mysql]> UPDATE user SET password=PASSWORD('magedu') WHERE user='root';
MariaDB [mysql]> FLUSH PRIVILEGES;
此时在mysql就登不进去了
需要加密码
mysql -uroot -pmagedu
使用phpMyAdmin图形化管理
[root@centos7 ~]# unzip phpMyAdmin-4.0.5-all-languages.zip
[root@centos7 ~]# mv phpMyAdmin-4.0.5-all-languages /apps/a7.com/htdocs/pma
[root@centos7 pma]# cp config.sample.inc.php config.inc.php
[root@centos7 pma]# vim config.inc.php
生成随机串贴在$cfg['blowfish_secret'] = 'a8b7c6d';
[root@centos7 ~]# openssl rand -base64 8
b/TrOHSf2dc= 复制=之前的,替换上面文件的
网站 10.1.252.162/pma 显示一个扩展未安装
yum -y install php-mbstring
systemctl reload httpd
网站 10.1.252.162/pma
账号密码 root magedu
yum -y install php-mcrypt 加解密功能
systemctl reload httpd
网站 10.1.252.162/pma
(b)wordpress
[root@centos7 testidr]# lftp 10.1.0.1/pub
lftp 10.1.0.1:/pub> find -d 4 Sources/| grep word
Sources/sources/httpd/wordpress-4.3.1-zh_CN.zip
进到该目录下,下载
lftp 10.1.0.1:/pub/Sources/sources/httpd> mget wordpress-4.3.1-zh_CN.zip
[root@centos7 testidr]# unzip wordpress-4.3.1-zh_CN.zip
cp -a wordpress /apps/b7.net/htdocs/word
网站:www.b7.net/word 此时因为定义虚拟主机时,定义的是FQDN不是ip,故,如果此时敲ip/word就会自动找a7,而不是想要的b7
创建数据库 mysql -uroot -hlocalhost -p123.com CREATE DATABASE wordpress;
链接数据库,授权
MariaDB [(none)]> GRANT ALL ON wordpress.* TO 'word'@'127.0.0.1' IDENTIFIED BY 'word';
MariaDB [(none)]> GRANT ALL ON wordpress.* TO 'word'@'localhost' IDENTIFIED BY 'word';
cd /apps/b7.net.htdocs/word
mv wp-config-sample.php wp-config.php
vim wp-config.php按照提示修改
(2)压测
原创文章,作者:wutianyou,如若转载,请注明出处:http://www.178linux.com/50444