lamp安装步骤
一、安装Discuz!
1、新建目录来存放网页等
2.解压
1
| [iyunv@iZ25nzu9bj6Z www]# unzip Discuz_X3.2_SC_GBK.zip
|
3.程序文件会放于upload下,所以全部移到www目录下,并且删除多余的文件。
1
2
3
4
5
6
7
| [iyunv@iZ25nzu9bj6Z www]# mv upload/* ./
[iyunv@iZ25nzu9bj6Z www]# ls
admin.php config data group.php member.php readme static upload
api connect.php Discuz_X3.2_SC_GBK.zip home.php misc.php robots.txt template userapp.php
api.php cp.php favicon.ico index.php plugin.php search.php uc_client utility
archiver crossdomain.xml forum.php install portal.php source uc_server
[iyunv@iZ25nzu9bj6Z www]# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip
|
4、配置一个虚拟主机
1
| [iyunv@iZ25nzu9bj6Z www]# vim /usr/local/apache2/conf/httpd.conf
|
#Include conf/extra/httpd-vhosts.conf //找到,开放这个虚拟主机配置文件,如下:
Include conf/extra/httpd-vhosts.conf 1
| [iyunv@iZ25nzu9bj6Z www]# 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
| [iyunv@iZ25nzu9bj6Z www]# 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
| [iyunv@iZ25nzu9bj6Z www]# /usr/local/apache2/bin/apachectl -t
Syntax OK
[iyunv@iZ25nzu9bj6Z www]# /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
| [iyunv@iZ25nzu9bj6Z www]# ps aux |grep http
root 1221 0.0 0.9 197396 9724 ? Ss 23:04 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1318 0.0 0.5 197396 5552 ? S 23:30 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1319 0.0 0.7 198256 8024 ? S 23:30 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1320 0.0 0.5 197396 5548 ? S 23:30 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1321 0.0 0.7 198256 7916 ? S 23:30 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1322 0.0 0.5 197396 5108 ? S 23:30 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1323 0.0 0.5 197396 5108 ? S 23:31 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1324 0.0 0.5 197396 5108 ? S 23:31 0:00 /usr/local/apache2/bin/httpd -k s tart
daemon 1325 0.0 0.7 198256 7904 ? S 23:31 0:00 /usr/local/apache2/bin/httpd -k s tart
root 1335 0.0 0.0 103248 872 pts/0 S+ 23:34 0:00 grep http
|
我们可以看到是daemon,下面我们把所有没有权限的文件都赋予daemon主
1
| [iyunv@iZ25nzu9bj6Z www]# chown -R daemon config data uc_client/data uc_server/data
|
刷新页面后,全都变成绿色的了。下一步就是全新安装。
6、安装数据库 在安装数据库之前,我们还需配置数据库 1
| [iyunv@iZ25nzu9bj6Z www]# /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,下一步;安装完成以后,点击最右下角的“您的论坛已完成安装,点此访问”。
|