分享

about日志模拟基础环境搭建

Mysql的安装         
1.下载yum源安装包
1.jpg
2.本地安装mysql yum
[root@slave2 ~]# yum localinstallmysql57-community-release-el7-11.noarch.rpm
检查yum源是否安装成功
[root@slave2 ~]# yum repolist enabled |grep "mysql.*-community.*"
mysql-connectors-community/x86_64       MySQL Connectors Community           36
mysql-tools-community/x86_64            MySQL Tools Community                47
mysql57-community/x86_64                MySQL 5.7 Community Server          187
3.安装mysql
[root@slave2 ~]# yum installmysql-community-server
启动mysql服务
[root@slave2 ~]# systemctl start mysqld
查看启动状态
[root@slave2 ~]# systemctl status mysqld
mysqld.service - MySQL Server
  Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
  Active: active (running) since Sat 2017-06-17 16:56:13 CST; 11s ago
    Docs: man:mysqld(8)
Process: 36899 ExecStart=/usr/sbin/mysqld --daemonize--pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited,status=0/SUCCESS)
Process: 36822 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited,status=0/SUCCESS)
MainPID: 36903 (mysqld)
  CGroup: /system.slice/mysqld.service
          └─36903 /usr/sbin/mysqld --daemonize--pid-file=/var/run/mysqld/mysqld.pid

Jun 17 16:55:59 slave2 systemd[1]: StartingMySQL Server...
Jun 17 16:56:13 slave2 systemd[1]: StartedMySQL Server.

设置开机启动
[root@slave2 ~]# systemctl enable mysqld
[root@slave2 ~]# systemctl daemon-reload
[root@slave2 ~]#

修改root登陆密码(见第4点,解决无密码登陆到mysql后才能进行修改密码操作)
mysql> update mysql.user setauthentication_string=PASSWORD('aboutyun') where user='root';

4.mysq常见错误
Ø  初次登陆mysql时使用默认空密码,提示以下错误:
[root@slave2 ~]# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user'root'@'localhost' (using password: NO)
[root@slave2 ~]#

解决办法:
vi /etc/my.cnf
skip-grant-tables

[root@slave2 etc]# systemctl restart mysqld
[root@slave2 etc]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18 MySQL CommunityServer (GPL)

Copyright (c) 2000, 2017, Oracle and/or itsaffiliates. All rights reserved.

Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarksof their respective
owners.

Type 'help;' or '\h' for help. Type '\c' toclear the current input statement.

mysql>

apache 安装1. yum安装
[root@slave2 ~]# yum install httpd

2.设置默认域名
[root@slave2 conf]# vi /etc/httpd/conf/httpd.conf
添加如下内容:
ServerName localhost:80

[root@slave2 conf]# systemctl restarthttpd.service

3.验证apache服务是否启动成功
输入http://localhost:80,出现以下界面说明成功启动apache服务
21.jpg


4.按时间生产日志配置
vi /etc/httpd/conf/httpd.conf
找到
ErrorLog "logs/error_log"
CustomLog "logs/access_log"combined

分别将以上内容替换成:

ErrorLog  "|/usr/sbin/rotatelogs /etc/httpd/logs/access_log%Y%m%d.log86400 480" combined
CustomLog"|/usr/sbin/rotatelogs /etc/httpd/logs/access_log%Y%m%d.log 86400 480" combined

重启apache
systemctl restart httpd.service

PHP5.5安装1.yum源安装
2.yum 安装php5.5
yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64

3.修改apache 配置文件
Ø  添加php支持

vi /etc/httpd/conf/httpd.conf 添加如下内容:

AddType application/x-httpd-php .php
LoadModule php5_module modules/libphp5.so

Ø  添加测试页面
在/var/www/html 下面新增test.php文件,添加如下内容:
<?php
phpinfo();
?>
&#216;  重启apache服务
systemctl restart httpd

在浏览器中输入:http://localhost/test.php,出现以下页面说明php5已经配置成功
22.jpg


discuz 安装1.下载discuz安装包
解压Discuz_X3.2_SC_GBK,将解压目录下的upload 下的内容复制到解压根目录下,并将upload文件夹删除
2.解压部署
创建about应用目录
mkdir -p /var/www/html/about

Discuz_X3.2_SC_GBK 目录下的所有内容复制到/var/www/html/about/ 目录下

3.修改PHP字符集
由于discuz默认字符集编码是GBK,PHP默认是UTF-8所以需要修改php.ini 将默认字符集编码改成GBK

vi /etc/php.ini
default_charset="GBK"

重启apache
systemctl restart httpd

4.通过web界面安装discuz
通过URLhttp://localhost/about/install/index.php 开始安装discuz
23.jpg


下一步选择第一个选择,全部安装,用户密码是admin,点击下一步即可完成安装

http://localhost/about/forum.php


24.jpg

没找到任何评论,期待你打破沉寂

关闭

推荐上一条 /2 下一条