您的位置:首页 > 运维架构 > Apache

安装Discuz

2016-12-12 09:58 127 查看

安装Discuz

下载、解压安装

[root@CentOS-1 ~]#mkdir /data/www
[root@CentOS-1 ~]#cd /data/www
[root@CentOS-1 www]#wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip [root@CentOS-1 www]#upzip Discuz_X3.2_SC_GBK.zip
[root@CentOS-1 www]# mv upload/* ./
[root@CentOS-1 www]#rm -rf readme/ uploal/ utility/ Discuz_X3.2_SC_GBK.zip
[root@CentOS-1 www]# vim /usr/local/apache/conf/httpd.conf


找到
Include conf/extra/httpd-vhosts.conf
启用(删除 #)

修改配置参数 Deny from all 改为 Allow from all

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>


修改
httpd-vhosta.conf
配置文件

[root@CentOS-1 www]# vim /usr/local/apache/conf/extra/httpd-vhosts.conf


默认有两个样例,删除一个

<VirtualHost *:80>

ServerAdmin webmaster@dummy-host.example.com

DocumentRoot "/data/www"

ServerName www.chenyue.com

ServerAlias www.123qwe.com

ErrorLog "logs/dummy-host.example.com-error_log"

CustomLog "logs/dummy-host.example.com-access_log" common

</VirtualHost>


查看修改的配置是否有错误(Syntax OK 配置正确)

/usr/local/apache/bin/apachectl -t


启动、重新加载apache

/usr/local/apache/bin/apachectl start


浏览器访问,www.chenyue.com/www.123qwe.com (前提需要在电脑的host文件中,指定域名指向服务器地址)

打开浏览器按照提示安装,出现如图提示;修改对应文件夹权限即可



先看一下apache的进程是什么用户

[root@CentOS-1 www]# ps aux |grep http
root      1444  0.0  1.5  30492 12096 ?        Ss   21:49   0:00 /usr/local/apache/bin/httpd -k start
daemon    1511  0.0  1.3  30624 10312 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1512  0.0  1.4  31432 11160 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1513  0.0  1.3  30624 10312 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1514  0.0  1.4  31472 11224 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1515  0.0  1.3  30624 10312 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1516  0.0  1.2  30492  9784 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1517  0.0  1.2  30492  9784 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1518  0.0  1.2  30492  9784 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1519  0.0  1.2  30492  9784 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
daemon    1520  0.0  1.2  30492  9784 ?        S    22:05   0:00 /usr/local/apache/bin/httpd -k start
root      1522  0.0  0.0   5980   740 pts/0    S+   22:27   0:00 grep http


这里apache的进程是daemon用户在运行;我们需要将上图中提示的文件夹设置成daemon用户(或者修改文件夹权限是可以的,但是修改后文件夹权
baf0
限较大不安全;这里修改所属主)

[root@CentOS-1 www]# chown -R daemon config data uc_client/data uc_server/data


刷新浏览器,选择全新安装



出现mysql配置界面,我们先不配置,先将服务器中的mysql配置好,在到这边操作;

配置Mysql

先设置一下Linux MySQl配置命令
mysql
(原配置命令:
/usr/local/mysql/bin/mysql
)

[root@CentOS-1 www]# which mysql
/usr/bin/mysql
[root@CentOS-1 www]# rpm -qf /usr/bin/mysql
mysql-5.1.71-1.el6.i686
[root@CentOS-1 www]# yum remove mysql


mysql被删除,配置的话;可以使用绝对路径
/usr/local/mysql/bin/mysql


重新指定mysql命令绝对路径,写一个path.sh文件

[root@CentOS-1 www]# vim /etc/profile.d/path.sh
#!/bin/bash
export PATH=$PATH:/usr/local/mysql/bin
~
~
~
[root@CentOS-1 www]# source /etc/profile.d/path.sh  //或source !$


现在使用
mysql
的配置文件,就是之前自己安装的mysql的配置

[root@CentOS-1 www]# which mysql
/usr/local/mysql/bin/mysql        //现在的mysql的绝对路径,是之前自己安装的位置


创建一个库

[root@CentOS-1 www]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.73-log MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

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

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

mysql> create database discuz;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on discuz.* to 'discuz'@'localhost' identified by '1234qwer';
Query OK, 0 rows affected (0.00 sec)

mysql> Ctrl-C -- exit!
Aborted


输入mysql配置账户等信息,下一步 安装即可;

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  discuz MySql Apache