文章目录
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