Articles of 虚拟主机

Apacheconfiguration将所有请求定向到一个虚拟主机,除直接IP或指定的请求外

我想知道我必须添加到apache.conf文件来实现以下function: 对于没有指定虚拟主机的所有请求,他们必须去我指定的虚拟主机之一(但我不想使用ServerAlias,因为有太多的域名,我将不得不列出)。 而且我也不想使用ErrorDocument 404选项,因为我已经使用它了。 在networking服务器的直接IP上的请求将做一个redirect到另一台服务器上的URL(现在我使用PHPredirect,在www根目录中有一个index.php)

为什么我的虚拟主机设置被忽略?

在/srv/www/vhosts/myproject.de/subdomains/trac/conf我的vhost.conf文件位于: http : //pastebin.com/xTgdnkvr 不过,Apache似乎忽略了这个设置。 每个http请求都被路由到/srv/www/vhosts/myproject.de/subdomains/trac/httpdocs而不是路由到/srv/www/vhosts/myproject.de/subdomains/trac/htdocs 。 对vhost文件进行更改后,我总是重新configuration它,然后从命令行重新启动httpd。 任何想法可能是错的? 也许其他一些configuration覆盖它?

将端口更改为非80后,无法访问Apache

我不知道什么是错的,我只是更改了/etc/httpd/conf/httpd.conf,现在我无法从非环回地址访问它。 改变之后: Listen 2999 <VirtualHost *:*> DocumentRoot "/var/www/html" </VirtualHost> lsof -i:2999输出lsof -i:2999 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME httpd 23989 root 4u IPv4 27581116 TCP *:remoteware-un (LISTEN) httpd 24001 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN) httpd 24002 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN) httpd 24003 apache 4u IPv4 27581116 TCP […]

VirtualHost不工作​​?

问题: 在我的本地机器上,我想inputURL homepage.local,我想打开我的本地网页index.html在我的本地目录/Users/prime/Homepage/ 。 我以为我可以通过使用下面的虚拟主机configuration来实现这一点,但似乎没有工作。 将以下内容添加到我的httpd.conf文件中 <VirtualHost *:80> ServerName homepage.local ServerAlias *.homepage.local DocumentRoot "/Users/prime/Homepage/" </VirtualHost> 当我去我的网页浏览器,并inputURL homepage.local它不解决我的网页/Users/prime/Homepage/index.html 有任何想法吗? 我在apache错误日志中看不到任何东西。 $ apachectl -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 homepage.local (/private/etc/apache2/httpd.conf:533) 我在OSX(雪豹)上。

Apache上的VirtualHost并不正确

我在Windows 7上运行Xampp的开发服务器。 我的Windows 7主机文件@ (C:\Windows\System32\drivers\etc\hosts)有这个… 127.0.0.1 www.testing.com testing.com localhost 我的Apache http-vhosts.conf (E:\Server\apache\conf\extra\http-vhosts.conf) 文件有这个… <VirtualHost *:80> DocumentRoot "E:/Server/htdocs/myframework" ServerName testing.com ServerAlias www.testing.com </VirtualHost> <VirtualHost *:80> DocumentRoot "E:/Server/htdocs/" ServerName localhost ServerAlias localhost </VirtualHost> 现在我的问题是,当我去浏览器testing.com , www.testing.com ,或localhost ,它总是从E:/Server/htdocs/myframework加载文件,所以真正的问题是当我去localhost应该从E:/Server/htdocs/加载文件,而不是从E:/Server/htdocs/myframework 我在这里不知所措,有人可以帮我解决这个问题吗?

Slackware上的Apache2:VirtualHostconfiguration – 端口8080上的连接被拒绝

我试图在Slackware服务器上configuration虚拟主机,并且遇到了一个小故障。 当我浏览到本地主机或127.0.0.1时,我得到: Forbidden You don't have permission to access / on this server. 我需要完成在8080configurationWebApp。当我浏览到本地主机:8080或127.0.0.1:8080我得到: Unable to connect Firefox can't establish a connection to the server at 127.0.0.1:8080. 一些上下文:我需要在Slackware上复制Debian / Ubuntu的以下指令,并且需要一个手 – 所以这里是Debian版本: 5. sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha 6. sudo a2enmod rewrite deflate 7. sudo a2ensite koha && /etc/init.d/apache2 reload 到目前为止:我的httpd.conf(LoadModule的东西和评论被遗漏了) ServerRoot "/usr" Listen 127.0.0.1:80 […]

无法弄清楚如何在Apache上创build子域?

我有mod_vhost_alias启用。 我的GoDaddy DNS A-Record Host ='*'指向我的服务器。 在/ etc / apache2 / sites-available / 000-default中我有 <VirtualHost *:80> UseCanonicalName Off VirtualDocumentRoot /var/www/%0/public_html VirtualScriptAlias /var/www/%0/cgi-bin </VirtualHost> 但是当我尝试去subdomain.domain.com我得到: 未find 在此服务器上找不到请求的URL /。 一直在这一天工作! 请帮忙! 谢谢! 更新:所以我得到这个工作,通过更改%0%1,因为我的文件夹名称是“子域”,但现在如果我去domain.com而不是subdomain.domain.com我得到一个错误…我怎么能有两全其美?

在虚拟服务器上安装SSL

我的问题: 在VPS上为一个域安装SSL。 我的服务器: Ubunutu / Apache / mod_ssl / openssl 使用Virutalmin / Webmin 两个IP地址。 我有四个域名托pipe在我的VPS,即有4个虚拟服务器。 在其中的一个域名,即我希望安装comodo SSL的虚拟服务器之一。 到目前为止,我采取的步骤是: 使用virutalmin,生成CSR并从c​​omodo激活SSL。 使用virtualmin,上传了SSL证书。 (我有另外三个CA文件,但我不知道把它们放在哪里。) 现在我得到安全连接失败的错误。 我应该如何去启用只有一个域的SSL。

Apache – redirect到引导

Apache2 CentOS 6 我试图找出如何使Apache VHost将其所有请求发送到索引页作为一种引导。 我不希望改变URL的外观,但所有的请求应该调用相同的index.php文件.. http://url.com/one http://url.com/ http://url.com/one/two/three 上面的例子都应该在索引页上。 谢谢你的帮助..我的大脑受到了伤害 编辑:我似乎得到的地方,直到我冲浪到现有的目录..在这一点上,重写规则似乎不工作.. 谢谢, <VirtualHost *:80> ServerName project_boot DocumentRoot /var/www/html/project_boot <Directory "/var/www/html/project_boot"> AllowOverride None RewriteEngine On RewriteRule ^/.*$ /index.php [QSA,L] </Directory> </VirtualHost>

试图玩阿帕奇虚拟主机,获取访问禁止的错误

我只是在Windows上的XAMPP + Apache上安装虚拟主机,以使其工作,以便http://disko.localredirect到存储项目文件的PC中的文件夹。 我已经将以下几行添加到C:\Windows\System32\drivers\etc\hosts : 127.0.0.1 localhost 127.0.0.1 disko.local ::1 localhost 然后继续编辑文件X:\xampp\apache\conf\httpd.conf ,在文件底部添加这些行(它们是否在任何特殊的地方?): # My custom vhosts NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> DocumentRoot "X:\Work\Web Development\Projects\disko\serverroot" ServerName disko.local </VirtualHost> 通过对文件的快速search,我确定这是该文件中唯一的虚拟主机。 然后,我重新启动Apache,打开我的浏览器,并尝试加载页面http://disko.local/artists.html 。 这是出现的错误: 访问被禁止! 您无权访问请求的对象。 它是读取保护的或不可读的服务器。 如果您认为这是服务器错误,请与网站站长联系。 错误403 disko.local 10/22/11 16:06:58 Apache / 2.2.21(Win32)mod_ssl / 2.2.21 OpenSSL / 1.0.0e PHP / 5.3.8 mod_perl / 2.0.4 Perl / […]