PVE系列教程(十八)、安装wordpress服务器
为了更好的浏览体验,欢迎光顾勤奋的凯尔森同学个人博客http://www.huerpu.cc:7000
一、安装配置Apache服务
Ubuntu使用的版本22.04LTS版本
#切换到root用户
sudo su -
#更新
apt update
apt upgrade -y
#安装Apache, PHP和mysql-client等
apt install apache2 apache2-utils php libapache2-mod-php mariadb-server mariadb-client php-mysql -y
# 配置Apache
vim /etc/apache2/sites-available/000-default.conf
# DocumentRoot /var/www/wordpress
# <VirtualHost *:7000 >
#ServerAdmin webmaster@127.0.0.1
systemctl reload apache2
vim /etc/apache2/ports.conf
#我这里想要7000端口,当然你可以使用默认端口80
#把Listen 80改为Listen 7000
Listen 7000
二、安装wordpress
#下载WordPress
wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz
#解压文件包
tar -xzvf /tmp/wordpress.tar.gz -C /var/www
#赋予权限
chown -R www-data.www-data /var/www/wordpress
三、开放端口号
#开放端口
ufw allow in "Apache Full"
#我这里想要7000端口,当然你可以使用默认端口80
ufw allow 7000
ufw allow from any to any port 3306 proto tcp
ufw enable
ufw status
#重启Apache2
systemctl status apache2
访问http://192.168.31.120:7000这样就可以愉快的访问啦