我之前已经解决了这个问题,但现在我不得不清除我的VPS,显然我不能正确地configuration东西了,所以.. 我已经build立了一个Debian VPS并在其上安装了Virtualmin,我买了一个testing域用于该VPS,并将其主DNS服务器指向我的VPS IP。我用Virtualmin为根域创build了一个虚拟服务器。 org,但是每当我打开URL,我会得到默认的虚拟主机页面,我继续删除默认的VH(不是实际的默认,只有一个Virtualmin创build),我仍然指向/ var / www而不是/ home /例如/ public_html忽略这个,我试图创build一个子域,希望至less这个会指出正确的directoy,但没有任何工作(我创build了*。example.org CNAME DNS以及所有指向example.org,那是对的吗?) 这是Virtualmin创build的VH文件: <VirtualHost 127.0.0.2:80> SuexecUserGroup "#1001" "#1001" ServerName example.org ServerAlias www.example.org ServerAlias webmail.example.org ServerAlias admin.example.org DocumentRoot /home/example/public_html ErrorLog /var/log/virtualmin/example.org_error_log CustomLog /var/log/virtualmin/example.org_access_log combined ScriptAlias /cgi-bin/ /home/example/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory /home/example/public_html> Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI allow from all AllowOverride All […]
当我使用下面的代码: <VirtualHost *> ServerName subone.domain.tld DocumentRoot / var / www / subdomain / subone / </虚拟主机> <VirtualHost *> ServerName subtwo.domain.tld DocumentRoot / var / www / subdomain / subtwo / </虚拟主机> 每个查询都转到/ var / www / subdomain / subone。 包括:domain.tld,subone.domain.tld,subtwo.domain.tld,… 当我添加一个“NameVirtualHost *”到文件的开头时,一切都进入/ var / www 我究竟做错了什么?
我们有我们的生产服务器上运行的那个好的/真棒的Fogbugz工具。 问题是这个服务器处理超过400个域名和超过20个真实的网站。 日志已经很重了,因为我们已经安装了Fogbugz,所以每隔15秒就会有一个非常好的进程叫做心跳。 现在想象我们的日志的大小…污染了吨像线: GET /fogbugz/heartbeat.asp HTTP / 1.1“302 223” – “”FogBugz维护服务7.1“ (见http://fogbugz.stackexchange.com/questions/794/what-does-the-fogbugz-maintenance-service-actually-do ) 我们正在运行最新的Apache httpd服务器版本。 有什么办法可以忽略这个特定的请求,而不是logging它? mod_log_config可能是一个选项,但我没有find一个好的答案。
我正在使用一个长的CIDR黑名单来阻止来自某个站点的多个国家,但是我需要允许阻塞的CIDR范围内的特定IP地址。 这里是我的conf文件的一个摘录(这是我目前正在尝试的顺序,尽pipe我已经尝试在“拒绝”行之上移动“允许”行): order allow,deny deny from 27.116.56.0/22 deny from 58.147.128.0/19 deny from 61.5.192.0/20 deny from 83.140.0.0/16 # … allow from 83.140.19.38 黑名单工作正常,但是,“允许”的行不是我是否把它们放在“拒绝”部分之上或之下。 有没有其他的configuration,我需要得到这个工作? Apache文档让我相信“允许”应该在“否认”之后出现,但似乎并没有直接回答这个问题。
我有一个现有的httpd.conf文件,我应该去运行Ubuntu的Vagrant实例,我正在使用Puppet来提供。 我遇到的问题是模块名称。 httpd.conf指定了一堆模块,如下所示: LoadModule access_compat_module modules/mod_access_compat.so LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule allowmethods_module modules/mod_allowmethods.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so 为了设置所有这些模块,我需要告诉我正在使用的Puppet Apache模块(通过Example42 )我想要安装和启用的模块名称。 问题是模块名称与httpd.conf行不是 1:1匹配。 换句话说,模块名称不能总是从文件中推断出来。 例如,这里是我,试图启用文件的第一行( mod_access_compat.so ): vagrant@lucid64:~$ sudo a2enmod access_compat ERROR: Module access_compat does not exist! vagrant@lucid64:~$ sudo a2enmod access_compat_module ERROR: Module access_compat_module does not exist! vagrant@lucid64:~$ sudo a2enmod accesscompat ERROR: […]
进入原来的httpd.conf,我有 Options Indexes FollowSymLinks 我在/etc/httpd/conf.d/中创build了一个configuration文件 NameVirtualHost 192.168.0.2:8009 <VirtualHost 192.168.0.2:8009> DocumentRoot /var/www/html/deve ServerName "deve:8009" ErrorLog /var/www/deve_errorlog CustomLog /var/www/deve_customlog common Options -ExecCGI -Indexes </VirtualHost> 我重新启动服务器,我仍然可以看到文件 http://192.168.0.2:8009/images 我认为更具体的规则覆盖了一般的规则 我在哪里错过了什么?
我拥有的: 我有一个iPhone应用程序发送HTTP POST请求(XML格式)到用PHP编写的Web服务。 这是在托pipe的虚拟专用服务器上,所以我可以编辑服务器上的httpd.conf和其他文件,并重新启动Apache。 问题: 只要请求不太大,Web服务就能正常工作,但是大约1MB是极限。 之后,服务器回应: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>413 Request Entity Too Large</title> </head><body> <h1>Request Entity Too Large</h1> The requested resource<br />/<br /> does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. </body></html> Web服务写入自己的日志文件,我可以看到小消息处理正常。 更大的消息根本就没有logging,所以我想在Apache到达Web服务之前,Apache会拒绝它们? 我试过的东西没有成功: (每次更改后我都重新启动Apache,这些步骤是增量式的。) […]
摘自httpd.conf <VirtualHost *:80>部分(目标:为所有 JavaScript文件设置Cache-Control ): <LocationMatch "\.js"> Header set Cache-Control "max-age=290304000, public" </LocationMatch> .htaccess (Symfony PHP框架的一部分): Options +FollowSymLinks +ExecCGI <IfModule mod_rewrite.c> RewriteEngine On # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule […]
我有一个服务器与tomcat进程绑定到端口80和httpd进程绑定到端口5000.由于某种原因,每一个进程发送一个SIGHUP信号到httpd进程我的tomcat进程消失没有任何错误或任何东西。 我通过以下方法解决了服务器上的问题,在httpd.conf中添加了一个显式的ServerName指令,并解决了问题。 我还是不明白为什么SIGHUP把httpd杀死了tomcat进程。 注1:我使用以下命令复制了kill信号: 找出httpd pid是什么。 cat /etc/httpd/run/httpd.pid 4056 然后用一个叹息信号杀死 kill -s SIGHUP 4056 注2:我们解决了这个问题,发现每天早晨凌晨4点运行的logrotate发送一个SIGHUP信号来释放日志,以便能够旋转它们,从而杀死tomcat。
这是我之前在这个网站上的问题的一个后续问题。 也许我应该指出,Apache服务器运行在Windows系统上,不知道是否重要。 我的问题如下: 我有2个驱动器J:和K :,都有一个目录testing( J:/ test /和K:/ test / ) J:/ test /包含文件pink.html K:/ test /包含文件red.html和blue.html 我想访问J:/ test /和K:/ test /中的所有文件,并使用相同的url: HTTP://localhost/test/pink.html HTTP://localhost/test/blue.html HTTP://localhost/test/red.html 这是我的httpd.conf文件的摘录: Alias /test/ "J:/test/" Alias /test2/ "K:/test/" <Directory "J:/test/"> Order allow,deny Allow from all Options All MultiViews AllowOverride None RewriteEngine on RewriteCond /test/%(REQUEST_FILENAME) !-f #if we can't find the file […]