安装文档:OWASP Juice Shop
环境:Ubuntu Server 技术:Node.js + Express + Angular
0阅读
环境:Ubuntu Server 技术:Node.js + Express + Angular
1. 安装 Node.js
Sección titulada «1. Instalación de Node.js»OWASP Juice Shop 需要现代版本的 Node.js(v18 或更高版本)。我们将安装版本 22。
sudo apt updatecurl -fsSL [https://deb.nodesource.com/setup_22.x](https://deb.nodesource.com/setup_22.x) | sudo -E bash -sudo apt install -y nodejs
# Verificar versiónnode -v# Debe ser v20+cd /var/www/htmlsudo git clone [https://github.com/juice-shop/juice-shop.git](https://github.com/juice-shop/juice-shop.git)cd juice-shop这一步至关重要。如果失败,服务器将无法启动(错误 CONNECTION_REFUSED)。需要以写权限执行 npm install,以生成 build 文件夹。
# 1. Asignar propiedad a tu usuario actual para poder compilarsudo chown -R $USER:$USER /var/www/html/juice-shop
# 2. Instalar dependencias y compilar la aplicaciónnpm install
# 3. Devolver la propiedad al usuario web (seguridad)sudo chown -R www-data:www-data /var/www/html/juice-shopOWASP Juice Shop 不是系统服务(如 Apache),而是我们需要在终端中保持运行的 Node.js 进程。
启动 OWASP Juice Shop
Sección titulada «Iniciar OWASP Juice Shop»cd /var/www/html/juice-shopsudo -u www-data npm start我们会等待直到看到消息:info: Server listening on port 3000
Web 访问:http://TU_IP:3000
停止 OWASP Juice Shop
Sección titulada «Detener OWASP Juice Shop»在正在运行的终端中,我们将按下:
Ctrl + C

