一、安装discuz
---->//download discuz; [[email protected] ~]# mkdir /data/www [[email protected] ~]# cd /data/www [[email protected] www]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip [[email protected] www]# unzip Discuz_X3.2_SC_GBK.zip [[email protected] www]# mv upload/* ./ ---->/*配置Apache的第一个虚拟主机*/ [[email protected] www]# vim /usr/local/apache2/conf/httpd.conf ... #Include conf/extra/httpd-vhosts.conf //将前面的#号去掉 ... [[email protected] www]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf //有两个样例,将第二个删除,换成下列内容 <VirtualHost *:80> DocumentRoot "/data/www" ServerName www.123.com//这里是访问网站的域名设置,可以设置多个,也可设置别名 #ServerAlias www.test.com //则也可通过此来访问网站 #Errorlog //错误日志 #Customlog //访问日志 </VirtualHost> [[email protected] www]# /usr/local/apache2/bin/apachectl -t //检查配置是否正确[[email protected] www]# /usr/local/apache2/bin/apachectl restart ---->/*配置mysql ,给discuz增加一个账户*/ /*此处的用户名和密码必须记住*/ [[email protected] www]# /usr/local/mysql/bin/mysql --uroot ... ... ... ... ... mysql>create database discuz; Query OK,1 row affected (0.09 sec) /*在数据库discuz中增加一个用户名为discuz密码为123456的用户*/ mysql>grant all on discuz.* to ‘discuz‘@‘localhost‘ identified by ‘123456‘; Query OK,1 row affected (0.25 sec) mysql>quit Bye ---->/*安装discuz*/ /*在windows里打开 C:\Windows\System32\drivers\etc\hosts,用记事本或者写字板打开*/ /*此处无法打开可去百度 ”无法修改hosts“的方法*/ /*添加进入hosts里*/ 192.168.11.190 www.123.com www.test.com //此处ip为虚拟机ip /*在Linux中打开 vim /etc/hosts ,添加下列内容*/ 192.168.11.190 www.123.com www.test.com //此处ip为虚拟机ip ---->/*浏览器打开并安装discuz*/ http://www.123.com/install/ /*根据提示来修改目录属性*/ [[email protected] ~]# cd /data/www [[email protected] ~]# chown -R daemon:daemon data uc_server/data uc_client/data config //让以上几个目录支持Apache运行账号{daemon}可写
ServerName www.123.com
时间: 2024-11-05 11:39:19