Home >Database >Mysql Tutorial >CentOS6部署phpmyadmin;部署Discuz;部署phpwind_MySQL

CentOS6部署phpmyadmin;部署Discuz;部署phpwind_MySQL

WBOY
WBOYOriginal
2016-06-01 13:16:401357browse

CentOS6CentOSPHPwind

第一部分:

一、yum安装LAMP平台
二、部署phpMyAdmin

第二部分:
一、搭建论坛系统Discuz

二、搭建论坛系统PhpWind

三、搭建论坛系统 PhpBB 

第三部分

一、部署wordpress个人博客系统

===============================================================================

一、phpMyAdmin简介

 1. phpMyAdmin 是以PHP为基础而开发的一个以WEB方式来管理Mysql数据库的工具,phpMyAdmin提供了一个比较人性化的网页界面,操作起来非常简单易用。对于一些对SQL语句不太熟悉的人来使用,是最好不过的一个工具了。
phpMyAdmin官方网站下载地址:http://www.phpmyadmin.net/home_page/downloads.php

 2. 安装LAMP平台

# yum -y install http php php-mysql php-mbstring mysql mysql-server

 3. 修改Apache主配置文件,添加默认主页如下:

# vim /etc/httpd/conf/httpd.confDirectoryIndex index.php index.html index.html.varServerName localhost:80

 4. 启动http与mysql服务

# service httpd start# service mysqld start

 5. 在默认网页存放新建一个index.php文件,写一个测试语句,是否能够连接数据库,数据库用户“root”,默认没有密码,我们设置一个密码;如下;

# mysqladmin -uroot -p password "phpmyadmin"# vim /var/www/html/index.php<h1>www.phpmyadmin.com</h1><?php $Con=mysql_connect('127.0.0.1','phpmyadmin','phpmyadmin');if ($Con)echo "SUCCESS...";elseecho "FAILURE...";

 6. 浏览器测试访问

wKiom1Nf03uhDtBhAACyw9Iq5pM733.jpg

 7. 修改/etc/httpd/conf/httpd.conf文件,为phpmyadmin创建一个虚拟主机;如:

# cd /etc/httpd/conf# cp httpd.conf httpd.conf.bak# vim httpd.conf增加以下行NameVirtualHost 192.168.0.104:80<virtualhost>ServerAdmin zhengyansheng@cdvcloud.comDocumentRoot /var/www/html/phpmyadminServerName www.phpmyadmin.comErrorLog logs/allentuns-error_logCustomLog logs/allentuns-access_log common</virtualhost>

 8.  重新载入配置文件

# service httpd reload

 9. 解压phpMyAdmin软件包

# cd /usr/local/src# tar xf phpMyAdmin-4.1.14-all-languages.tar.bz2 -C /var/www/html/# mv phpMyAdmin-4.1.14-all-languages phpmyadmin

 10. 由于没有DNS服务器解析,需要在本地Hosts文件中添加如下记录:

C:/Windows/System32/Drivers/etc/hosts#打开此文件添加如下内容192.168.0.104www.phpmyadmin.com

 11、客户端打开浏览器验证是否能成功登录,如下

wKiom1Nf81XwppkoAAF49JYseB0646.jpg

12. 登陆后的界面

wKioL1Nf81eSROImAAUv7YwnzIY439.jpg

提示phpMyAdmin 高级功能未设置,部分未激活,然后请点击【这里】查看原因;如下图

wKiom1Nf9TbwsQzSAALR19-0ezY072.jpg

wKioL1Nf9Qzz76BzAALsJzUs6qo823.jpg

13. 首先需要修改/var/www/html/phpmyadmin/config.inc.conf文件;如下:

去掉以下行的注释/* Storage database and tables */$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';$cfg['Servers'][$i]['relation'] = 'pma__relation';$cfg['Servers'][$i]['table_info'] = 'pma__table_info';$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';$cfg['Servers'][$i]['column_info'] = 'pma__column_info';$cfg['Servers'][$i]['history'] = 'pma__history';$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';$cfg['Servers'][$i]['tracking'] = 'pma__tracking';$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';$cfg['Servers'][$i]['recent'] = 'pma__recent';$cfg['Servers'][$i]['users'] = 'pma__users';$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';

 14. 将phpMyAdmin/examples/create_tables.sql数据库文件导入数据库;如下:

# mysql -uroot -pphpmyadmin <p>15.  再次重新登录并验证;如下:</p><p><img title="true.png" alt="wKiom1Nf9YyiLHYaAAR171Oom0w310.jpg" src="http://img.bitscn.com/upimg/allimg/c140719/1405KQ1623440-620b.jpg"></p><p>===============================================================================</p><p><strong>第二部分:</strong></p><p>一、搭建Discuz论坛</p><p>1. Discuz简介</p><p>Discuz! X 是一款以 PHP 为编程语言,以 MySQL 为数据库,并使用 Apache/IIS/Nginx(任意一种即可) 提供 web 服务的产品。要搭建 Discuz! X 站点,服务器必须安装由 PHP、MySQL、Apache/IIS/Nginx 构成的环境。其中,IIS 主要用于 Windows 服务器,Apache、Nginx 多用于 Linux 服务器(即 LAMP 和 LNMP)。</p><p>2. 部署流程</p><pre class="brush:php;toolbar:false">Linux 服务器部署时,需要按照一定的部署顺序,即:系统环境初始化 -> Apache/Nginx、MySQL、PHP 程序包下载 -> Apache/Nginx、MySQL、PHP 安装

3. 软件下载地址:http://download.comsenz.com/DiscuzX/3.1/Discuz_X3.1_SC_UTF8.zip
4. 上传软件包或者本地下载软件包,解压到Apache站点目录

[root@allentuns ~]# yum -y install unzip[root@allentuns ~]# cd /usr/local/src/[root@allentuns src]# lsDiscuz_X3.1_SC_UTF8.zip[root@allentuns src]# unzip Discuz_X3.1_SC_UTF8.zip[root@allentuns src]# lltotal 16480-rw-r--r--.1 root root 10443521 Apr 29 04:16 Discuz_X3.1_SC_UTF8.zipdrwxr-xr-x.2 root root 4096 Feb 28 14:52 readmedrwxr-xr-x. 12 root root 4096 Feb 28 14:52 uploaddrwxr-xr-x.4 root root 4096 Feb 28 14:52 utility[root@allentuns src]# cp -r upload /var/www/html/bbs[root@allentuns src]# chown -R apache /var/www/html/bbs/

5. 添加虚拟主机,如下

[root@allentuns ~]# vim /etc/httpd/conf/httpd.conf<virtualhost>ServerAdmin zhengyansheng@cdvcloud.comDocumentRoot /var/www/html/bbsServerName www.bbs.comErrorLog logs/bbs-error_logCustomLog logs/bbs-access_log common</virtualhost>

6 . 由于没有DNS服务器解析,需要在本地Hosts文件中添加如下记录:

C:/Windows/System32/Drivers/etc/hosts#打开此文件添加如下内容192.168.0.104www.bbs.com

7. 客户端谷歌浏览器访问域名www.bbs.com;域名安装如下图

wKiom1NgVLWSQiiMAATGVPLYRI8111.jpg

查看授权协议,点击【我同意】,以进行下一步操作;如图

wKiom1NgVUbzlmiRAAI60z0xLAk886.jpg

wKiom1NgVW-hnWM2AAMhvnaaK9A332.jpg

设置好站点下目录的权限,然后全部通过后点击【下一步】,如下图

wKiom1NgVf3AtV3SAAJOrqnm2bU722.jpg

登陆MySQL数据库,创建论坛库,论坛mysql用户,授权

[root@allentuns ~]# mysql -uroot -pEnter password:Welcome to the MySQL monitor.Commands end with ; or /g.Your MySQL connection id is 96Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql> create database phpmyadmin #创建论坛数据库mysql> insert into mysql.user(Host,User,Password) values("localhost","phpmyadmin",password("phpmyadmin"));#创建论坛数据库管理员Query OK, 1 row affected, 3 warnings (0.00 sec)mysql> grant all privileges on phpmyadmin.* to phpmyadmin@'%';#赋予phpmyadmin对库有所有权限Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;#重新载入授权表Query OK, 0 rows affected (0.00 sec)mysql> select User,Host,Password from user;+------------+-----------+-------------------------------------------+| User | Host| Password|+------------+-----------+-------------------------------------------+| root | localhost | *387B36D01A7C5EC3AF24E860C269DAA274EF94EF || root | allentuns | || root | 127.0.0.1 | ||| localhost | ||| allentuns | || phpmyadmin | localhost | *387B36D01A7C5EC3AF24E860C269DAA274EF94EF |#添加成功| phpmyadmin | % | |+------------+-----------+-------------------------------------------+7 rows in set (0.00 sec)

数据库名:phpmyadmin  #新创建的数据库

数据库用户名:phpmyadmin #新创建的用户

数据库密码:phpmyadmin

数据表前缀:默认即可

管理员账号:admin

管理员密码:admin

以上信息输入完毕后,点击【下一步】

wKioL1NgXKmjiG-HAALRDdQkjiU744.jpg

如图所示:下一步点击 【继续访问】

wKioL1Ngg9bgfwfmAAQsuaodxS0658.jpg

Discuz论坛搭建成功,如下图

wKioL1NgiVWjoVdWAAPaQMlhi-A131.jpg

bbs论坛安装完成后,最好删除或者重命名bbs目录下install目录

[root@allentuns ~]# cd /var/www/html/bbs/[root@allentuns bbs]# mv install install.bak

重新登陆再次访问bbs论坛

wKioL1NgituziU_RAAM611-UgIw066.jpg

用户登陆界面

wKiom1Ngi3yTiIjbAAJlE9acn78139.jpg

到此bbs论坛搭建完成!!!

===========================================================================

二、搭建论坛系统PhpWind

1. phpwind简介

PHPWind 是一套采用 php+mysql 数据库方式运行并可生成 html 页面的全新且完善的强大系统。

2. 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn