Articles of 虚拟主机

在Apache中阻止非虚拟主机访问?

我正在运行一个Apache服务器,有大约七个域名的虚拟主机。 现在,我想禁止只使用其IP地址访问我的服务器的客户访问。 所以: 当有人通过www.domain.com访问我的网站时,他们会访问/var/www/domain.com/public_html/托pipe的网站。 当有人input服务器的IP地址时,他们到达了403 Forbidden消息。 这个问题是,他们理论上能够通过暴力,当http://11.22.33.44/domain.com/public_html/到达我的其他网站。 我宁愿让他们一直达到403 Forbidden访问,只要他们不通过有效的域名访问我的服务器。 我如何解决这个问题?

Apache虚拟主机redirect到其他服务器

这是情况: 服务器A主机“ http://internal.intranet ” 服务器B托pipe“ http://servernameb.intranet/foo/bar ”上的内部应用程序 服务器A需要将所有传入的httpstream量redirect到服务器B的地址,而用户不会注意到它。 我可以很容易地做到这一点与以下configuration文件: <VirtualHost 10.0.4.26> ServerName internal.intranet ServerAlias internal RewriteEngine on # Deny TRACE/TRACK request methods RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* – [F] #RewriteRule "^/files(.*)$" "/files$1" [L] # Everything else not matched above needs to go to the servlet container # via HTTP listening on port 8008. The [P] […]

虚拟主机都显示相同的内容

我有一个叫做Homenet.com的域名,有两个子域名:wiki.homenet.com和intranet.homenet.com。 出于某种原因,无论我input什么内容,都会显示来自intranet.homenet.com的内容。 我的虚拟主机文件如下: # # Use name-based virtual hosting. # NameVirtualHost *:80 <VirtualHost *:80> ServerName intranet.homenet.com DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" </VirtualHost> <VirtualHost *:80> ServerName wiki.homenet.com DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/wiki" </VirtualHost> 我通过从运行DNS和Apache(Windows XP)的服务器浏览到wiki.homenet.com,然后重新启动Apache并停止工作(即使在我颠倒过来改变)。 我已经检查了这个板上的其他新手,我的虚拟主机文件似乎是正确的…只是没有工作。 有任何想法吗? 谢谢! PS>我有一个DNS服务器运行,指导wiki.homenet.com和intranet.homenet.com到我的Apache服务器。 Apache和DNS都驻留在同一台服务器(192.168.1.149)上。

在Plesk中自动创buildvhost.conf

我们正在使用Plesk 9.2运行服务器,并从Web界面创build域。 使用的CMS系统需要为每个创build的域创build一个自定义的vhost.conf文件,这个重复的任务变得无聊了。 有没有办法在创build域时自动在Plesk中创build这个文件?

我希望我的托pipe的博客出现在特定的url下

我有我的网页设置在example.com下。 现在,通常外部托pipe的博客服务,如tumblr或posterous或wp将允许您在您的网站上托pipe您的博客,即example.com。 我想要的是,我的博客出现在example.com/b/下,等等。 因为我已经为example.comconfiguration了我的网页虚拟主机。 那么我怎么configuration我的apache网站呢? 这里是我现有的apache vhost: ServerSignature Off ServerTokens Prod <VirtualHost *:80> ServerName example.com ServerAlias www.example.com ServerAdmin [email protected] DocumentRoot /opt/example/ <Directory /opt/example/> Options FollowSymLinks MultiViews Includes AddOutputFilter Includes html AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug Off DirectoryIndex index.py index.html </Directory> #Enable gzip for all content except images. SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary […]

使用BIND虚拟主机?

我创build了以下虚拟主机: <VirtualHost *:80> ServerName testingsitehere.com ServerAlias www.testingsitehere.com DocumentRoot /www/vhosts/testingsitehere.com ErrorLog /www/Apache22/logs/error.log <Directory "/www/vhosts/testingsitehere.com"> Options All AllowOverride All order allow,deny allow from all </Directory> </VirtualHost> 并安装了BIND。 这是一个testing服务器,不是面向公众的,所以没有人可以访问这些。 它使用Web-Developer Server Suite(因此是C:/ www / vhosts文件夹path)。 我应该使用HOSTS文件上的BIND映射我的域到本地主机,还是应该像我以前一样继续使用HOSTS? BIND实际上可以将域名/ DNS映射到本地主机,127.0.0.1还是我误解了? 干杯

在子域上设置一个SVN仓库

我已经find了一些设置Subversion版本库的指南,并通过一个子域(在Apache中使用一个虚拟主机)使其可用,但由于某些原因无法正常工作。 这是迄今为止我所得到的: 创build了一个子域“svn.mydomain.com” 使用新的VirtualHostconfigurationApache: <VirtualHost *:80> ServerAdmin [email protected] ServerName svn.mydomain.com <location> DAV svn SVNPath /Volumes/Storage/Resources/Subversion/svn_repo </location> </VirtualHost> 现在我没有任何身份validation(保持简单,直到我得到这个工作)。 我错过了什么明显的? 如果没有,有什么想法/build议?

Apache别名不能正常工作,但只能在一些虚拟主机上运行

使用Apache 2.2运行Mac OS X Server,并configuration了多个虚拟主机。 我们有一个我们为客户提供的内容pipe理系统,并具有一个别名设置,可以将每个客户端映射到共享代码库,如下所示: 别名“/ admin”“/ path / to / admin” 这个别名正在我们的大部分虚拟主机上工作,但是在一两个失败…任何想法?

Apacheconfiguration的子域问题

我试图达到以下目的: http:// site.com – >主站点(用www.site.com重写没有www) https:// predeploy.site.com – >第二个站点(密码保护和SSL) https:// site.com – >连接被拒绝 http:// predeploy.site.com – >连接被拒绝 子域的DNS由Alogging而不是CNAME完成,因为它们显然是Linode名称服务器的首选方法。 site.com和predeploy.site.com都parsing为相同的IP。 我有两个虚拟主机设置: NameVirtualHost *:80 <VirtualHost *:80> ServerName site.com ServerAlias www.site.com DocumentRoot /var/www/site.com RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] </VirtualHost> NameVirtualHost *:443 <VirtualHost *:443> ServerName predeploy.site.com DocumentRoot /var/www/predeploy.site.com SSLEngine on … # Basic auth and SSL […]

Apache子域名不能正常工作:使用真实域名

假设我有domain.com和sub.domain.com。 Domain.com的根应该是/ var / www / domain_com /和sub.domain.com的根应该是/ var / www / domain_com / sub / 。 在/ etc / apache2的/网站启用/ domain_com: <VirtualHost sub.domain.com> ServerName sub.domain.com DocumentRoot "/var/www/domain_com/sub/" ErrorLog "/var/log/subdomain-error.log" CustomLog "/var/log/subdomain-access.log" combined <Directory "/var/www/domain_net/sub/"> Order allow,deny Allow from all AllowOverride All </Directory> </VirtualHost> <VirtualHost domain.com> ServerName domain.com DocumentRoot "/var/www/domain_com/" ErrorLog "/var/log/apache2/domain-error.log" CustomLog "/var/log/apache2/domain-access.log" combined […]