我正在一个Zend的web项目工作,并有一个要求,它的工作原理,它在顶级域,以及在这样的域+目录path: www.myDomain.com www.myDomain.com/somedir/myproject/ 在项目中有一个很好的实现方式,用来找出basePath并正确地包含文件(我inheritance了来自未知但开发人员的代码); 但是我没有设置我的VHosts来testing第二个例子www.myDomain.com/somedir/myproject/如果我所有的工作都正常的话。 我目前的设置是尽可能简单: #hosts 127.0.0.1 www.myDomain.com 。 #httpd-vhosts.conf NameVirtualHost *:80 <Directory C:/Projects> Order Deny,Allow Allow from all </Directory> <VirtualHost *:80> DocumentRoot C:\wamp\www ServerName localhost </VirtualHost> <VirtualHost *:80> DocumentRoot "C:\Projects\MyProject\public_html" ServerName "www.myDomain.com" </VirtualHost> #@ToDo make this work … #<VirtualHost *:80> # DocumentRoot "C:\Projects\MyProject\public_html" # ServerName "www.myDomain.com/somedir/myproject/" #</VirtualHost> 我可以用虚拟主机来做这个吗? 在本地机器上实现此设置的最佳做法是什么? 编辑:该项目使用Zend和前端控制器体系结构 (所有请求都redirect到index.php)和.htaccess当前重写规则是: RewriteEngine On […]
我需要使用基于名称的虚拟主机通过SSL托pipe一些Web应用程序。 如果所有站点都被SSL证书覆盖,那么Apache文档指出这是可能的( https://wiki.apache.org/httpd/NameBasedSSLVHosts )。 有没有一种方法可以将httpsstream量用于多个域名(如* .foo.com和* .bar.com)? 我看到有一个名为UCC的证书( http://support.godaddy.com/help/article/3908/what-is-a-multiple-domain-ucc-ssl-certificate )似乎正在做我正在寻找对于。 这可以用于我的目的吗? 还有其他更好的select吗?
我正在寻找一个解决scheme转发一个公共IP地址和一个特定的端口到不同的机器基于主机名(截至目前,我只需要HTTP)。 目前的设置是在商品路由器上的NAT(它只提供私有IP地址/端口转发的简单公共端口)。 如果需要,我可以在路由器之前添加Windows Server 2008 R2计算机,但不希望这样做。 所以理想情况下,我想要有一个Windows服务器上的当前设置和转发。 是否有可能做到这一点?
嗨,对不起,总是对阿帕奇和苹果在这里…感觉答案是非常明显的,但我一直在寻找年龄没有成功 我在/private/etc/apache2/extra/httpd-vhosts.conf中有以下几行 NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/Library/WebServer/Documents/mfoe/" ServerName mfoe.cycle </VirtualHost> httpd.conf文件包含虚拟主机 # Virtual hosts Include /private/etc/apache2/extra/httpd-vhosts.conf 那么为什么当我在terminal运行命令:$ httpd -S我得到: httpd: Could not reliably determine the server's fully qualified domain name, using Alexs- MacBook-Air.local for ServerName VirtualHost configuration: Syntax OK 看起来好像没有在虚拟主机中读取任何东西。 在重新启动时出现这个错误可能有什么? Alexs-MacBook-Air:/ alex$ httpd -k restart httpd: Could not reliably determine the […]
几个月前,我使用apache,passenger和virtualhost设置了一个rails应用程序,并且我(最终)让一切正常工作。 现在我正在尝试在同一个盒子上托pipe另一个应用程序。 我已经添加了新的虚拟主机(见下面 – app2),并编辑我的主机文件指向托pipeIP(192.xx10),但是当我inputapp2.host.com我得到的app1。 另外,当我浏览到http://192.xx10时,我会自动获取app1。 这是正常的吗? 我的httpd.conf文件如下所示: LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.9 PassengerRuby /usr/bin/ruby1.8 <VirtualHost *:80> ServerName app1.host.com DocumentRoot /var/www/app1/public <Directory /var/www/app1/public> AllowOverride all Options -MultiViews </Directory> ErrorLog /var/log/apache2/error.log </VirtualHost> <VirtualHost *:80> ServerName app2.host.com DocumentRoot /var/www/app2/public <Directory /var/www/app2/public> AllowOverride all Options -MultiViews </Directory> ErrorLog /var/log/apache2/error.log </VirtualHost> 我已经做了很多的研究,我看到的一切似乎都表明我缺less一个NameVirtualHost *:80但是我已经在我的ports.conf文件中包含了这个。 我真的希望有人能帮助我。 我在Ubuntu服务器上。 预先感谢您提供的任何帮助。
我在centOS上安装了两个文件夹(虚拟主机) – / 2012和/ 2011。 当浏览到“ http://my.moodle/2012 ”或“ http://my.moodle/2011 ”并且validation(到任何一个)时,我怎么能自动被authentication到另一个? 更清楚的是:当我到2011年进行身份validation时,我想在2012年进行身份validation,反之亦然。 那可能吗?
我有一个运行所有我的PHP Web应用程序的apache2服务器,我试图运行一个nodejs应用程序。 我已启用代理和proxy_http,但始终显示503服务不可用页面 <VirtualHost *:80> SERVERNAME abc.mysite.com SERVERALIAS www.abc.mysite.com DocumentRoot /var/www/html/node_app/ options -Indexes ProxyRequests off #ProxyPass /maintenance.html ! ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ </VirtualHost> node_app文件夹中有启动快速服务器的app.js 这是我的app.js var http = require('http'), express = require('express'), chatServer = require('./lib/chat-server'); var app = express(); app.use(express.static(__dirname + '/public')); var server = http.createServer(app).listen('3000', '127.0.0.1'); app.get('/', function(req, res){ res.sendFile(__dirname + '/views/index.html'); […]
我已经成功地在我的服务器上设置了Gitlab,并将其configuration为在Apache上运行,因为这是我用来托pipe我当前的网站。 我已经使用Let's Encrypt在我的域中添加SSLencryption,并select使它们“安全”,因此在我的所有.conf文件中都放置了重写规则,以将HTTP请求redirect到HTTPS。 这适用于除了Gitlab之外的所有其他.conf文件。 它使用下面的来处理redirect: RewriteCond %{SERVER_NAME} = gitlab.example.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent] 任何人都可以帮助指出为什么它可能无法正常工作? 以下全虚拟主机: <VirtualHost *:80> ServerName gitlab.example.com ServerSignature Off ProxyPreserveHost On # Ensure that encoded slashes are not decoded but left in their encoded state. # http://doc.gitlab.com/ce/api/projects.html#get-single-project AllowEncodedSlashes NoDecode <Location /> # New authorization commands for apache 2.4 and up # http://httpd.apache.org/docs/2.4/upgrading.html#access Require […]
我在我的Mac上运行本地Apache进行开发,并且还有运行在http://127.0.0.1:8000/ node.js服务器。 我使用Apache项目的.dev域,并希望.node域redirect到node.js服务器。 我有虚拟主机设置如下: <VirtualHost *.dev:80> VirtualDocumentRoot "/www/sites/%1/wwwroot" ServerName sites.dev ServerAlias *.dev UseCanonicalName Off </VirtualHost> <VirtualHost *.node:80> ServerName sites.node ProxyPass "/" "http://localhost:8000" ProxyPassReverse "/" "http://localhost:8000" </VirtualHost> 但是,当我尝试应用这些设置时,出现错误: [core:error] [pid 8594] (EAI 8)nodename nor servname provided, or not known: AH00547: Could not resolve host name *.node — ignoring! 我应该注意到, .dev域可以按照预期工作,并且node.js服务器可以在http://localhost:8000/ ,只是不在http://test.node/ 。 我在这里错过了什么?
我已经跑了一段时间的墙壁,所以我张贴在stackoverflow,我被指出在这里… 我正在尝试在Snow Leopard上设置多个IP地址,以便我可以使用SSL证书进行开发。 我正在运行XAMPP – 我不知道是否是这个问题,但我想我会遇到同样的问题,考虑到内置的Apache被closures。 所以首先,我开始研究启动IP。 我启动了一个运行正确的新的StartupItem,因为我可以ping通ip地址: ping 127.0.0.2 ping 127.0.0.1 而且他们都工作。 所以现在我有IP地址,你可能知道在OSx上不是标准的。 我编辑了/etc/hosts文件以包含新的网站: 127.0.0.1 site1.local 127.0.0.2 site2.local 我已经改变了httpd.conf使用httpd-vhosts.conf – 因为我有一个IP地址上运行几个站点。 我已经编辑了vhosts文件,所以一个网站看起来像这样: <VirtualHost 127.0.0.1:80> DocumentRoot "/Users/jim/Documents/Projects/site1/web" ServerName site1.local <Directory "/Users/jim/Documents/Projects/site1"> Order deny,allow Deny from All Allow from 127.0.0.1 AllowOverride All </Directory> </VirtualHost> <VirtualHost 127.0.0.1:443> DocumentRoot "/Users/jim/Documents/Projects/site1/web" ServerName site1.local SSLEngine On SSLCertificateFile "/Applications/XAMPP/etc/ssl-certs/myssl.crt" SSLCertificateKeyFile "/Applications/XAMPP/etc/ssl-certs/myssl.key" […]