discuz安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了discuz安装相关的知识,希望对你有一定的参考价值。
1、官网下载Discuz mkdir /data/www cd /data/www wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip unzip Discuz_X3.2_SC_GBK.zip mv upload/* ./ 把 upload目录里的文件都复制到 /data/www [[email protected] www]# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip (需要把多余的目录和包删掉) 2、配置虚拟主机 [[email protected] www]# vim /usr/local/apache2/conf/httpd.conf (配置apache配置文件) Include conf/extra/httpd-vhosts.conf 打开这个配置 [[email protected] www]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf (编辑虚拟主机配置文件) 删掉框选部分 <VirtualHost *:80> ServerAdmin [email protected] (管理员邮箱,把这行去掉) DocumentRoot "/usr/local/apache2/docs/dummy-host.example.com" (引号里改为/data/www DocumentRoot 是主目录,或者说网站根目录) ServerName dummy-host.example.com ( servername 自己随意改一个,例如www.test.com) ServerAlias www.dummy-host.example.com (ServerName 的别名,同样随意取,www.aaa.com) ErrorLog "logs/dummy-host.example.com-error_log"(错误日志) CustomLog "logs/dummy-host.example.com-access_log" common(访问日志) 错误日志和访问日志暂时先不配置,先注释掉 配置好如下 <VirtualHost *:80> DocumentRoot "/data/www" ServerName www.test.com ServerAlias www.aaa.com # ErrorLog "logs/dummy-host.example.com-error_log" # CustomLog "logs/dummy-host.example.com-access_log" common </VirtualHost> (虚拟主机) [[email protected] www]# /usr/local/apache2/bin/apachectl -t (查看语法是否正确) Syntax OK 如果出现提示没有确定,ServerName的提示,就去主配置文件/usr/local/apache2/conf/httpd.conf 中 把ServerName 这行启动,不启动也没什么影响 3、配置hosts (/编辑etc/hosts,加入一行 ip 域名,则ping域名的时候就解析到相对应的ip,如 192.168.1.104 www.hao123.com 当我ping hao123的时候其实是解析到我的虚拟机192.168.1.104) (1)打开windows的c盘/windows/System32/driver/etc/hosts,用记事本打开,加入 192.168.1.104 www.test.com www.aaa.com 在windows尝试能否ping通 然后编辑主配置文件,vim /usr/local/apache2/conf/httpd.conf <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all (将 Deny改为Allow) 这样就可以用浏览器访问 虚拟机了,www.aaa.com,如果还不行就清除防火墙规则,iptables -F (2)浏览器点击安装需要把红叉部分修改 [[email protected] www]# ps aux |grep http root 2054 0.0 1.1 42640 12020 ? Ss May14 0:00 /usr/local/apache2/bin/httpd -k start daemon 2186 0.0 1.0 43548 11192 ? S 00:45 0:00 /usr/local/apache2/bin/httpd -k start daemon 2187 0.0 0.9 42640 10288 ? S 00:45 0:00 /usr/local/apache2/bin/httpd -k start 可以看到apache的进程是用daemon用户的身份在跑,那就将相应的目录属主改为daemon就行了 [[email protected] www]# chown -R daemon config/ data/ uc_server/data/ uc_client/data/ 然后刷新浏览器发现好了 下一步默认全新安装 、 此处要先配置mysql 4、配置mysql yum remove mysql (卸载系统自带的mysql ) vim /etc/profile.d/path.sh (变量加入/usr/local/mysql/bin) export PATH=$PATH:/usr/local/mysql/bin/ source /etc/profile.d/path.sh 这样我们安装的mysql就可以直接使用了,不用绝对路径也不会和系统自带的mysql冲突 配置 [[email protected] www]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.5.47-log MySQL Community Server (GPL) Copyright (c) 2000, 2015, 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.01 sec) mysql> grant all on discuz.* to ‘cindy‘@‘localhost‘ identified by ‘cindylinux‘; 授予cindy所有权限,密码是cindylinux Query OK, 0 rows affected (0.04 sec) 除了红色除外都保持默认,数据库名 改为discuz 数据用户名设置了cindy 数据密码用了cindylinux 管理密码设置了123456 |
以上是关于discuz安装的主要内容,如果未能解决你的问题,请参考以下文章