目前我有几个虚拟主机为个别子域设置。 如果我能告诉Apache使用通配符自动查找文件夹,那将会容易得多。 例如, hello.domain.com将使用/var/www/hello目录作为其DocumentRoot 。 然而,我希望能够定义exception,例如,如果我想让helloworld.domain.com指向/var/www/helloworld/public 。 我环顾四周,但所有的例子似乎在做一些不同的事情。
我正在尝试为domain.comconfigurationDNS服务器。 我想要configuration通配符DNSlogging来将any-subdomain.domain.comparsing为一个IP地址(172.16.1.3)。 在我的DNS服务器中,我在转发区域中有以下logging: 这有点作用,除了当我运行nslookup www.domain.com我得到这个回应: Server: winsrv.domain.com Address: 172.16.1.2 Name: www.domain.com.domain.com Address: 172.16.1.3 我相信DNS服务器认为整个www.domain.comstring是domain.com一个子domain.com 。 如何让DNS服务器返回正确的行: Name: www.domain.com
我在使用Lighttpd的Ubuntu服务器上设置了一些域。 我有通配符域,我希望未使用的子域返回404而不是200,并显示常规域。 这个问题引起了我的注意,因为一些不太经验的search引擎(Bing,百度,mail.ru)索引我的网站与奇怪的子域名。 我在这里发现了同样的问题: apache2上的通配符DNS,VirtualHosts,未使用的子域404 但是我还没有find任何Lighttpd。 我希望www.example.com/*能够301redirect到example.com/* (已经设置) 我希望allUnsetSubdomains.example.com/*返回404以便search引擎和人们了解它不存在。 以下是我的vhost.conf文件中的相关数据: $HTTP["host"] =~ "^www\.(.*)$" { url.redirect = ( "^/(.*)" => "http://%1/$1" ) } # lots of other domains # $HTTP["host"] =~ "example.com$" { server.document-root = "/var/www/example.com" server.errorlog = "/var/log/lighttpd/example.com-error.log" accesslog.filename = "/var/log/lighttpd/example.com-access.log" server.error-handler-404 = "/index.php" } # lots more domains # 理想情况下,我希望能够有一个通用的规则,即服务器上所有域的所有未使用的子域返回404 ,就像wwwredirect一样。 我真的不明白Lighttpdconfiguration文件或正则expression式很好。
我有一个主站点和几个虚拟主机的域名。 我希望所有网站(主要和虚拟主机)只能通过HTTPS(使用HSTS)访问,我希望不存在的子域被redirect到主站点。 总结一下我想要的: https:/example.com:无redirect(主站点) http:/example.com:redirect到https:/example.com https:/vhost.example.com:无redirect(虚拟主机) http:/vhost.example.com:redirect到https:/vhost.example.com https:/doesntexist.example.com:redirect到https:/example.com http:/doesntexist.example.com:redirect到https:/example.com 我非常接近这一点,但倒数第二次redirect不起作用。 我正在使用来自Let's Encrypt的证书,此证书目前不提供通配证书,因此证书仅对主域和虚拟主机(我在创build证书时明确列出)有效。 由于证书无效,浏览器会阻止连接。 如何避免这个问题,最好的办法是什么? 这是我的(简化)nginxconfiguration,如果有帮助: server { listen 80; server_name _; return 301 https://example.com$request_uri; } server { listen 443 spdy; server_name _; # SSL settings snipped for brevity. SPDY and HSTS are enabled. return 301 https://example.com$request_uri; } server { listen 443 spdy; server_name example.com; root […]
可能重复: Apache虚拟主机从子域redirect到子目录 如果不访问cpanel,apache conf文件,只能访问.htacess和FTP,我怎样才能创build一个托pipe站点,当用户试图访问例如sub.domain.com时,它会自动redirect到domain.com/sub。 原因是消除必须手工创build子域名。 这可能吗?
因为我们在特定的子域( vendor1 .domain.org , vendor2 .domain.org …)下有供应商的外部托pipe应用程序, 所以我们希望为这些子域保留单个证书,同时在我们的所有内部托pipe应用程序环境由相同的* .domain.org域名下的通配符证书pipe理,但位于不同的服务器上( internal1 .domain.org, internal2 .domain.org …)。 通配符证书是否有可能与已经存在的其他子域单证相冲突?
在通常的SSL证书上使用通配符SSL证书有什么内在的不安全感吗? 我们正在寻求实现一个subdomained的web应用程序(la FreshBooks和BaseCamp,用户select一个子域),我们的一个团队成员担心通配符SSL方法不够安全(如果是的话,FreshBooks和BaseCamp如何做它?!?)。 替代解决scheme是使用一个单一的子域名,如https://ssl.domain.com ,当用户inputhttp://user.domain.com我们在会话中设置子域名,并立即redirect用户的未来请求到“ https://ssl.domain.com ”,并使用会话信息来显示用户的信息。 我担心的是,如果用户想将链接发送到他们的域名的朋友,他们将复制/粘贴到浏览器(现在https://ssl.domain.com ),这将是我们的主要网页,而不是用户的主页。 顺便说一句,如果我错过了这种情况下的主要最佳做法,请让我知道。
我试图完成三件事情: 按子域将stream量映射到不同端口上的多个应用程序之一。 如果子域没有被识别,redirect到www。 要求在所有子域上使用HTTPS。 我的nginxconfiguration到目前为止是: map $subdomain $subdomain_port { default 8000; www 8000; subdomain1 8001; subdomain2 8002; subdomain3 8003; } server { listen 80; listen [::]:80; server_name _; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name ~^(?P<subdomain>.+?)\.mydomain\.com$; ssl_certificate <cert>; ssl_certificate_key <key>; location / { # … various proxy headers, then … proxy_pass http://127.0.0.1:$subdomain_port; […]
我目前已经configurationApache2来托pipeforms为* .domains.tld的通配子域名,其中*对于每个客户端都是唯一的。 每个客户端都有一个“admin”页面,他们可以login到client.domain.tld / admin目录,我们想从admin.client.domain.tld中移动到该页面。 是否可以将子域服务到通配子域? 我似乎无法find与此相关的任何内容。 谢谢!
设置一个开发LAMP服务器,我希望允许dynamic子域名,又名ted.servername.com,bob.servername.com。 这是我的网站活动文件 <VirtualHost *:80> # Admin Email, Server Name, Aliases ServerAdmin [email protected] ServerName happyslice.net ServerAlias *.happyslice.net # Index file and Document Root DirectoryIndex index.html DocumentRoot /home/sysadmin/public_html/happyslice.net/public # Custom Log file locations LogLevel warn ErrorLog /home/sysadmin/public_html/happyslice.net/log/error.log CustomLog /home/sysadmin/public_html/happyslice.net/log/access.log combined 这里是sudo apache2ctl -S的输出 VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server happyslice.net […]