DEV Community

Cover image for Host legacy ASP/VBscript website on Linux
Lucas Guimarães
Lucas Guimarães

Posted on

Host legacy ASP/VBscript website on Linux

Running Classic ASP on Windows Server creates infrastructure bottlenecks. AxonASP allows you to host legacy VBScript and JScript applications natively on Linux.

I'll show you two architectural paths: a decoupled FastCGI setup using Nginx for advanced control, or an embedded module setup using Caddy for simplicity and zero-maintenance deployments.

Method 1: Nginx + AxonASP FPM (Advanced)

This model replicates the traditional PHP-FPM architecture. AxonASP runs as a background manager supervising isolated FastCGI workers, and Nginx acts as the reverse proxy.

1. Install AxonASP

Download and install the pre-built Linux package (Debian/Ubuntu example). This installs the server binaries and creates the required structure under /opt/axonasp.

wget https://github.com/guimaraeslucas/axonasp/releases/download/v3.0.0/axonasp_3.0.0_linux_amd64.deb
sudo dpkg -i axonasp_3.0.0_linux_amd64.deb
Enter fullscreen mode Exit fullscreen mode

2. Configure the FPM Pool

Create a configuration file to define the execution boundary for your application at /opt/axonasp/fpm/fpm.d/app.conf:

site_name = "legacy_app"
uid = 1001
gid = 1001
socket = "/var/run/axonasp/legacy_app.sock"
config_file = "/opt/axonasp/config/axonasp.toml"
app_path = "/var/www/legacy_app"
memory_limit_mb = 256
max_restarts = 5
Enter fullscreen mode Exit fullscreen mode

Start the FPM service:

sudo systemctl start axonasp-fpm
Enter fullscreen mode Exit fullscreen mode

3. Nginx Configuration

Configure Nginx to route .asp requests to the FPM Unix socket. You must pass standard CGI variables for correct script path resolution.

server {
    listen 80;
    server_name legacy.example.com;
    root /var/www/legacy_app;
    index index.asp index.html;

    location ~ \.asp$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/axonasp/legacy_app.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}
Enter fullscreen mode Exit fullscreen mode

Method 2: Caddy + AxonASP Module (Recommended)

For most deployments, managing standalone worker daemons and Unix sockets is unnecessary overhead. The AxonASP Caddy module executes the ASP runtime natively within the Caddy HTTP request handlers. This provides a zero-process architecture with automatic HTTPS.

1. Install Caddy with the AxonASP Module

Download the pre-compiled Caddy binary containing the embedded AxonASP module from the GitHub releases page, or compile it yourself using xcaddy:

xcaddy build --with g3pix.com.br/axonasp/v2/caddy=. 
Enter fullscreen mode Exit fullscreen mode

2. Caddyfile Configuration

Enable ASP processing by adding the axonasp directive to your site block.

legacy.example.com {
    root * /var/www/legacy_app
    route {
        axonasp {
            site_name production_app
            global_asa_path /var/www/legacy_app/global.asa
        }
        file_server
    }
}
Enter fullscreen mode Exit fullscreen mode

3. Structural Advantages of the Caddy Module

  • Native Storage Integration: Temporary files and bytecode cache resolve securely inside Caddy's native storage hierarchy, creating dedicated subfolders per site to prevent session collisions.
  • Automatic Indexing: The module automatically checks the disk for index.asp, default.asp, home.asp, or main.asp and processes them before falling back to Caddy's standard static file server.
  • Security by Default: Direct HTTP requests for sensitive files like global.asa are intercepted and return a 404 Not Found, while the internal engine reads them securely from the filesystem.

Stop maintaining Windows Server licenses for legacy code. Deploy on Linux, leverage Caddy's simplicity, and reduce infrastructure complexity.

Top comments (0)