简体   繁体   English

apache(端口80)和iis(端口8080)

[英]apache (port 80) and iis (port 8080)

Need the following please: 需要以下请:

 http://subdomain.test.co.uk/newsite  --> redirect to apache port 80
 http://subdomain.test.co.uk  -->   redirect to iis on port 8080

Have changed IIS to run on 8080 and both sites run fine using localhost. 已将IIS更改为在8080上运行,并且两个站点都使用localhost运行正常。

Have also enabled the following in httpd.conf 还在httpd.conf中启用了以下内容

LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_proxy.so

Then added following to httpd-vhosts.conf 然后在httpd-vhosts.conf中添加以下内容

<VirtualHost *:80>
ServerName subdomain.test.co.uk
ServerAlias *
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
</VirtualHost>

but no content is loaded when goto domain - please advise TQ 但是当goto域没有加载内容 - 请告知TQ

Sounds like you need to be able to redirect from both. 听起来你需要能够从两者重定向。 If in "root" folder, and in appache, then redirect to iis (port 8080). 如果在“root”文件夹中,并在appache中,则重定向到iis(端口8080)。 If in subfolder and in iis, then redirect to appache (port 80). 如果在子文件夹和iis中,则重定向到appache(端口80)。

So, in IIS, you can create the subfolder and set it as an application. 因此,在IIS中,您可以创建子文件夹并将其设置为应用程序。 Then within it, go to HTTP Redirect. 然后在其中,转到HTTP重定向。 And that should work for that side of things. 这应该适用于那方面的事情。 (I usually do this by having a HTTP site that redirects to a HTTPS site, to thereby force HTTPS.) Just include the port number in your case. (我通常通过将HTTP站点重定向到HTTPS站点来执行此操作,从而强制使用HTTPS。)只需在您的案例中包含端口号即可。 And you should be started on the right path. 你应该开始走正确的道路。

But honestly, I'd set these up differently. 但老实说,我会以不同的方式设置它们。 I'd use the subdomain to the purpose that you want to do with folders. 我将子域用于您要对文件夹执行的目的。 I'd have newsite.test.co.uk; 我有newsite.test.co.uk; if its an option, as that would make me more comfortable. 如果它是一个选项,因为这会让我更舒服。

Or, if you keep going in your direction, then I'd set IIS to port 80, and Appache to port 8080, putting the base site at the default port, and the new site at the new port. 或者,如果你继续朝着你的方向前进,那么我将IIS设置为端口80,将Appache设置为端口8080,将基站设置为默认端口,将新站点设置为新端口。

Related: 有关:

How to set up subdomains on IIS 7 如何在IIS 7上设置子域

How to redirect a site to another location in IIS7 如何将站点重定向到IIS7中的另一个位置

Apache redirect Apache重定向

https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-apache-and-nginx https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-apache-and-nginx

如果您正在运行虚拟机,您可以添加另一个网卡并为其分配IP,然后在您的路由器中配置每个端口以转到不同的IP

You also need to have an entry in hosts file which would be located C:\\Windows\\System32\\drivers\\etc . 您还需要在hosts文件中有一个条目,该文件位于C:\\Windows\\System32\\drivers\\etc Open this file in notepad or any other text editor and another entry like the below at the last line of your file and then try again. 在记事本或任何其他文本编辑器中打开此文件,在文件的最后一行打开下面的其他条目,然后重试。

127.0.0.1       subdomain.test.co.uk

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM