Articles of 虚拟主机

带有空域和通配符的nginx SSL

这是一个令人讨厌的问题,我希望有人能帮助我。 首先,我运行自己的CA,所以我正在做自签名的证书; 我可以用openssl来做任何我需要的东西。 我有一个域,example.com和一个运行nginx的networking服务器,我试图设置一个这样的情况,我redirect: http://example.com -> http://www.example.com 和 httpS://example.com -> httpS://www.example.com 我的问题不在于让nginx做我需要的东西; 它可以重写或redirect。 目前,我有一个简单的(如果是邪恶的,我知道! 我的问题是SSL证书。 如果我为“example.com”生成一个正常的单域证书,则会在“www.example.com”中收到证书错误。 好的,我会为“* .example.com”制作一个通配符! 除了现在我得到一个裸露的域名证书错误。 这对我来说是有道理的,但是如果可能的话,我仍然想把它们合并成一个证书,一个nginx服务器块。 所以我尝试制作一个名为“DNS:example.com,DNS:*。example.com”的subjectAltName的CSR。 但是,这似乎也没有工作:裸露的域名作品和redirect,但后来一刷新,我得到一个奇怪的证书错误,说“证书只对example.com有效”,而在检查CN是“* .example.com”。 任何人都可以提供一些build议,如何解决这个问题,并尽可能简单地创build这套redirect? 是的,我知道我可以完全忽略https://example.com ,只能在www.example.com上听SSL,但我的完美主义者却不允许; 我希望本网站的所有内容对SSL都是完全不可知的,并且使用完全相同的方式,即使是最初的redirect也是如此。 编辑:nginxconfiguration: server { listen 80; listen [::]:80; listen 443 ssl; listen [::]:443 ssl; root /var/www/example.com; index index.html index.htm; server_name www.example.com example.com; ssl_certificate /etc/ssl/sites/example.com.crt; ssl_certificate_key /etc/ssl/sites/example.com.key; ssl_session_timeout 5m; ssl_protocols […]

为什么这个VirtualDocumentRoot安装程序返回403 Access Forbidden?

我有安装我的httpd-vhosts.conf与以下的derectives: UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog logs/access_log vcommon <VirtualHost 192.168.1.100:80> VirtualDocumentRoot "E:/Web Development Projects/%3/%2.1/%2+" DirectoryIndex index.php index.html index.htm default.html default.htm home.html default.php home.php </VirtualHost> <VirtualHost 192.168.1.100:443> SSLEngine On SSLCertificateFile "E:/Web Development Projects/SSL/apache.crt" SSLCertificateKeyFile "E:/Web Development Projects/SSL/apache.key" VirtualDocumentRoot "E:/Web Development Projects/%3/%2.1/%2+" DirectoryIndex index.php index.html index.htm default.html default.htm home.html […]

Forbidden(403),访问apache 2.2.22上的服务器状态

尝试访问www.website.com/server-status时出现Forbidden错误 mod_status已启用 虚拟主机: <VirtualHost *:8080> ServerName website.com ServerAlias www.website.com DocumentRoot /var/www/wordpress/ DirectoryIndex index.php <Directory /var/www/wordpress/> AllowOverride All Order Deny,Allow Allow from all Options +Indexes </Directory> <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from .website.com </Location> ErrorLog /var/www/wordpress/logs/error.log CustomLog /var/www/wordpress/logs/access.log combined </VirtualHost> 我试图将允许从.website.com更改为网站IP,并发生同样的问题。 当我尝试将其更改为允许从所有我得到一个404。 我做的另一个尝试是设置允许从127.0.0.1和通过lynx从服务器内访问,几乎相同的问题。 这是error.log中收到的错误: [error] [client 127.0.0.1] client denied by server […]

VirtualHosts上的Apache RewriteRule不适用于组捕获正则expression式

我需要创build一个RewriteRule来将像/tdg/image.jpg?mode=crop&width=300&height=300这样的URLpath/tdg/image.jpg?mode=crop&width=300&height=300给本地代理。 代理需要将给定的URL转换为以下格式。 http://localhost:8888/unsafe/300×300/smart/tdg/image.jpg 我先尝试使用ProxyPassMatch apache指令,但是我无法从查询string中检索宽度和高度数据。 ProxyRequests On ProxyPreserveHost On ProxyPassMatch ^\/(tdg.+\.(?:png|jpeg|jpg|gif))\?mode=crop.+width=(d+)&height=(d+) http://localhost:8888/unsafe/$2x$3/smart/$1 我也试过RewriteRule RewriteEngine On RewriteRule ^\/(tdg.+\.(?:png|jpeg|jpg|gif))\?mode=crop.+width=(d+)&height=(d+) http://localhost:8888/unsafe/$2x$3/smart/$1 在这两种情况下,代理的结果URL都是http://localhost:8888/unsafe/x/smart/$1 ,其中应该是http://localhost:8888/unsafe/300×300/smart/tdg/image.jpg 我不知道为什么我不能使用group正则expression式从查询string中获取width和height值。

基于Apache名称的虚拟主机是一个昂贵的过程?

我们正在决定是否将我们的一台服务器严格保留为一个站点或多个站点的使用情况(基于名称的虚拟主机设置)。 从同一台服务器上运行多个站点是否有昂贵的处理成本?

有许多SSL子域 – 最佳实践?

我有一个网站有许多子域(每个客户端一个)。 每个子域的内容会不一样,拉不同的数据,不同的布局等,所以我不认为我可以将一个目录别名到许多不同的子域。 我的问题是,这样做的最佳做法是什么? 每个子域都需要SSL。 我的设置是 Amazon EC2(ubuntu) 通配符SSL为我的域(* .mydomain.com) Apache 2 PHP(LAMP) 目前,我只是创build一个新的入口“/ etc / hosts”和一个适当的位置在web根目录(即/var/www/abc.mydomain.com,/var/www/def.mydomain.com等)。 我刚刚发现,我需要为每个子域设置一个唯一的IP地址,而EC2则非常棘手,因为它们限制了您可以使用的数量(除非您跳过一些圈)。 现在我有大约10个子域,这是可pipe理的,但理论上我可以有数千个。 我是唯一可行的方法,还是有更好的方法可以调查?

我可以分配一个子域到一个IP地址吗?

我目前正在从一台服务器转移到另一台服务器的过程中。 而我目前正在build立我的apache2。 但是在旧的服务器上,我使用了几个子域。 现在我想在新的服务器上testing这些子域名,但似乎帽子subdomain.xx.xx.xx.xx(subdomain.ip-address)似乎不工作。 这是不可能的,或者只是我得到configuration错误? 我的configuration NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/tld.com <Directory> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/tld.com> Options -Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all # This directive allows us to have apache2's default start page # in /apache2-default/, but still have / go to the right […]

域名无效 – 帮助VirtualHost

Gamer-Source.com没有正常显示,它显示的是Starcraft-Source.com,而不是它自己的网站。 任何人都可以指出下面的configuration的任何问题? cdn.gamer-source.com也没有显示出来。 / etc / hosts文件 127.0.0.1 localhost 127.0.1.1 spireprod 127.0.0.1 www.battle-report.com 127.0.0.1 www.gamer-source.com 127.0.0.1 cdn.gamer-source.com 127.0.0.1 www.seccbiblebowl.org //this domain works 100% 127.0.0.1 www.diablo-source.com 127.0.0.1 www.starcraft-source.com //this works as well /etc/apache2/sites-available/gamer-source.com <VirtualHost 64.253.105.250:80> ServerAdmin [email protected] DocumentRoot /home/source/public_html/ ServerName www.gamer-source.com ServerAlias gamer-source.com ErrorLog /home/source/log/error_log TransferLog /home/source/log/access_log </VirtualHost> <VirtualHost 64.253.105.250:80> ServerName cdn.gamer-source.com DocumentRoot /home/source/public_html/cdn/ </VirtualHost> <VirtualHost […]

Apache2虚拟主机SSLconfiguration

我有一个VirtualHost指令(虚拟主机xxxx:80 xxxx:443),监听端口80和端口443上的连接,我怎样才能在该指令内的端口443上启用SSL?

尝试访问webroot时发生403错误

我正在搞虚拟主机,现在当试图访问webroot上的文件时,我得到了一个403错误。 这是我的httpd-vhosts.conf: NameVirtualHost *:80 <VirtualHost *:80> ServerName localhost DocumentRoot /var/www </VirtualHost> <VirtualHost *:80> ServerName test.ts DocumentRoot /var/www/htdocs/vhost_test <Directory /var/www/htdocs/vhost_test> Options Indexes FollowSymLinks Includes AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> 我很确定它是一个虚拟主机的问题,因为我在httpd.conf中包含了httpd-vhosts.conf,并且问题没有了。 它出什么问题了? 编辑:Phil Hollenback帮我解决这个问题的一天后,服务器又开始动作了。 和以前一样的问题,做我之前做的事情,这次没有解决。 所以我试着用这个改变httpd-vhosts.conf: <VirtualHost *:80> ServerName localhost DocumentRoot /var/www <Directory /> #added this tag Allow from all <Directory> </VirtualHost> 现在它正在工作。