Debug code in Virtual Host in VS Code plugin

The following procedure includes the steps to debug code in the VS Code plugin on a Virtual Host.

  1. Hover on Server Manager and select the + icon. 

    The tab ColdFusion server setup opens.

  2. In the General Settings section, enter the following:

    • Server Name - Enter any name for the server, for example, CF2023.
    • Host Name - This is the hostname where ColdFusion runs, for example, localhost/127.0.0.1.
    • Description - Enter a short description of the server. It's an optional field, for example, ColdFusion 2023 Update6 Server.
    • WebServer Port - The port on which CF runs, for example, 8500.
    • Application Server - In the case of standalone server installation, this would be CF+Tomact Bundle.
    • RDS User Name - Enter the username you provided when installing ColdFusion.
    • RDS Password - Enter the password that you provided when installing ColdFusion.
    • Test Connection - Click the button to validate the RDS connection with the username and password that you provided. If the information you entered is correct, the message "Test Connection was successful" displays.
    • Type - Select the radio button Is local in case of the local server.

    Select Next.

  3. In the Local Server Settings section, enter the following:

    • Server Home - Click Browse and in the file explorer, select the location of the server home where ColdFusion is installed, for example, C:\ColdFusion2023\cfusion.
    • Document Root - By default, it is populated based on the Server Home provided. If not, click on the "Browse" button, and in the file explorer, select the location of server webroot where ColdFusion is installed, for example, C:\ColdFusion2023\cfusion\wwwroot.
    • Version - Select the version of ColdFusion from the dropdown that you are trying to add, for example, 2023.

    Click Next.

  4. In Virtual Host Settings tab, select Add New.

  5. For the Virtual Host to work, create a ColdFusion connector in the webserver, for example, IIS/Apache. Enter the following details:

    • Name - Enter any friendly name, for example, VH1.
    • Host Name - Enter the hostname where the VH is created, for example, local.
    • Port - Enter the port where the VH is running, for example, 94.
    • Document Root - Provide the path till the project name in the VH, for example, C:\inetpub\cf13\TestProject_VH.

    Select Add. The details of the new virtual host are displayed in the table.

  6. Execute the files in the Virtual Host. Follow the steps:

    1. Create a project inside the Virtual Host folder. The project path should be exactly the same as mentioned in Document Root, for example, C:\inetpub\test_vscode\ws\P2. When selecting the server, select the server name that is suffixed with the Virtual host, for example, CF2023-VH1.
    2. Create a cfm file inside the project folder, for example, index.cfm, and you should be able to execute the cfm file by right-clicking on the cfm file in the editor and selecting Run as ColdFusion Application.
  7. Debug the file that is present inside the project that is in the Virtual Host.

Get help faster and easier

New user?