Articles of 虚拟主机

无法让VirtualHosts在SLES 12上的Apache 2.4中从default-server.confinheritance全局设置

我在SLES 12上使用了Apache 2.4.10。根据SLES 12pipe理指南,default-server.conf文件是“所有具有合理默认值的虚拟主机的全局configuration”,而不是更改这些值,而是使用虚拟主机组态。” 我想要做的是添加 RewriteEngine On RewriteOptions Inherit 指令到默认服务器,以确保所有vHosts从httpd.conf中inheritance重写条件和规则。 但是,除非上述指令放置在每个vHost定义中,否则它们不会inheritance。 如何将这些设置全局应用于所有vHost? 这是我的vHost文件: <VirtualHost *:443> ServerName www.example.com DocumentRoot /srv/www/vhosts/test ErrorLog /var/log/apache2/test-error_log CustomLog /var/log/apache2/test-access_log combined HostnameLookups Off UseCanonicalName Off ServerSignature off SSLEngine on SSLCertificateFile /etc/apache2/ssl.crt/server.crt SSLCertificateKeyFile /etc/apache2/ssl.key/server.key SSLCACertificateFile /etc/apache2/ssl.crt/ca.crt SSLHonorCipherOrder on SSLVerifyClient require SSLVerifyDepth 5 SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire +StdEnvVars <IfModule mod_userdir.c> UserDir public_html Include /etc/apache2/mod_userdir.conf […]

防止服务器上的防火墙阻止多个计算机在相同的NAT'ed IP上访问

我遇到了一个奇怪的问题与我的VPS提供商,并想知道是否有防火墙/系统pipe理员经验的人见过这样的事情。 有没有人看到一个情况,防火墙或类似的程序被configuration为当它看到tcp请求来自多个计算机在相同的IP地址的stream量减慢? | | +—+ | -+ | +—-+ | —/ +—+ | | +/ client 1 +—-+——–\ server |-\ | –\ +—+ | -+ | | +—+ NAT client 2 这是一个情景的小图。 服务器首先看到来自客户端1或2(请求顺序无关)的请求,然后从另一台计算机发出的请求延迟10秒钟,直到超时。 来自第一台计算机的请求不会消减。 我已经做了TCP转储,看看会发生什么,但据我所知,无论是造成减速是在tcp数据包或以下 – 这不是任何应用程序级别的信息。 我可以在没有应用程序信息的情况下发送普通的TCP数据包,这一切都是一致的 这太奇怪了,每当我找出这个问题,它只会带来有关configurationNAT的信息。 但是这不是NAT问题 – 只要是这种情况,无论我在哪里,都会发生这种情况。 您可以通过从您的计算机上访问我的服务器zenia.co,然后尝试从同一networking上的另一台计算机或从使用该networking的移动电话上立即访问它来访问它。 只要服务器看到相同的IP但不同的TCP / IP信息(也许不同的窗口大小或TTL的东西,这是令人惊叹的! 这特别令人担心,因为如果两个用户试图从相同的ip访问服务器(就像一个企业的桌面上的两个用户),它会允许一个,但神秘地阻止另一个,然后我可能只是失去了一个用户。 强调 – 我只是有兴趣,如果这是某些服务器types的标准做法 – 这就是为什么我问你networking工程师/系统pipe理员。 我并没有试图解决一些坏事。 技术细节:这个盒子是一个虚拟的CentOS服务器。 无论是打开还是closures防火墙,都会发生这种情况。 […]

Apache DataPower中的反向代理

我一直在检查这个前面的问题Apache虚拟主机SSL背后反向代理似乎是我所寻找的相似。 主要的区别是两个: 我没有使用SSL(现在) DataPower是Apache HTTP服务器之前的反向代理。 我在Apache上有以下configuration: <VirtualHost *:7777> ServerName testsite.example.com Port 80 ServerAdmin [email protected] RewriteEngine On RewriteOptions inherit </VirtualHost> <VirtualHost *:7777> ServerName testserver-01.example.com Port 7777 ServerAdmin [email protected] RewriteEngine On RewriteOptions inherit </VirtualHost> <VirtualHost *:7777> ServerName testsite.example.com Port 7777 ServerAdmin [email protected] RewriteEngine On RewriteOptions inherit </VirtualHost> <VirtualHost *:7777> ServerName testserver-02.example.com Port 7777 ServerAdmin [email protected] RewriteEngine On […]

虚拟主机中定义的url不能在Windows Azure上的远程服务器上工作

我为http://staging.layzer.tunde.com创build了一个虚拟主机,这个url没有指向页面目录,但是如果我input文件path,如http://ip/staging.layzer.tunde.com可以查看页面。 我使用命令sudo a2ensite staging.layzer.tunde.com.conf启用了该站点 请问我做错了什么。

如何将WAMPurlww.xyz.comredirect到ww.abc.com/some-page?

我在网站www.example1.com上工作,这个网站在WAMP服务器上,另一个网站是www.example2.com,当用户在他的浏览器中inputwww.example2.com时,应该被redirect到www.example1 .COM /一些页。 VH的.conf文件 <VirtualHost *> ServerName www.example2.com Redirect 301 / http://example1.com/some-page </VirtualHost> 目前,当用户在浏览器中键入example2.com时,它会redirect到http://example1.com/some-page/some-page/some-page/some-page/some-page/some-page/some-page /一些页 那么,conf文件中的错误是什么?

Apache2虚拟主机1文件的任何URL

我有一个Apache2虚拟主机设置为从任何URL(dns)接入访问,而不是我设置的访问。 基本上我想要任何访问这个来显示一个页面(index.html),但保持用户访问他们的URL在他们的地址栏。 例如 用户访问example.url.com/example.php?param=text 或者他们去anysubdomain.example.com/anything 或subdomain.anotherurl.com/ 那么他们将看到文件index.html但他们的地址栏仍然是example.url.com/example.php?param=text (或无论他们去了哪里) apache2ctl -S输出 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName VirtualHost configuration: wildcard NameVirtualHosts and default servers: *:80 is a NameVirtualHost default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default:1) Syntax OK 非常感谢帮助

启动Apache,尽pipe虚拟主机的SSL证书文件中有错误

我有基于名称的SSL(SNI)虚拟主机的Apache 2.4.10。 虚拟用户可以使用自己的证书并将其上传到服务器。 一切工作正常,直到证书文件(即文件丢失或错误的名称)有一些错误。 问题是如果有一些证书问题,Apache将不会启动。 有一些解决scheme如何启动Apache这个错误(即所有虚拟主机将启动,除了一个虚拟主机失败)? 这不起作用: <If "-f '/path/to/file.crt'"> <VritualHost *:443> SSLEngine On SSLCertificateFile /path/to/file.crt </VirtualHost> </If> …这也不起作用: <VirtualHost *:443> <If "-f '/path/to/file.crt'"> SSLEngine On SSLCertificateFile /path/to/file.crt </If> </VirtualHost> 问题是configuration语法错误“SSLEngine不允许在这里”或“VirtualHost不允许在这里”。 所以我的configuration上面是不允许的Apache。 非常感谢。 编辑:小错字

启用IPv6后,nginx虚拟主机不工作

我刚刚在基于Debian Jessie的nginx 1.8.0 webserver上启用了IPv6。 要做到这一点,我编辑了我的虚拟主机configuration: server { listen 80; listen [2001:1608:10:160:34::2]:80; server_name dominicpratt.de www.dominicpratt.de; return 301 https://dominicpratt.de$request_uri; } server { listen 443; listen [2001:1608:10:160:34::2]:443; server_name dominicpratt.de www.dominicpratt.de; root /var/www/dominicpratt.de; index index.html index.htm index.php; access_log /var/log/nginx/dominicpratt.de_access.log; ssl on; ssl_certificate /etc/nginx/ssl/dominicpratt.de/combined.pem; ssl_certificate_key /etc/nginx/ssl/dominicpratt.de/wildcard.key; location / { try_files $uri $uri/ /index.php?q=$request_uri; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; […]

Apache2虚拟主机不工作(Debian)

我有本地服务器在家里运行的Debian 8.我访问这个服务器的IP地址给路由器。 现在我想尝试使用虚拟主机来使我的服务器更好一些。 我创build了两个虚拟主机blog.com和mysite.com 。 但我的问题是,他们都不工作。 每次我在浏览器中input它们什么都不会发生。 我已经尝试了几个解决scheme在堆栈溢出或谷歌。 没有帮助。 有什么build议? 我做了什么: 首先:除了站点的默认目录外,我还设置了另外两个目录,并更改了默认目录。 1)为blog.com:/var/www/blog.com/html 2)为mysite.com:/var/www/mysite.com/html 3)将默认值: / var / www / html更改为/ var / www / default / html 第二:然后我在每个html文件夹中创build一个index.html文件 第三:我在/etc/apache2/sites-available目录下创build了两个进一步的.conf文件,并将default.conf DocumentRoot blog.com.conf <VirtualHost *:80> ServerName blog.com ServerAlias www.blog.com ServerAdmin [email protected] DocumentRoot /var/www/blog.com/html/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> mysite.com.conf <VirtualHost *:80> ServerName mysite.com ServerAlias www.mysite.com […]

从两台服务器提供http数据

我有一个NAT路由器/防火墙后面的Ubuntu服务器。 我想添加另一台服务器,通过http(s)从两台服务器提供内容。 据我所知,我可以从另一个IP的“主”服务器请求数据取决于哪个虚拟主机被调用。 但是,我需要了解如何完成,需要哪种设置。 数据是通过“主”服务器路由还是直接从服务器2提供的数据? 在服务器之间是否需要进行其他共享,如访问这些文件?