It seems to be assuming the Listen only specifies the port. The replacement below gets stuff working for Listen 127.0.0.1:whateverport ' Returns port number configured in httpd.conf Function us_get_apache_port() us_get_apache_port = us_get_port("^Listen\s+(?:\S+?(\d+)", USF_APACHE_CNF) End Function