端口 8080 上的虚拟主机 XAMPP 无法正常工作

Virtual Host XAMPP on port 8080 doesn't works fine

我想 运行 XAMPP 上的虚拟主机,但重定向到端口 :8080。这里的问题是我在端口 :80 上有 IIS 运行ning,在端口 :8080 上有 Apache,这些是我的配置文件,用于尝试 运行 我在虚拟主机上的项目:

主机文件

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
    127.0.0.1   www.goviaje.com

httpd-vhosts.conf

# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:8080
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.

##<VirtualHost *:80>
    ##ServerAdmin webmaster@dummy-host2.example.com
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
    ##ServerName dummy-host2.example.com
    ##ErrorLog "logs/dummy-host2.example.com-error.log"
    ##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>

<VirtualHost *:8080>
   ServerAdmin localhost:8080
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost:8080
</VirtualHost>

<VirtualHost *:8080>
  DocumentRoot "C:/xampp/htdocs/goviaje/"
  ServerName www.goviaje.com:8080
  ServerAlias goviaje.com:8080
 <Directory "C:/xampp/htdocs/goviaje">
   Options Indexes FollowSymLinks
   AllowOverride All
   Order allow,deny
   Allow from all
 </Directory>
</VirtualHost>

httpd.conf中的所有必要模块都已启用

好的,当我在浏览器中输入 "www.goviaje.com" 时,它会将我转到 IIS 主页 (localhost:80),我需要转到 localhost:8080/goviaje/

有人可以帮我吗?

您必须使用 www.goviaje.com:8080 作为网站 URL 才能访问 Apache,因为默认 HTTP 端口是 80,因此 IIS 正在处理您的请求。另外,当然,您可以将 IIS 配置为转发代理。