基于LAMP架构搭建discuz测试

基于LAMP架构搭建discuz测试

1、什么是LAMP

LAMP(linux++mysql+php/)网站架构,是⽬前国际流⾏的Web框架,该框架包 括:Linux操作系统,⽹络服务器,MySQL数据库discuz! database error,Perl、PHP或者编程语 ⾔,所有组成产品均是开源软件,是国际上成熟的架构框架,很多流⾏的商业应⽤都是采取 这个架构,LAMP具有通⽤、跨平台、⾼性能、低价格的优势,因此LAMP⽆论是性能、质量 还是价格都是企业搭建⽹站的⾸选平台。LAMP架构广泛应用于各种动态网站和应用系统,如社交网站、博客平台、在线商店等。

2、LAMP架构工作过程

1、当客户端请求的是静态资源时discuz! database error,web服务器会直接把静态资源返回客户端(静态资源是预先存储在文件系统中的固定内容.)

2、当客户端请求的是动态资源时discuz! database error,httpd的php模块会进行相应的动态资源运算,如果此过程还需要数据库的数据作为运算参数时基于LAMP架构搭建discuz测试,php会连接mysql取得数据然后进行运算,运算的结果转为静态资源由web服务器返回到客户端;(动态资源则需要服务器端程序在执行过程中生成和返回.)

3、LAMP搭建过程(以下是基于虚拟机的.2操作系统)1、配置Linux的yun源安装(包保证可以ping通外网)2、安装配置,基于虚拟机主机模式的https协议3、安装配置、安装配置php基于LAMP架构搭建discuz测试,以及php-mysql模块5、基于LAMP搭建测试

1、yum源仓库的配置

mount /dev/sr0 /mnt  /*镜像挂载*/
cp -Ra /mnt/* /opt
cd
vi /etc/yum.repos.d/local.repo   /*yum仓库配置*/
[local]
name=local
baseurl=file:///opt/BaseOS/
enabled=1
gpgcheck=0
[AppStream]
name=AppStream
baseurl=file:///opt/AppStream/
enable=1
gpgcheck=0
yum makecahce /*查看是否配置成功,命令用于确保 YUM 的缓存是最新的,从而提供更准确和可靠的软件包管理功能*/

2、安装

yum -y install httpd*
systemctl start httpd.service  /*启动服务*/
systemctl enable httpd.service /*设置开机自启动*/
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

3、安装mysql

yum install mariadb-server mariadb -y /*yum源安装数据库*/
systemctl start mariadb.service       /*启动数据库*/
systemctl enable mariadb.service      /*设置开机自启动*/
mysql_secure_installation  /*数据库的配置(先按2次回车输入yes输入密码(2次)一直回车即可完成配置)*/
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none): 
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] 
Enabled successfully!
Reloading privilege tables..
 ... Success!
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] 
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This

discuz! database error

ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!

4、安装php及测试静态资源配置

yum -y install php /*安装php组件*/
vi /var/www/html/info.php /*文件编译测试静态资源效果*/
cat /var/www/html/info.php 

systemctl restart httpd.service 

discuz! database error

5、基于lamp的论坛安装

1、在浏览器搜索选择简体中文下载安装即可(此操作是在主机中操作)

discuz! database error

2、将其安装包拖动到虚拟机当中

discuz! database error

3、进入虚拟机对该安装包进行解压(先将其移动到/var/www/html 目录下在进行解压)

[root@localhost ~]# ls
公共  视频  文档  音乐  anaconda-ks.cfg
模板  图片  下载  桌面  Discuz_X3.5_SC_UTF8_20231221.zip
[root@localhost ~]# mv Discuz_X3.5_SC_UTF8_20231221.zip /var/www/html/
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
Discuz_X3.5_SC_UTF8_20231221.zip  info.php
[root@localhost html]# unzip Discuz_X3.5_SC_UTF8_20231221.zip 

4、删除多余的文件只留下

[root@localhost html]# ls
Discuz_X3.5_SC_UTF8_20231221.zip  LICENSE    readme       upload
info.php                          qqqun.png  readme.html  utility.html
[root@localhost html]# mv Discuz_X3.5_SC_UTF8_20231221.zip /root /*该安装包也可以选择直接删除*/
[root@localhost html]# rm -rf LICENSE readme info.php qqqun.png readme.html utility.html 
[root@localhost html]# ls
upload

5、将移动到该目录下

[root@localhost html]# mv upload/* ./   /*将upload目录下的所有文件和子目录移动到当前目录/
[root@localhost html]# ls
admin.php  connect.php      group.php   misc.php    source     upload
api        crossdomain.xml  home.php    plugin.php  static
api.php    data             index.php   portal.php  template
archiver   favicon.ico      install     robots.txt  uc_client
config     forum.php        member.php  search.php  uc_server

6、浏览器输入ip地址后面加上//查看效果

discuz! database error

7、要进行修改权限否则会出现以下效果

discuz! database error

8、对文件进行权限修改

discuz! database error

[root@localhost html]# chown -R apache.apache /var/www/html/ [root@localhost html]# ll 总用量 72 -rw-r--r--. 1 apache apache 2869 12月 21 19:29 admin.php drwxr-xr-x. 10 apache apache 149 12月 21 19:28 api -rw-r--r--. 1 apache apache 727 12月 21 19:29 api.php drwxr-xr-x. 2 apache apache 23 12月 21 19:28 archiver drwxr-xr-x. 2 apache apache 90 12月 21 19:28 config -rw-r--r--. 1 apache apache 1040 12月 21 19:29 connect.php -rw-r--r--. 1 apache apache 106 12月 21 19:29 crossdomain.xml drwxr-xr-x. 12 apache apache 178 12月 21 19:28 data -rw-r--r--. 1 apache apache 5558 12月 21 16:24 favicon.ico -rw-r--r--. 1 apache apache 2357 12月 21 19:29 forum.php -rw-r--r--. 1 apache apache 906 12月 21 19:29 group.php -rw-r--r--. 1 apache apache 1325 12月 21 19:29 home.php -rw-r--r--. 1 apache apache 6920 12月 21 19:29 index.php drwxr-xr-x. 5 apache apache 64 12月 21 19:28 install -rw-r--r--. 1 apache apache 998 12月 21 19:29 member.php -rw-r--r--. 1 apache apache 2410 12月 21 19:29 misc.php -rw-r--r--. 1 apache apache 1790 12月 21 19:29 plugin.php -rw-r--r--. 1 apache apache 1086 12月 21 19:29 portal.php -rw-r--r--. 1 apache apache 639 12月 21 19:29 robots.txt -rw-r--r--. 1 apache apache 1755 12月 21 19:29 search.php drwxr-xr-x. 10 apache apache 168 12月 21 19:28 source drwxr-xr-x. 7 apache apache 86 12月 21 19:29 static drwxr-xr-x. 3 apache apache 38 12月 21 19:29 template drwxr-xr-x. 8 apache apache 146 12月 21 19:29 uc_client drwxr-xr-x. 13 apache apache 4096 12月 21 19:29 uc_server drwxr-xr-x. 2 apache apache 6 1月 14 09:49 upload

9、关闭防火墙

[root@localhost html]# chmod -R 777 /var/www/html/
[root@localhost html]# systemctl stop firewalld.service
[root@localhost html]# setenforce 0

discuz! database error

10、进行以下操作即可

discuz! database error

服务器地址就是自己的ip地址可以通过以下命令查看自己的ip地址(数据库名字和用户名设置的要与在虚拟机的mysql中设置的要相同)

[root@localhost html]# ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens160:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:c3:a5:c2 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 192.168.81.101/24 brd 192.168.81.255 scope global noprefixroute ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fec3:a5c2/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

对mysql进行数据配置和用户配置

[root@localhost html]# mysql -uroot -p123456
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 3
Server version: 10.5.16-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]> create user 'zpyr'@'192.168.81.101'identified by '123456';
Query OK, 0 rows affected (0.011 sec)
MariaDB [(none)]> grant all privileges on zpyr.* TO 'zpyr'@'192.168.81.101';
Query OK, 0 rows affected (0.002 sec)
/*
CREATE USER 'username'@'ip地址' IDENTIFIED BY 'password';  
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'ip地址';
其中,username是你要创建的用户名,password是用户的密码,database_name是你要给用户授权的数据库名。
*/

discuz! database error

discuz! database error

discuz! database error

公告:
1. 本站所有资源来源于用户上传和网络,如有侵权请联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系站长处理!
6. 本站不售卖代码,资源标价只是站长收集整理的辛苦费!如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。
7. 站长QQ号码 2205675299

资源库 - 资源分享下载网 » 基于LAMP架构搭建discuz测试

常见问题FAQ

关于资源售价和售后服务的说明?
本站所有资源的标价均为本站收集资源的辛苦费,不代表资源本身的价值。软件是高智慧高价值的商品,不可能是白菜价。本站资源标价只是赞助费用,收取的赞助费仅用来维持本站的日常运营!毕竟收集整理资料需要投入云计算资源和站长大量的精力。
代码有没有售后服务和技术支持?
由于代码的运行具有不可预见性,本站不保证代码完整可运行,不提供技术支持和售后服务。 本站原创代码都是站长自己开发的,可以有偿提供技术支持服务。 网站里标明【亲测】的代码都是站长亲测过的,其他的代码由于精力有限,没有一一测试,不能保证代码就一定能够使用,更没有技术支持服务,下载前请自行斟酌。
有没有搭建服务?
由于搭建服务比较费时费力,所以本站除了原创代码外均不提供搭建服务。本站分享代码纯属兴趣爱好,不以盈利为目的,请勿咨询有没有搭建服务,谢谢理解。
链接地址失效了怎么办?
请带上资源链接地址联系客服,工作时间内我们看到后将第一时间回复。
关于解压密码
本站资源一般都没有加密,如果发现需要解压密码的,那么就输入 hao.35dc.com 试试。

发表评论

资源库,由老程序员细心甄别、精心筛选,只为提供优质的源码资源

关于我们 联系我们