CentOS7 安装 webgoat 7.1 简介
webgoat 所需文件准备:
操作系统版本:CentOS 7.3
1: 在Linux上安装Openjdk >= 1.8
2: 上传文件至 Linux
3:解压 tomcat7 到 /opt/tomcat 目录下,并重命名为 apache-tomcat --- webgoat 7.1 所依赖的tomcat 不支持 8.0 以上版本
4: 启动Tomcat,验证服务是否正常工作。默认占用8080端口,注意防火墙放行该端口的通讯。
5: 给tomcat设置管理员账号和密码 --- 在修改”tomcat-users.xml“的过程中一定要将Tomcat关闭,设置好后再打开Tomcat。
6: 部署 webgoat-container-7.1.war , 并在tomcat 中增加对应的用户
<!-- NOTE: manager-gui --> <role rolename="manager-gui"/> <user username="tomcat" password="s3cret" roles="manager-gui"/> <!-- NOTE: webgoat --> <!-- <role rolename="manager"/> <role rolename="webgoat_basic"/> <role rolename="webgoat_admin"/> <role rolename="webgoat_user"/> <role rolename="tomcat"/> <user username="webgoat" password="webgoat" roles="webgoat_admin"/> <user username="basic" password="basic" roles="webgoat_basic,webgoat_user"/> <user username="guest" password="guest" roles="webgoat_user"/> <user username="tomcat" password="tomcat" roles="tomcat"/> -->
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
7:设置tomcat自启动
[Unit] Description=Tomcat7 After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking Environment='CATALINA_PID=/opt/tomcat/apache-tomcat/tomcat.pid' Environment='CATALINA_HOME=/opt/tomcat/apache-tomcat' Environment='CATALINA_BASE=/opt/tomcat/apache-tomcat' Environment='CATALINA_TMPDIR=/opt/tomcat/apache-tomcat/temp' Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC' WorkingDirectory=/opt/tomcat/apache-tomcat/ PIDFile=/opt/tomcat/apache-tomcat/tomcat.pid ExecStartPre=/usr/bin/rm -f /opt/tomcat/apache-tomcat/tomcat.pid ExecStart=/opt/tomcat/apache-tomcat/bin/startup.sh ExecStop=/opt/tomcat/apache-tomcat/bin/shutdown.sh ExecReload=/bin/kill -s HUP $MAINPID KillSignal=SIGQUIT TimeoutStopSec=5 KillMode=process PrivateTmp=true [Install] WantedBy=multi-user.target