- lamp:Linux(操作系统) 、Apache (网页服务器)、MariaDB或Mysql(数据库管理系统,数据库服务器)、Php或Python(脚本语言)
- wordpress:是使用PHP语言开发的博客平台
搭建过程:
建议取消防火墙
1.安装各种安装包
[root@westos_netfilesystem shell]# yum install httpd mariadb-server php php-mysql -y
2.关闭防火墙
[root@westos_netfilesystem shell]# systemctl stop firewalld.service
[root@westos_netfilesystem shell]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
3.关闭selinux
[root@westos_netfilesystem shell]# setenforce 0
- 永久关闭selinux
[root@westos_netfilesystem mnt]# vim /etc/sysconfig/selinux
4.下载并解压wordpress安装包
[root@westos_netfilesystem Downloads]# tar xf wordpress-4.7.2-zh_CN.tar.gz
5.切换目录
[root@westos_netfilesystem Downloads]# mv wordpress /var/www/html
[root@westos_netfilesystem Downloads]# cd
[root@westos_netfilesystem ~]# cd /var/www/html
[root@westos_netfilesystem html]# ls
wordpress
[root@westos_netfilesystem html]# cd wordpress
6.开启服务
[root@westos_netfilesystem wordpress]# systemctl start httpd
[root@westos_netfilesystem wordpress]# systemctl enable httpd
[root@westos_netfilesystem wordpress]# systemctl start mariadb
[root@westos_netfilesystem wordpress]# systemctl enable mariadb
7.测试
[root@westos_netfilesystem mnt]# cd /var/www/html
[root@westos_netfilesystem html]# ls
wordpress
[root@westos_netfilesystem html]# vim index.html
8.修改端口
[root@westos_netfilesystem html]# vim /etc/httpd/conf/httpd.conf
将此处80端口按要求修改为8080端口:
[root@westos_netfilesystem html]# systemctl restart httpd
[root@westos_netfilesystem html]# curl http://127.0.0.1:8080
这是一个论坛
重启:
用之前的端口在次访问:
加上修改后的端口8080访问成功:
9.创建数据库
[root@westos_netfilesystem html]# mysql -uroot -p123 -e "create database wordpress default charset='utf8'"
10.打开apache后可访问readme.html