How to add multiple port numbers and multiple web roots in Apache in localhost

Add the following at the end of Apache’s httpd.conf file, which is located in ApacheHomeDirectory/conf/

Listen 88

<VirtualHost *:88>
    DocumentRoot "C:\Users/anna/Documents/Sites/test"

<Directory "C:\Users/anna/Documents/Sites/test">
    <IfVersion < 2.3 >
    Order allow,deny
    Allow from all
    <IfVersion >= 2.3>
    Require all granted

Then restart Apache server, if you have an index page in C:\Users/anna/Documents/Sites/test/, type the following in your favorite browser, it should show the index page.


If you want to change the localhost:88 to another domain name such as, add this line to the hosts file
Then, you can access the site from

The hosts file in Windows:

The hosts file in Mac OS or Linux:

Search within Codexpedia

Custom Search

Search the entire web

Custom Search