我一直有一些问题,build立我的Apache Web服务器,只通过HTTPS提供页面。 我想这个星期早些时候我已经钉了它,但经过一番修改之后,似乎我又把它弄坏了,我不知道我到底什么时候把它弄坏了。 我的设置产生这个输出,因此我的configuration语法应该是可以的: # apache2ctl -t -D DUMP_VHOSTS VirtualHost configuration: 192.168.0.1:80 is a NameVirtualHost default server cal.example.com (/etc/apache2/sites-enabled/99-davical:2) port 80 namevhost cal.example.com (/etc/apache2/sites-enabled/99-davical:2) port 80 namevhost proius.example.com (/etc/apache2/sites-enabled/proius:1) port 80 namevhost slnew.example.com (/etc/apache2/sites-enabled/slnew:1) port 80 namevhost webmail.example.com (/etc/apache2/sites-enabled/webmail:1) 192.168.0.1:443 is a NameVirtualHost default server proius.example.com (/etc/apache2/sites-enabled/proius:10) port 443 namevhost proius.example.com (/etc/apache2/sites-enabled/proius:10) port 443 namevhost […]
在我的networking应用程序中,我玩弄给我的用户select他们select的子域的机会,所以他们可以select像这样的东西: foobar.myapp.com foobar是他们select的子域名。 什么是正确的方式去build立这样的事情? 的.htaccess? 有一些API写虚拟主机? 该应用程序仍然会映射到我的服务器上的一个目录,我只想给主题一个自定义的URL。
我有一个允许ssl和非ssl浏览的网站。 我在Apache中设置了两个虚拟主机来处理这两种情况,即: <VirtualHost *:80> … </VirtualHost> 和 <IfModule mod_ssl.c> <VirtualHost *:443> … </VirtualHost> </IfModule> 现在,我的烦恼是这两个虚拟主机(相当大的)configuration是重复的(唯一的区别是在ssl-vhost中添加了SSL参数),所以当我想改变某些东西时,我需要在两者中都这样做。 它也感觉和看起来马虎。 有什么办法可以合并这两个configuration? 非常感谢。
我有这些重写规则(我尝试都没有用): location ~* "^/([a-z0-9]{32})\.png$" { rewrite ^ /index.php?page=log&id=$1 last; } 和 location ~* "/(?<hash>[a-z0-9]{32})\.png" { rewrite ^ /index.php?page=log&id=$hash; } 和 location / { try_files $uri $uri/ @rewrites; } location @rewrites { rewrite "^/([a-zA-Z0-9]{32})\.png$" /index.php?page=log&id=$1 last; #… } 基本上,我希望URL http://example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.png实际上将parameter passing给我的index.php脚本,并在脚本中得到: $db->save_hash($_GET['id']); header('Content-type: image/png'); readfile('images/beacon.png'); break; 但是nginx给了我一个“未find”,但其他重写工作正常。 是什么赋予了?
是的,但是,根据ngnx文档“ configurationHTTPS服务器 ”(“单个HTTPS服务器”部分), 这个问题与此问题是重复的,这个限制已经不复存在,对这个问题的答案不再有效。 从上面的链接: 在0.7.14之前,不能有select地启用SSL,如上所示。 SSL只能在使用ssl指令的整个服务器上启用,因此无法设置单个HTTP / HTTPS服务器。 listen指令的ssl参数被添加来解决这个问题。 在现代版本中使用ssl指令是不鼓励的。 但是,在该文档中规定的服务器块设置: server { listen *:80; listen 443 ssl; server_name example.com *.example.com; […] …当对https://example.net发出请求时,nginx仍然会从example.com提供内容。 我知道SSL是在HTTP请求之前提供的,但是必须有某种方法来阻止服务器响应没有与其关联的有效SSL证书的SSL请求。 任何有关这方面的见解,非常感谢。
我宁愿没有 ServerAdmin 在我的VirtualHost,因为它只是吸引垃圾邮件。 没有用过的东西。 可以忽略吗?
我有一个ProxyPassconfiguration为达到以下目的:在我的服务器上,我启动一个服务,提供restAPI监听端口7777.从客户端,我希望能够调用这个API是这样的: http://example.org/servicename/PARAMETER 对这个API的完整调用应该如下所示:HTTP PUT @ http://example.org/servicename/PARAMETER (其中PARAMETER是一些string)。 内部这应该转化为以下url: http://server.ip:7777/servicename/PARAMETER 一切都按预期工作,只要PARAMETER不是(!)像这样: http://parameter.org : http%3A%2F%2Fparameter.org (实际上我需要URL编码: http%3A%2F%2Fparameter.org )。 总之,这个电话是http://example.org/servicename/http%3A%2F%2Fparameter.org 参数中的http://混淆了apache,导致在对该调用的回复中出现以下错误消息: !DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /servicename/http://parameter.org was not found on this server.</p> <hr> <address>Apache/2.2.22 (Debian) Server at example.org Port 80</address> </body></html> 如果我用例如testreplacehttp%3A%2F%2Fparameter.org ,那么一切正常。 不知何故http://在参数混淆了Apache。 有没有办法让Apache忽略它? 我这个虚拟主机的当前configuration如下所示: […]
我想监视每个nginx虚拟主机(我有不同的域的多个nginxconfiguration),并发现nginx模块ngx_http_stub_status_module 但似乎这个模块是为了显示服务器的全局状态不是每个虚拟主机。 有什么解决scheme来收集虚拟主机统计信息?
我注意到两台Mac上的Apache虚拟主机存在一些问题,这些问题与其他方式(httpd.conf,vhosts,hosts等)有相同的设置。在一台Mac上,虚拟主机在没有故障的情况下在另一台Mac上运行,我在端口80上连接被拒绝。 这似乎不是与Apacheconfiguration的问题,我认为,但与端口有关。 也就是说,无法为80上的虚拟主机test.dev服务的计算机在端口扫描上显示了这一点: Сканированиепортоввыполняется… Port Scanning host: 127.0.0.1 Open TCP Port: 88 kerberos Open TCP Port: 445 microsoft-ds Open TCP Port: 548 afpovertcp Open TCP Port: 631 ipp Сканирование портов завершено… 服务test.dev的机器显示这个: Port Scanning host: 127.0.0.1 Open TCP Port: 22 ssh Open TCP Port: 53 domain Open TCP Port: 80 http Open TCP Port: 88 […]
我有一台服务器configuration为使用Apach 2.4dynamicconfiguration虚拟主机。 我为某些域configuration了SSL,但我被要求使用Let's Encrypt免费服务为所有域提供SSL。 Certbot有点不清楚,因为我不确定它是否适用于dynamic虚拟主机。 我的挑战是我有一个子域subXXX.masterdomain.com和别名yourchoicedomain.com可用的每个域,所以我需要生成获取证书表单让我们encryption是有效的 subXXX.masterdomain.com www.subXXX.masterdomain.com yourchoicedomain.com www.yourchoicedomain.com 我没有一个非常复杂的vhostsconfiguration文件,我使用符号链接来实现域别名和www服务器别名。 <VirtualHost *:80> #ServerName masterdomain.me #ServerAlias * # get the server name from the Host: header UseCanonicalName Off # include the server name in the filenames used to satisfy requests VirtualDocumentRoot "/var/www/vhosts/%0/httpdocs" RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTPS} off RewriteRule .* http://www.%{HTTP_HOST}$0 [R=301,L] […]