http://localhost/. With a virtual host, your project at C:\projects\myapp\ becomes accessible at http://myapp.local/, making it easier to test realistic URLs and work with multiple projects simultaneously.
How to add a virtual host
Right-click the Bearsampp tray icon
Find the Bearsampp icon in your Windows system tray and right-click it.
Enter the server name
In the Server name field, type the local domain you want to use (e.g.
myapp.local). The dialog pre-fills test.local as a placeholder.Set the document root
Click Browse next to the Document root field and select the folder containing your project files. This is the folder Apache will serve when the domain is requested.
What Bearsampp creates
When you save a virtual host, Bearsampp does two things:- Creates a config file at
bearsampp\vhosts\myapp.local.confcontaining the Apache<VirtualHost>block. - Generates an SSL certificate for the server name and stores it in
bearsampp\ssl\.
Add the domain to your hosts file
After creating the virtual host, you must tell Windows to resolve the domain to your local machine. Without this step, your browser will try to look up the domain on the internet and fail. You can do this with the HostsEditor tool included in Bearsampp, or by editing the hosts file manually.Using HostsEditor (recommended)
Editing the hosts file manually
Open Notepad as Administrator
Press Start, search for Notepad, right-click it, and choose Run as administrator.
http://myapp.local/ in your browser to access your project.
Edit a virtual host
To change the configuration of an existing virtual host:- Right-click the tray icon → Apache → Edit [servername].
- The config file opens in your configured text editor.
- Make your changes, save the file, and restart Apache from the tray menu.
Delete a virtual host
- Right-click the tray icon → Apache → Edit [servername].
- Click Delete in the dialog.
- Confirm the deletion. Bearsampp removes the
.conffile and restarts Apache.
Deleting a virtual host from the Bearsampp menu removes the config file at
bearsampp\vhosts\, but does not delete the SSL certificate from bearsampp\ssl\ or remove the entry from your hosts file. You can clean those up manually if needed.