1.最小化安装centos8
1.1更新系统(可选)dnf update -y
2.安装podmandnf install podman -y
3.拉取centos8镜像podman search centos:8 podman pull centos:8 podman images
4.运行centos8容器podman run --name mywordpress -dit -p 80:80 -p 443:443 centos:8 /sbin/init
5.查看容器podman ps -a
6 进入容器podman exec -it 容器ID bash
7.安装mariadb,php,httpddnf install mariadb mariadb-server httpd httpd-tools php php-cli php-json php-gd php-mbstring php-pdo php-xml php-mysqlnd php-pecl-zip wget -y
8.启动httpd,mariadbsystemctl start httpd mariadb
9.设置httpd,mariadb开机自启动systemctl enable httpd mariadb
10.登录数据库(root无密码)mysql -uroot -p
11.新建数据库
create database mywordpress;
12.新建wordpress数据库用户GRANT ALL ON mywordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'mywordpresspassword';
13下载wordpres,wget速度慢,迅雷下载的国内地址,https://cn.wordpress.org/latest-zh_CN.tar.gz
14.传输wordpress包到容器podman cp latest-zh_CN.tar.gz mywordpress:/var/www/
15.解包wordpresstar zxvf latest-zh_CN.tar.gz
16.配置wordpress文件夹访问权限chown -Rf apache:apache ./wordpress/ chmod -Rf 775 ./wordpress/
17.httpd配置文件夹conf.d中新增mywordpress.conf文件,内容如下<VirtualHost *:80> ServerAdmin root@localhost DocumentRoot /var/www/wordpress <Directory "/var/www/wordpress"> Options Indexes FollowSymLinks AllowOverride all Require all granted </Directory> ErrorLog /var/log/httpd/wordpress_error.log CustomLog /var/log/httpd/wordpress_access.log common </VirtualHost>
18.重启httpdsystemctl restart httpd
19.配置wordpress连接数据库的文件(可选,配置文件不修改,访问wordpress时也可以设置)
20.访问wordpress,设置管理员账号信息
centos8容器中安装lamp及wordpress
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:WPF 自定义Window窗体引用不写Key样式引用失败
下一篇:配置JDK环境
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
CentOS安装DataX
datax安装
datax -
CentOS 7安装docker
CentOS 7安装Docker
docker centos CentOS