安装Lamp实现个人Wordpress博客

本文详细介绍了如何在CentOS7系统上安装LAMP环境(Linux, Apache, MariaDB, PHP)并部署WordPress博客。从安装LAMP组件到编辑PHP页面,重启Apache服务,设置MySQL数据库,安装WordPress,选择并修改主题,到最后通过阿里云域名访问,每个步骤都清晰阐述,适合初学者参考。" 100942442,8571242,Excel技巧:从身份证号中提取信息,"['Excel技巧', '数据处理', '函数应用']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Lamp是什么?

LAMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写:

L:Linux操作系统

A:Apache,网页服务器

M:MariaDB或MySQL,数据库管理系统(或者数据库服务器)

P:PHP、Perl或Python,脚本语言虽然这些开放源代码程序本身并不是专门设计成同另几个程序一起工作的,但由于它们的廉价和普遍,这个组合开始流行(大多数Linux发行版本捆绑了这些软件)。当一起使用的时候,它们表现的像一个具有活力的“解决方案包”(Solution Packages)。其他的方案包有苹果的WebObjects(最初是[应用服务器),Java/J2EE和微软的.NET架构。

Wordpress是什么?

WordPress是使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的[服务器上架设属于自己的网站。也可以把 WordPress当作一个内容管理系统(CMS)来使用。

WordPress是一款个人博客系统,并逐步演化成一款内容管理系统软件,它是使用PHP语言和MySQL数据库开发的,用户可以在支持 PHP 和 MySQL数据库的服务器上使用自己的博客。

WordPress有许多第三方开发的免费模板,安装方式简单易用。不过要做一个自己的模板,则需要你有一定的专业知识。比如你至少要懂的标准通用标记语言下的一个应用HTML代码、CSS、PHP等相关知识。

centos7安装

1、安装lamp

[root@chenc01 ~]# yum -y install httpd php php-mysql mariadb mariadb-server

2、编辑PHP页面

[root@chenc01 ~]# vim /var/www/html/index.php 
内容: 
<?php 	
phpinfo(); 
?>

3、重启apache

# 查看进程和端口是否启动成功
[root@chenc01 ~]# systemctl start httpd
[root@chenc01 ~]# ps -ef | grep httpd
root       2970      1  0 15:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     2972   2970  0 15:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     2973   2970  0 15:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     2974   2970  0 15:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     2975   2970  0 15:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     2976   2970  0 15:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
root       2978   2856  0 15:40 pts/2    00:00:00 grep --color=auto httpd
[root@chenc01 ~]# ss -lntp |grep httpd
LISTEN     0      128         :::80                      :::*                   users:(("httpd",pid=2976,fd=4),("httpd",pid=2975,fd=4),("httpd",pid=2974,fd=4),("httpd",pid=2973,fd=4),("httpd",pid=2972,fd=4),("httpd",pid=2970,fd=4))

4、访问ip

在这里插入图片描述

5、安装配置wordpress论坛

# 切换目录
[root@chenc01 ~]# cd /var/www/html/
[root@chenc01 html]# ls
wordpress-4.9.4-zh_CN.zip  index.php
[root@ chenc01 html]# unzip wordpress-4.9.4-zh_CN.zip
# 增加可写权限 
[root@ chenc01 html]# chmod 777 -R * 
# 修改网站根目录
[root@chenc01 ~]# vim /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/wordpress"

访问IP

在这里插入图片描述

6、开启mysql服务

[root@ chenc01 html]# systemctl start mariadb
[root@ chenc01 html]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.64-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 wordpress charset utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
| wordpress          |
+--------------------+
5 rows in set (0.00 sec)

MariaDB [(none)]> 

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

7、修改wordpress主题

在这里插入图片描述

选择模板进行安装

在这里插入图片描述

点击安装后,没有出现正在安装,而是出现了如下图

在这里插入图片描述
在这里插入图片描述

8、授权

[root@chenc01 html]# chown apache:apache /var/www/html -R

9、通过阿里云域名访问

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值