gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 00:54:02 25 4
gpt4 key购买 nike

我想在 XAMPP 上运行虚拟主机,但重定向到端口:8080。这里的问题是我在端口 :80 上运行 IIS,在端口 :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 配置为转发代理。

关于php - 端口 8080 上的虚拟主机 XAMPP 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37314913/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com