www.example.com。 1800 IN CNAME example.com。 other.example.com。 1800 IN CNAME example.com。 当所有条目指向完全相同的DocumentRoot时,哪个方法在Apache中是正确的? 下面的方法可以工作吗? <VirtualHost *:80> DocumentRoot "/some/place/" ServerName example.com </VirtualHost> 或者我将为每个CNAME创build一个VirtualHost条目? <VirtualHost *:80> DocumentRoot "/some/place/" ServerName example.com </VirtualHost> <VirtualHost *:80> DocumentRoot "/some/place/" ServerName www.example.com </VirtualHost> <VirtualHost *:80> DocumentRoot "/some/place/" ServerName other.example.com </VirtualHost>
我有以下虚拟主机文件: <IfModule !wsgi_module> LoadModule wsgi_module modules/mod_wsgi.so WSGISocketPrefix run/wsgi </IfModule> <VirtualHost *:80> RewriteEngine On RewriteLog "/var/log/httpd/rewrite_log" RewriteLogLevel 1 RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L] </VirtualHost> <VirtualHost *:443> ServerName https://tendril-api.dev.adnxs.net ServerAlias 06.tendril-api.dev.nym2.adnexus.net/api RewriteEngine on RewriteRule ^docs$ docs/ [R] … # SSL & WSGI Setup </VirtualHost> 出于某种原因,我的docs重写规则根本没有生效。 为什么是这样? 我的HTTP – > HTTPS重写规则在*:80 VirtualHost中正常工作。 我正在做一些非常相似的事情。 这是否与在不同的VirtualHosts中有两个不同的重写规则有关? 有任何想法吗?
是否可以强制设置所有图像的HTTP 304状态? 我写了下面的代码在我的虚拟主机,但现在,而不是404/304状态我得到500 <filesMatch "\.(ico|gif|jpg|png|jpeg)$"> Header set 304 "HTTP/1.0 304 Not Modified" </filesMatch> 我有“Apache / 2.2.16(Debian)”版本。 谢谢你的帮助
我有一个Mac Mini服务器(命名服务器)与以下DNS设置 Primary Zone: example.com mysql-host.example.com machine (10.0.0.101) server.example.com machine (10.0.0.100) server.example.com nameserver (10.0.0.100) www.example.com machine (10.0.0.102) www.example.com是一个Apache的Linux机器人。 我如何获得example.com和www.example.com的工作。 现在,我只能通过www.example.com查看我的网站。 我知道没有什么指向IP的example.com,但是当我创build一个没有主机名的机器logging时,我得到一个错误(这台机器logging不能没有主机名称创build)。
除了最后一个八位字节之外,IP隐藏在apache日志中用于隐私。 /结算是我们的应用程序开始页面。 但它发送POST请求并没有任何意义,并得到500响应。 或者,也许这是合法的旧IE 7浏览器谁不能处理我们的网站,ant设置成循环? 有大约20000个这样的请求 xx.xx.xx.223 – – [30/May/2014:13:40:54 +0200] "POST /billing HTTP/1.1" 500 613 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)" xx.xx.xx.223 – – [30/May/2014:13:40:54 +0200] "POST /billing HTTP/1.1" 500 613 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows […]
我有一个VPS,主机几个域名。 我以如下方式设置了Apache: 第一个VirtualHost /etc/apache2/sites-available/somedomain.com <VirtualHost somedomain.com:80> ServerName somedomain.com ServerAlias www.somedomain.com … </VirtualHost> 第二个VirtualHost /etc/apache2/sites-available/someotherdomain.com <VirtualHost someotherdomain.com:80> ServerName someotherdomain.com ServerAlias www.someotherdomain.com … </VirtualHost> 然后,我将来自sites-available的configuration文件sites-available用于sites-enabled并且一切正常。 我需要'closures' someotherdomain.com ,所以我删除了符号链接到/etc/apache2/sites-available/someotherdomain.com从sites-enabled和网站不再显示…但键入someotherdomain.com进入网页浏览器带来somedomain.com ! 我需要它根本不解决。 在虚拟主机中需要做些什么来自动返回一个500或者其他东西。 我真的不希望人们从一个不同的域名到达一个网站。 谢谢! 编辑 ports.conf看起来像这样 NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> NameVirtualHost *:443 Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
Apache 2.4.6 Ubuntu 13.10 我试图找出如何configuration上面的Apache使用通配符SSL证书。 到目前为止,我没有任何运气。 我要么得到错误,Apache将无法启动,或者我从浏览器中得到一个SSL错误。 自升级到2.4.6以来,我一直没有能够得到Apache启动,除非我删除SSLconfiguration指令。 /etc/apache2/sites-enabled/default-ssl.conf <VirtualHost _default_:443> DocumentRoot /var/www/wiki ErrorLog /var/log/apache2/wiki.ssl-error.log SSLEngine On SSLCertificateFile /etc/ssl/certs/40B75eaaadb70.crt SSLCertificateKeyFile /etc/ssl/private/xxx.com.key #SSLCACertificateFile /etc/ssl/certs/gd_bundle-g2-g1.crt </VirtualHost> <VirtualHost *:443> DocumentRoot /var/www/wiki ServerName wiki.xxx.com </VirtualHost> <VirtualHost *:443> DocumentRoot /var/www/assets/itdb ServerName assets.xxx.com </VirtualHost> <VirtualHost *:443> DocumentRoot /var/www/support19 ServerName support.xxx.com </VirtualHost>` /etc/apache2/ports.conf # If you just change the port or add […]
我创build了一个程序,使用Perl的CGI,我打电话给我在远程位置的服务器脚本。 为此我使用了OpenSSH。 但是,当我从我的terminal运行这个脚本它工作正常我的远程机器脚本也正常运行。 但是,当我从浏览器这样做是行不通的。 我已经使用下面的脚本。 #!/usr/bin/perl use warnings; use strict; use CGI; use Net::OpenSSH; use warnings; our $cgi = new CGI; use Net::OpenSSH; my %opts = ( user => "UNAME", #password => "MYPASSWORD", strict_mode => 0, ); my $ssh = Net::OpenSSH->new("MY SERVER_IP",%opts,master_opts => [-i => "MY KEY FILE"], async => 1); $ssh->system("/root/test.sh") or die "remote […]
我应该注意到,我不是一个系统pipe理员。 你会很快弄清楚。 🙂 简而言之, Apache在重负载下保持呼吸,所有进程都闲置。 这是应用程序使用的轮询服务器。 民意调查来自很多不同的端点。 如果我正在观看最高峰,每隔4-5分钟,HTTPD进程将全部闲置,同时停止stream量达10秒左右。 然后恢复。 延迟是有问题的。 服务器正在服务很多的stream量。 这些是通过HTTPS的应用程序民意调查,而不是网页(虽然我怀疑阿帕奇知道的区别) 上述暂停导致交通不平衡:经过一段时间后,我得到了一个整体的交通,然后一个平静,然后再一个交通的一揽子 每次调查都需要一个小的数据库 Apache日志 有时候 ,但并不总是(通常在重启之后),我在error_log中得到这些消息。 大多数情况下,我在error_log中什么也看不到。 [2014年6月30日星期一17:55:17] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产生8个孩子,有31个闲置,总共有98个孩子 [2014年6月30日星期一17:55:18] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产生16个孩子,有14个闲置,总共有98个孩子 [2014年6月30日星期一17:55:44] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产生8个孩子,有74个空闲,总共有99个孩子 [2014年6月30日星期一17:55:54] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产生8个孩子,有61个空闲,总共有99个孩子 [2014年6月30日星期一17:56:00] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产卵8个孩子,有0个空闲,总共有97个孩子 [2014年6月30日星期一17:56:02] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产生16个孩子,有36个空闲,总共有99个孩子 [2014年6月30日星期一17:56:03] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产生32个孩子,有39个空闲,总共有99个孩子 [2014年6月30日18:08:17] [info]服务器似乎很忙,(你可能需要增加StartServers或者Min / MaxSpareServers),产生8个孩子,有18个空闲,总共有99个孩子 [2014年6月30日星期一18:08:18] [信息]服务器似乎很忙,(你可能需要增加StartServers或Min / MaxSpareServers),产生16个孩子,有63个空闲,总共有98个孩子 [2014年6月30日18:08:19] […]
我不能在端口80远程访问我的服务器。首先,我没有设置它。 别人做了。 我不是系统pipe理员。 但是这两个部分(我和系统pipe理员)之间的沟通需要时间和截止date,所以我决定把事情交给我自己。 毕竟我有root权限。 在我看来有一个防火墙问题,但我该如何解决? 这是我从我身边得到的: chris@mint-desktop ~ $ nmap -Pn remote_server -p 80 Starting Nmap 6.00 ( http://nmap.org ) at 2014-07-01 16:28 EEST Nmap scan report for remote_server (remote_addr) Host is up. rDNS record for remote_addr: rDNS_record_for_remote_addr_seems_valid PORT STATE SERVICE 80/tcp filtered http Nmap done: 1 IP address (1 host up) scanned in […]