LAMP+WordPress

news2024/9/22 12:24:20

一、简介

LAMP:
  • L:linux——操作系统,提供服务器运行的基础环境。
  • A:apache(httpd)——网页服务器软件,负责处理HTTP请求和提供网页内容。
  • M:mysql,mariadb——数据库管理系统,用于存储网站数据。
  • P:php,perl,python——服务器端脚本语言,用于生成动态网页内容。
LAMP的特点包括:
  • 开源:所有组件都是开源的,这意味着它们可以免费使用,并且有活跃的社区支持。
  • 灵活性:LAMP组件可以灵活配置,以适应不同的网站需求。
  • 广泛支持:由于其流行度,有大量的教程、文档和工具来支持LAMP环境。
  • 稳定性:Linux和Apache都是经过长期测试的稳定系统。
  • 安全性:虽然任何系统都可能面临安全威胁,但LAMP组件有定期的安全更新和补丁。
WordPress:

WordPress是一个开源的内容管理系统,最初于2003年被开发用来简化个人在线写作,但随着时间的发展,它已经成长为一个全功能的网站框架。WordPress使用PHP编写,使用MySQL作为数据库管理系统。

WordPress的特点包括:
  • 易用性:WordPress有一个直观的后台管理界面,使得即使是非技术用户也能轻松管理网站。
  • 可扩展性:通过插件和主题,WordPress可以扩展其功能,适应各种网站需求。
  • 社区支持:有一个庞大的社区,提供帮助、教程和资源。
  • SEO友好:WordPress支持搜索引擎优化(SEO),有助于提高网站在搜索引擎中的排名。
  • 多语言支持:WordPress支持多种语言,可以创建多语言网站。
  • 移动友好:WordPress主题和插件支持响应式设计,确保网站在各种设备上都能良好显示。

LAMP和WordPress经常一起使用,因为WordPress可以在LAMP环境中运行,利用Apache作为服务器,MySQL作为数据库,PHP作为脚本语言。这种组合提供了一个强大而灵活的平台,用于构建和维护网站。 

二、搭建

下载需要的软件包,启动数据库和httpd
[root@node1 ~]# yum -y mariadb mariadb-server httpd
[root@node1 ~]# systemctl restart mariadb
[root@node1 ~]# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
[root@node1 ~]#
配置数据库,初始化数据库
[root@node1 ~]# mysql_secure_installation 

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     # 设置数据库的root密码
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] y       # 移除匿名
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n      # 远程连接
 ... skipping.
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] y   # 是否删除原来的默认表
 - 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] y      # 是否同步初始化
 ... 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!
[root@node1 ~]#
安装php,配置php文件,设置php的时区并启动php
[root@node1 ~]# yum -y install php php-cli php-fpm php-gd php-curl php-zip php-mbstring php-opcache php-intl php-mysqlnd

[root@node1 ~]# vim /etc/php.ini
date.timezone = Asia/Shanghai

[root@node1 ~]# systemctl enable php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
[root@node1 ~]# 
为php做一个网页
[root@node1 ~]# cd /var/www/html/
[root@node1 html]# vim index.php
[root@node1 html]# cat index.php 
<?php
        phpinfo
?>
[root@node1 html]#
更改apache的配置文件,是其支持php的网页
[root@node1 ~]# vim /etc/httpd/conf/httpd.conf
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>
浏览器访问ip查看网页,看到默认的网页

192.168.100.10

基本架构已经做好

基于此架构部署wordpress

准备好wordpress安装包,解压
[root@node1 ~]# mkdir /etc/software
[root@node1 ~]# cd /etc/software

#上传安装包
[root@node1 software]# ls
wordpress  wordpress-6.5.5.tar.gz

[root@node1 software]# cp -r wordpress /var/www/html/     # 移动到默认网页下面
[root@node1 software]# ls /var/www/html/
index.php  wordpress
[root@node1 software]#
更改wordpress的所属主所属组,更改权限为775
[root@node1 html]# cd /var/www/html/
[root@node1 html]# ll -ld wordpress/
drwxr-xr-x 5 root root 4096 Jul 16 09:47 wordpress/
[root@node1 html]# chown -R apache.apache /var/www/html/wordpress/
 
[root@node1 html]# ll -ld wordpress/
drwxr-xr-x 5 apache apache 4096 Jul 16 09:47 wordpress/
[root@node1 html]# chmod -R 775 /var/www/html/wordpress/
[root@node1 html]# ll -ld wordpress/
drwxrwxr-x 5 apache apache 4096 Jul 16 09:47 wordpress/
为数据库做配置
[root@node1 html]# mysql -u root -p        # 登录数据库
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.5.22-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 database sjk_db;        # 创建数据表
Query OK, 1 row affected (0.000 sec)
 
MariaDB [(none)]> create user 'wordpress_user'@'localhost' identified by 'linux'  # 设置用户名和密码
    -> ;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> grant all on sjk_db.* to 'wordpress_user'@'localhost'    # 为用户设置权限
    -> ;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> flush privileges;     # 同步设置
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [(none)]>
使用虚拟主机来配置apache,更改配置文件
[root@node1 html]# cp -r /usr/share/doc/httpd-core/httpd-vhosts.conf /etc/httpd/conf.d
[root@node1 html]# vim /etc/httpd/conf.d/httpd-vhosts.conf 
<VirtualHost 192.168.100.10:80>
    DocumentRoot "/var/www/html/wordpress"
    <Directory "/var/www/html/wordpress">
         Options Indexes FollowSymLinks
         AllowOverride all
         Require all granted
    </Directory>
配置好配置文件后启动httpd,访问ip查看网页内容

192.168.100.10

登录

完成!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2139073.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

PCL 窗口可视化两个点云

目录 一、概述 1.1原理 1.2实现步骤 1.3 应用场景 二、代码实现 2.1关键函数 2.2完整代码 三、实现效果 PCL点云算法汇总及实战案例汇总的目录地址链接&#xff1a; PCL点云算法与项目实战案例汇总&#xff08;长期更新&#xff09; 一、概述 本文将介绍如何使用PCL库…

8.4Prewitt算子边缘检测

基本原理 Prewitt算子是一种用于边缘检测的经典算子&#xff0c;它通过计算图像中像素值的&#xff08;一阶导数&#xff09;梯度来检测边缘。Prewitt算子通常包括两个3x3的卷积核&#xff0c;一个用于检测水平方向上的边缘&#xff0c;另一个用于检测垂直方向上的边缘。 示例…

【动漫资源管理系统】Java SpringBoot助力,搭建一个高清动漫在线观看网站

&#x1f34a;作者&#xff1a;计算机毕设匠心工作室 &#x1f34a;简介&#xff1a;毕业后就一直专业从事计算机软件程序开发&#xff0c;至今也有8年工作经验。擅长Java、Python、微信小程序、安卓、大数据、PHP、.NET|C#、Golang等。 擅长&#xff1a;按照需求定制化开发项目…

【插件】【干货】用EPPlus在Unity中读写Excel表

EPPlus是什么我就不说了&#xff0c;你都点进来了肯定知道 几个常用的api 1.index下标都是从1开始的 2.可以读取任意单元格上的任意内容&#xff0c;不需要给excel表写规则 但是如果你写了规则&#xff0c;就需要自己用额外的代码 --- 数据结构去实现 3.打开excel表 ExcelP…

[数据集][目标检测]智慧交通铁路异物入侵检测数据集VOC+YOLO格式802张7类别

数据集格式&#xff1a;Pascal VOC格式YOLO格式(不包含分割路径的txt文件&#xff0c;仅仅包含jpg图片以及对应的VOC格式xml文件和yolo格式txt文件) 图片数量(jpg文件个数)&#xff1a;802 标注数量(xml文件个数)&#xff1a;802 标注数量(txt文件个数)&#xff1a;802 标注类别…

萤石举办2024清洁机器人新品发布会 多维智能再造行业标杆

导言&#xff1a;作为智慧生活守护者&#xff0c;萤石今日发布了两款清洁机器人&#xff0c;AI扫拖机器人RS20 Pro Ultra 和AI洗地机器人RX30 Max &#xff0c;标志着萤石在智能清洁领域的全新突破。RS20 Pro Ultra基于CutFree 2.0内切割滚刷专利&#xff0c;有效解决毛发缠绕难…

速通GPT:《Improving Language Understanding by Generative Pre-Training》全文解读

文章目录 速通GPT系列几个重要概念1、微调的具体做法2、任务感知输入变换3、判别式训练模型 Abstract概括分析和观点1. 自然语言理解中的数据问题2. 生成预训练和监督微调的结合3. 任务感知输入变换4. 模型的强大性能 Introduction概括分析和观点1. 自然语言理解的挑战在于对标…

探索Python的HTML处理神器:pyquery的魔力

文章目录 探索Python的HTML处理神器&#xff1a;pyquery的魔力背景&#xff1a;为何选择pyquery&#xff1f;pyquery是什么&#xff1f;安装pyquery五个简单的库函数使用方法1. $&#xff1a;选择元素2. .text()&#xff1a;获取文本内容3. .html()&#xff1a;获取HTML内容4. …

SSM框架学习(三、MyBatis实践:提高持久层数据处理效率)

目录 一、Mybatis简介 1.简介 2.持久层框架对比 3.快速入门&#xff08;基于Mybatis3方式&#xff09; 4.ibatis方式的实现和原理 5.ibatis与mybatis之间的关系 二、Mybatis基本使用 1.向 sql 语句传参 &#xff08;1&#xff09;mybatis日志输出配置 &#xff08;2&…

小程序开发设计-第一个小程序:创建小程序项目④

上一篇文章导航&#xff1a; 小程序开发设计-第一个小程序&#xff1a;安装开发者工具③-CSDN博客https://blog.csdn.net/qq_60872637/article/details/142219152?spm1001.2014.3001.5501 须知&#xff1a;注&#xff1a;不同版本选项有所不同&#xff0c;并无大碍。 一、创…

主播和礼品检测系统源码分享

主播和礼品检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Computer V…

SSH软链接后门从入门到应急响应

目录 1. 软链接与SSH软链接后门介绍 1.1 软链接介绍 1.2 SSH软连接后门介绍 2. 如何在已拿下控制权限的主机创建后门 2.1 使用root账户并执行ssh软链接后门命令&#xff1a; 2.2 连接软链接后门测试&#xff1a; 2.3 创建其它账户 ssh软连接后门命令 3. 如何进行应急…

笋丁网页自动回复机器人V3.0.0免授权版源码

笋丁网页机器人一款可设置自动回复&#xff0c;默认消息&#xff0c;调用自定义api接口的网页机器人。 此程序后端语言使用Golang&#xff0c;内存占用最高不超过30MB&#xff0c;1H1G服务器流畅运行。仅支持Linux服务器部署&#xff0c;不支持虚拟主机&#xff0c;请悉知&…

七. 部署YOLOv8检测器-quantization-analysis

目录 前言0. 简述1. 案例运行2. 补充说明3. 量化分析4. 探讨总结下载链接参考 前言 自动驾驶之心推出的 《CUDA与TensorRT部署实战课程》&#xff0c;链接。记录下个人学习笔记&#xff0c;仅供自己参考 本次课程我们来学习课程第七章—部署YOLOv8检测器&#xff0c;一起来学习…

无限边界:现代整合安全如何保护云

尽管云计算和远程工作得到广泛采用&#xff0c;零信任网络也稳步推广&#xff0c;但边界远未消失。相反&#xff0c;它已被重新定义。就像数学分形的边界一样&#xff0c;现代网络边界现在无限延伸到任何地方。 不幸的是&#xff0c;传统工具在现代无限边界中效果不佳。现代边…

优化算法(三)—模拟退火算法(附MATLAB程序)

模拟退火算法&#xff08;Simulated Annealing, SA&#xff09;是一种基于概率的优化算法&#xff0c;旨在寻找全局最优解。该算法模拟金属退火过程中的物质冷却过程&#xff0c;逐渐降低系统的“温度”以达到全局优化的效果。它特别适用于解决复杂的组合优化问题。 一、模拟退…

深度学习笔记(6)文本分类

深度学习笔记&#xff08;6&#xff09;文本分类 文章目录 深度学习笔记&#xff08;6&#xff09;文本分类一、文本分析与关键词提取1.关键概念1.停用词2 Tf-idf&#xff1a;关键词提取 3.相似度 二、文本分析案例1.数据处理2.分词&#xff1a;实用结巴分词器3.清洗4.TF-IDF5.…

FastText 和 Faiss 的初探了解

概览 大模型目前已经是如火如荼的程度&#xff0c;各个大厂都有推出面向大众的基础大模型&#xff0c;同时诸多行业也有在训练专有大模型&#xff0c;而大模型的发展由来却是经过多年从文本检索生成、深度学习、自然语言处理&#xff0c;在Transformer架构出来后&#xff0c;才…

win11下面graphviz的用法

安装 安装graphviz 2.38版本 控制面板在变量path中增加E:\software\Graphviz\bin example.dot代码 digraph SignalPathway {node [fontname"SimHei"];edge [fontname"SimHei"];// 定义节点形状node [shapecircle];// 定义节点CellA [label"细胞 A&…

第 13 章 兵马未动,粮草先行——InnoDB 统计数据是如何收集的

表的统计数据&#xff1a;SHOW TABLE STATUS LIKE table_name; 索引的统计数据&#xff1a;SHOW INDEX FROM table_name; 13.1 两种不同的统计数据存储方式 InnoDB 提供了两种存储统计数据的方式&#xff1a; 永久性的统计数据。存储在磁盘上&#xff0c;服务器重启之后还在…