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