# 更新系统并安装必要的依赖项: sudo dnf update -y sudo dnf install -y git httpd php php-mysqli php-mbstring mariadb-server
#启动并启用 Apache 和 MariaDB 服务: sudo systemctl start httpd sudo systemctl enable httpd sudo systemctl start mariadb sudo systemctl enable mariadb # 为 MariaDB 配置安全设置: sudo mysql_secure_installation # 克隆 DVWS 仓库并将其放置在 Web 服务器的根目录下: git clone https://github.com/ethicalhack3r/DVWS.git sudo cp -r DVWS /var/www/html/ #更改 DVWS 目录的所有权: sudo chown -R apache:apache /var/www/html/DVWS # 创建数据库和用户: mysql -u root -p
#输入您之前设置的 root 密码,然后运行以下 SQL 语句: CREATE DATABASE dvws; CREATE USER 'dvws'@'localhost' IDENTIFIED BY 'your_password_here'; GRANT ALL PRIVILEGES ON dvws.* TO 'dvws'@'localhost'; FLUSH PRIVILEGES; EXIT;
# 导入 DVWS 数据库: mysql -u dvws -p dvws < /var/www/html/DVWS/sql/db.sql