Centos7 安装dvwa

基础环境

安装MySQL并配置好密码
安装apache,php

[root@localhost ~] yum -y install httpd php php-mysql
[root@localhost config]# php -v
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51) 
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@localhost config]# mysql -V
mysql  Ver 14.14 Distrib 5.7.24, for Linux (x86_64) using  EditLine wrapper
[root@localhost config]# httpd -V
Server version: Apache/2.4.6 (CentOS)
Server built:   Nov  5 2018 01:47:09
[root@localhost config]# uname -a
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

解压DVWA-master.zip,修正dvwa目录权限

[root@localhost html]# pwd
/var/www/html
[root@localhost html]# unzip DVWA.zip
[root@localhost html]# ls
dvwa  DVWA.zip

重命名
[root@localhost html]# cp config/config.inc.php.dist config/config.inc.php
[root@localhost html]# vi config/config.inc.php #修正mysql密码等
[root@localhost html]# chown -R apache:apache dvwa

开启防火墙通过80端口
关闭selinux(不然提示无法连接MySQL服务… Could not connect to the MySQL service. )

[root@localhost ~]# firewall-cmd --permanent --add-port=80/tcp
[root@localhost ~]# firewall-cmd --reload

[root@localhost ~]# vi /etc/sysconfig/selinux
SELINUX=enforcing #改为 SELINUX=disabled

PHP 配置

vi /etc/php.ini

安装php库等

yum -y install php-gd php-fpm
yum -y install tree vim

你可能感兴趣的:(linux)