Ready to work:
1 sudo yum Update # first updates the system
1. Install Apache
. 1 $ the sudo yum the install the httpd installation # 2 $ the sudo systemctl # httpd.service enable self-starting is provided . 3 $ the sudo systemctl IS- whether to start after the restart determination httpd.service # Enabled . 4 $ the sudo systemctl Start # httpd.service start Apache . 5 $ the sudo systemctl stop httpd.service # Apache closed
When there is a firewall configuration needed:
. 1 $ the sudo Firewall-cmd = --permanent --zone --add-public-Service = HTTP 2 $ the sudo Firewall-cmd = --permanent --zone public-Service---add = HTTPS 3 $ sudo Firewall-cmd --reload
1 $ curl HTTP: // icanhazip.com # used to get to your server in the terminal ip, for accessing
-
-
The default main configuration file /etc/httpd/conf/httpd.conf
-
2. Install PHP
1 $ sudo yum install php PHP- MySQL installation software serial # 2 $ sudo systemctl httpd.service restart # restart the service to meet and collaborate PHP 3 $ sudo vi /var/www/html/phpinfo.php # code to write a php check that PHP scripts can be executed successfully. (Eg: <php phpinfo ();? ?>)
The use of the public address access http: //ip/phpinfo.php see if php page displays the configuration information
1 sudo RM /var/www/html/phpinfo.php # successful execution will remove its pages, prevent information leakage
3. Install MySQL (here installation of MariaDB)
1 sudo yum install mariadb- Server installation # 2 sudo systemctl enable the service to start MariaDB # 3 sudo systemctl Start MariaDB 4 sudo mysql_secure_installation # run script mysql_secure_installation solve some security problems MariaDB is the default implementation of, the first thing to change your password after enter into default, behind Enter the default installation that is complete
More details can be seen this https://www.linode.com/docs/databases/mariadb/how-to-install-mariadb-on-centos-7/
4. Installation DVWA
1 $ wget https://github.com/ethicalhack3r/DVWA/archive/master.zip # download the compressed package 2 $ unzip master.zip # decompression 3 $ rm DVWA-master.zip / home / wwwroot / default / # shear compressed 4 $ mv DVWA-master.zip DVWA # renaming
. 5 $ CD DVWA
. 6 $ # change directory CP config.inc.php.dist the config.inc.php
7 $ vim config.inc.php # edit $ _DVWA [ 'db_password '] =' p @ ssw0rd ' ; password for the root
. 8 $ Vim /usr/local/php/etc/php.ini # theallow_url_include = Off
parameters toon
9 $service httpd restart
#重启 Apache
After completing these steps, visit
HTTP: // your ip / DVWA , will be redirected to HTTP: // your ip /DVWA/setup.php ,
click the bottom of the page
Create / Reset Database
buttons, to jump to the landing page DVWA enter the default account password admin / password can be used.