Articles of 虚拟主机

虚拟机中的名字“localhost”可以映射到主机的IP吗?

我有一个微软的“现代IE”网站的Windows XP / IE6虚拟机镜像(使用虚拟PC)。 此虚拟机由Windows 7机器托pipe。 我在主机上有一个本地Web应用程序,需要在IE6中检查(可悲)。 在虚拟机内部,“本地主机”名称可以映射到指向主机的IP地址吗? 我尝试编辑虚拟机中的c:/ windows / system32 / drivers / etc / hosts文件到[主机的IP地址] localhost,但这不起作用。 我想使用“localhost”而不是IP的原因是因为某些Web应用程序的configuration文件指向“localhost”。 我可以将configuration文件更改为指向不同的域名,但我想知道“localhost”名称本身是否可以指向其他名称。 我感觉到“localhost”是一些只能指向127.0.0.1的保留关键字。

只接受裸域请求,而不是子域名

我似乎无法解释Apache接受裸域上的请求,但忽略来自子域的任何内容。 我觉得这应该很容易,但是我发现的一切都与redirect子域请求有关,而不是忽略它们。 我目前的设置: <VirtualHost *:80> ServerName example.com DocumentRoot /var/www/example </VirtualHost> 访问something.example.com指向example.com ,我希望它失败, 404 not found 。 我大概可以用mode_rewrite排除所有的东西,但这是最好的解决scheme吗? 还是应该在DNS级别上执行此操作? 感谢您帮助我解决这个问题。

升级到Apache 2.4:VirtualHost命令无效“AssignUserID”

我有很多具有相同configuration的Apache 2.2虚拟主机: <VirtualHost *:80> ServerAdmin [email protected] ServerName site.com ServerAlias www.site.com DocumentRoot /home/site.com/htdocs/ ErrorLog /home/site.com/logs/error.log CustomLog /home/site.com/logs/access.log common AssignUserID site.com ftp <Directory /home/site.com/htdocs/> DirectoryIndex index.html index.htm index.php Options Includes FollowSymLinks SymLinksIfOwnerMatch AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> 尝试在Apache 2.4上运行相同的configuration时出现错误: Performing sanity check on apache24 configuration: AH00526: Syntax error on line 8 of /usr/local/etc/apache24/Includes/site.com.conf: […]

在端口80上运行页面的现有服务器上运行Node.JS应用程序

我在www.example.com上有一台服务器,运行由Apache提供的PHP制作的网页,该页面正在监听端口80。 现在我想在域www.example2.com上为我的Node.JS服务。 这两个页面应该在同一台服务器上,Node.JS应用程序应该在端口3000上运行。 我该如何实现? 从其他答案和博客文章(如这个: http : //garr.me/blog/running-node-js-and-apache-together-using-mod_proxy/ )我已经了解到,我可以创build一个ReverseProxyredirectwww .example.com /应用程序到我的应用程序,但是这不是预期的行为。 我想要的是这个新的域www.example2.com去端口3000服务器的IP地址。 侧面的问题:这个问题可能听起来很愚蠢,但是,我不能把整个域redirect到端口3000的服务器的IP地址从GoDaddy / Route53的域名configuration? 谢谢。

你如何制作一个指向SMBnetworking共享的apache虚拟主机?

我有一个SMB文件共享在我的本地networking上。 我将所有的网站存储在这台服务器上。 我有另一台运行CentOS的服务器托pipe一个Apache Web服务器。 你将如何创build一个指向SMB分享的虚拟主机? SMB服务器的path是smb://10.0.0.177/fms%20studios/Websites 。 这是我目前在我的httpd-vhosts.conf文件中。 <VirtualHost *:80> ServerAdmin [email protected] ServerName tree.fmsds.xyz ServerAlias www.tree.fmsds.xyz DocumentRoot "smb://10.0.0.177/fms%20studios/Websites/" <Directory "smb://10.0.0.177/fms%20studios/Websites/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> </VirtualHost>

什么是理想的networking托pipe环境,为什么?

对我来说,它将包括: stream量通过防火墙路由,然后通过负载均衡器连接到N + 1(Web)服务器。 Web服务器连接到它们后面的群集SQL服务器群集,并通过分布式状态服务运行状态。 这提供了防火墙的安全性,连接冗余(NLB)和数据冗余(集群SQL)。

Apache2:VirtualHost不起作用

我在将域名redirect到服务器上的特定文件夹时遇到问题。 我正在读这里的东西: 这些是我的configuration线: #This is the default Apache2 configuration lines <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www #This is what I've added <VirtualHost *:80> DocumentRoot /var/www/astudio/sites/mywebsite ServerName www.mywebsite.com </VirtualHost> 然而,它不工作..域只是不转发用户到我的网站..还有什么我必须configuration?

主机:1个Windows,1个Linux,1个Internet IP地址。 怎么样?

我有1个互联网IP地址。 我有2个物理networking服务器。 1 Windows IIS7托pipe3个网站。 主机头名称在IIS7中configuration。 这工作正常,直到我添加: 1 Linux(Ubuntu lucid)Apache2托pipe1个网站。 VirtualHost在Apache2中configuration。 我遵循以下步骤: http : //ubuntu-tutorials.com/2008/01/09/setting-up-name-based-virtual-hosting/ 两台服务器似乎在玩“拔河”。 这可能只是一个错误的configuration,或者是这种设置应该发生的问题?

Apache2:未定义的域指向同一个虚拟主机

我有一个虚拟主机的debian框中configurationApache2。 我有几个域指向该框的IP地址。 虚拟主机configuration的域完美地工作。 但是如果我在浏览器中input一个指向这个盒子但是没有configuration虚拟主机的域名,我就可以到达一个盒子中另一个域名的随机虚拟主机。 不是一个随机的,而是一个虚拟主机(总是一样的),但我不知道为什么是这样。 正确的是,没有configuration为虚拟主机的域名会返回一个主机名称错误,对不对? 有人知道如何解决这个问题吗? 我的一个虚拟主机configuration文件: <VirtualHost *:80> ServerAdmin [email protected] ServerName dl.domain.com DocumentRoot /var/www/dl.domain.com/public_html/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/dl.domain.com/public_html/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog […]

在虚拟主机的定义中使用正则expression式

我必须在服务器configuration文件中定义大约100个子域虚拟主机条目。 我想知道是否有任何方法使用正则expression式来增加apacheconfiguration文件中的代码?