3213213 发表于 2016-4-29 16:57:57

lamp安装(centos 64位)安装Discuz!论坛

lamp安装步骤

一、安装Discuz!1、新建目录来存放网页等
1
2
3
# mkdir /data/www
# cd /data/www
# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip




2.解压

1
# unzip Discuz_X3.2_SC_GBK.zip




3.程序文件会放于upload下,所以全部移到www目录下,并且删除多余的文件。

1
2
3
4
5
6
7
# mv upload/* ./
# ls
admin.phpconfig         data                  group.phpmember.phpreadme      static   upload
api      connect.php      Discuz_X3.2_SC_GBK.ziphome.php   misc.php    robots.txttemplate   userapp.php
api.php    cp.php         favicon.ico             index.phpplugin.phpsearch.phpuc_clientutility
archiver   crossdomain.xmlforum.php               install    portal.phpsource      uc_server
# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip




4、配置一个虚拟主机

1
# vim /usr/local/apache2/conf/httpd.conf




#Include conf/extra/httpd-vhosts.conf    //找到,开放这个虚拟主机配置文件,如下:
Include conf/extra/httpd-vhosts.conf
1
# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf




//编辑虚拟主机配置文件,在文件最后面有两个模板案例,删除一个再修改另一个为:
1
2
3
4
5
6
7
<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com    //管理员邮箱,我们可以去掉
    DocumentRoot "data/www"                     //改为之前创建的目录
    ServerName 101.200.206.213                  由于我没有备案域名就添加IP了
    ServerAlias               多个域名
#    ErrorLog "logs/dummy-host.example.com-error_log"//错误日志
#    CustomLog "logs/dummy-host.example.com-access_log" common//访问日志




接着打开80端口

1
# vim /usr/local/apache2/conf/httpd.conf





1
<span style="padding:0px;margin:0px;font-size:14px;"><Directory /><br style="padding:0px;margin:0px;">    Options FollowSymLinks<br style="padding:0px;margin:0px;">    AllowOverride <span style="padding:0px;margin:0px;color:rgb(255,0,0);">None</span><br style="padding:0px;margin:0px;">    Order deny,allow<br style="padding:0px;margin:0px;">    <span style="padding:0px;margin:0px;color:rgb(255,0,0);">Deny</span> from all<br style="padding:0px;margin:0px;"></Directory><br style="padding:0px;margin:0px;">改为:<br style="padding:0px;margin:0px;"><Directory /><br style="padding:0px;margin:0px;">    Options FollowSymLinks<br style="padding:0px;margin:0px;">    AllowOverride <span style="padding:0px;margin:0px;color:rgb(255,0,0);">all</span><br style="padding:0px;margin:0px;">    Order deny,allow<br style="padding:0px;margin:0px;">    <span style="padding:0px;margin:0px;color:rgb(255,0,0);">Allow</span> from all<br style="padding:0px;margin:0px;"></Directory></span>




保存退出,检测配置是否正确,并重启
1
2
3
# /usr/local/apache2/bin/apachectl -t
Syntax OK
# /usr/local/apache2/bin/apachectl restart




4、配置hosts文件
找到本机 C:\Windows\System32\drivers\etc下的hosts文件,添加下面内容后保存退出。101.200.206.213 guozhenshijia.cn5、我们在浏览器上输入网址 www.guozhenshijia.cn 这时就会跳转到Discuz!安装界面。

同意安装后我们看多好多都是不可写,这时我们就要给他们权限。首先查看Apache进程以哪个身份运行
1
2
3
4
5
6
7
8
9
10
11
# ps aux |grep http
root      12210.00.9 1973969724 ?      Ss   23:04   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13180.00.5 1973965552 ?      S    23:30   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13190.00.7 1982568024 ?      S    23:30   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13200.00.5 1973965548 ?      S    23:30   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13210.00.7 1982567916 ?      S    23:30   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13220.00.5 1973965108 ?      S    23:30   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13230.00.5 1973965108 ?      S    23:31   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13240.00.5 1973965108 ?      S    23:31   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
daemon    13250.00.7 1982567904 ?      S    23:31   0:00 /usr/local/apache2/bin/httpd -k s                                       tart
root      13350.00.0 103248   872 pts/0    S+   23:34   0:00 grep http




我们可以看到是daemon,下面我们把所有没有权限的文件都赋予daemon主

1
# chown -R daemon config data uc_client/data uc_server/data




刷新页面后,全都变成绿色的了。下一步就是全新安装。
6、安装数据库在安装数据库之前,我们还需配置数据库
1
# /usr/local/mysql/bin/mysql




mysql> create database discuz;                   //创建一个数据库,数据库名为discuz
mysql> grant all on discuz.* to 'tpp'@'localhost' identified by 'tpplinux';
                                                 // all 所有的权限,用户tpp,密码tpplinux然后我们回到原网页,填写数据库名:discuz,数据库用户名:tpp,数据库密码:tpplinux,其他的默认;管理员admin 密码123456,下一步;安装完成以后,点击最右下角的“您的论坛已完成安装,点此访问”。







页: [1]
查看完整版本: lamp安装(centos 64位)安装Discuz!论坛