#!/bin/bash # Apache configuration setup for DAP-MCP create_vhost() { local domain=$1 local port=$2 local conf_file="/etc/apache2/sites-available/${domain}.conf" echo " ServerName ${domain} ProxyPreserveHost On ProxyPass / http://127.0.0.1:${port}/ ProxyPassReverse / http://127.0.0.1:${port}/ ErrorLog \${APACHE_LOG_DIR}/${domain}_error.log CustomLog \${APACHE_LOG_DIR}/${domain}_access.log combined " > "$conf_file" a2ensite "${domain}.conf" } create_vhost "mcp.devjun.net" "9281" create_vhost "tool-sal.devjun.net" "9282" create_vhost "tool-cus.devjun.net" "9284" create_vhost "tool-pro.devjun.net" "9285" create_vhost "tool-sys.devjun.net" "9286" apache2ctl configtest && systemctl reload apache2