
1. 更新系统软件包:
sudo yum update -y
2. 安装 Apache、MySQL 和 PHP:
sudo yum install -y httpd mariadb-server php php-mysql
3. 启动 Apache 和 MySQL 服务并设置开机自启:
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl start mariadb
sudo systemctl enable mariadb
4. 下载并解压 WordPress:
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
sudo mv wordpress /var/www/html/
5. 配置 WordPress 数据库:
sudo mysql -u root
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'your_password';
6. 完成 WordPress 安装并登录管理面板。
1. 安装 SSH 服务:
sudo yum install -y openssh-server
2. 启动 SSH 服务并设置开机自启:
sudo systemctl start sshd
sudo systemctl enable sshd
3. 修改 SSH 配置文件:
sudo vi /etc/ssh/sshd_config
- 禁用密码登录: `PasswordAuthentication no`
- 启用公钥登录: `PubkeyAuthentication yes`
- 设置允许登录的用户: `AllowUsers user1 user2`
4. 重启 SSH 服务以应用配置:
sudo systemctl restart sshd
5. 将公钥添加到允许登录的用户账户。