在我的错误日志中,我看到: server reached MaxClients setting, consider raising the MaxClients setting 我的MaxClients设置是150.但是,当我计算什么似乎是一个最佳的MaxClients设置我想出: Mem used by 1 Apache process = 16 Mem available to Apache = 197 MaxClients = 12 (197/16) 所以,我应该敲MaxClients的方式下降到12,因为我的计算表明,是所有的RAM我可用,或者我应该提高限制的错误日志暗示(或者我的计算是毫无价值的,因为我误解的东西)?
我们目前在IT部门设立了一个内部网站it.example.com ,它托pipe着一个Redmine网站。 我想设置Apache,以便如果用户转到kb.example.com它将它们redirect到http://it.example.com/some/path/to/knowledge-base作为快捷方式。 我在httpd.conf末尾添加了一个<VirtualHost> ,现在每当我尝试点击主站点(it.example.com)时,浏览器都会进入无限redirect循环: http://it.example.com/projects/knowledge-baseprojects/knowledge-baseprojects/knowledge-baseprojects/knowledge-baseprojects/knowledge-baseprojects/knowledge-baseprojects/knowledge-baseprojects/knowledge-baseprojects/knowledge-baseprojects/knowledge- baseprojects /知识baseprojects /知识baseprojects /知识baseprojects /知识baseprojects /知识baseprojects /知识baseprojects /知识baseprojects /知识baseprojects /知识baseprojects /知识库 这是我的httpd.conf : LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.37 PassengerDefaultRuby /usr/bin/ruby </IfModule> ServerName it.example.com ServerAdmin [email protected] DocumentRoot /var/www/redmine-2.4.3/public ErrorLog logs/redmine_error_log SetEnv RAILS_ENV production SetEnv RailsEnv production #If you are using mod_fcgid and are going to upload files larger […]
我不知道是什么导致了这个问题,但它似乎与显示的文件(只是一个简单的index.php打印phpinfo)在一个别名目录有关。 任何build议,我可以做些什么来避免这个警告? 这里是我的httpd.conf的摘录: <Directory "<dir with broken php>"> Options Indexes FollowSymLinks ExecCGI Includes AllowOverride All Order allow,deny Allow from all </Directory> Alias /smartersoftware/ "<broken dir>" <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch> 最后三行是需要使PHP的工作(我发现有点奇怪,它可能会或可能不会涉及到我的问题)。 添加一个AddType application/x-mapp-php5 .php并没有改变任何东西。
我已经search了整个文件的地方放置指令,但我不知道该把它放在哪里,互联网似乎也没有很好的答案,或者我只是不善于寻找它呵呵。 有人知道这个指令在哪里?
httpd.conf中的${var}和%{var}什么区别? 如何以及何时使用${}和%{} ? http://httpd.apache.org/docs/2.4/configuring.html提及: 可以使用$ {VAR}语法在configuration文件行中使用Define of或shell环境variables定义的variables值。 http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html提及: 服务器variables:这些variables的forms为%{NAME_OF_VARIABLE} 和 RewriteMap扩展:这是$ {mapname:key | default}的扩展。 除了在mod_rewrite指令(像RewriteCond,RewriteRule, RewriteRule ^ / ex /(.*)$ {examplemap:$ 1} )中使用${} RewriteMap扩展外, $ {VAR} 使用SetEnvIf指令在httpd.conf中设置的variables是否将用作${var}除非variables与mod_rewrite指令一起使用,variables将用作%{var} ?
为什么?? <VirtualHost *:80> ServerAdmin [email protected] DirectoryIndex index.php <If "%{SERVER_PROTOCOL} != 'HTTPS'"> Redirect / https://www.mydomain.com:443/ </If> ….. </VirtualHost> 保存,然后重新启动: sudo /etc/init.d/apache2 restart Syntax error on line 4 of /etc/apache2/sites-enabled/000-default: Invalid command '<If', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. The Apache error log may have more information. […]
我在我的httpd.conf文件中有以下内容: <Directory "/www"> Options Indexes FollowSymLinks AllowOverride AuthConfig FileInfo Options=Indexes,Limit Order allow,deny Allow from all </Directory> 接下来,我有一个目录ChatLogs位于服务器根目录下,一个.htaccess文件定义如下: Allow from all AuthName "Restricted Area" AuthType Basic AuthUserFile /www/.htpasswd AuthGroupFile /dev/null Require valid-user 当我尝试访问该目录时,服务器日志中出现以下500服务器错误( 10.109.1.92是我的Intranet IP): [alert] [client 10.109.1.92] /www/ChatLogs/.htaccess: allow not allowed here 我明白,这是因为在.htaccess文件中的以下声明: Allow from all 但有人可以解释为什么不允许Allow指令 ? 我稍后想要限制对某些IP地址范围的访问; 如果可以放在单独的目录中,而不是在httpd.conf文件中设置它们,则会更喜欢。
我想用“智能HTTP”的方法来设置一个Git服务器。 但是,我在使用Windows时遇到了困难,而且我是Apache的新手。 我的httpd.conf部分是: SetEnv GIT_PROJECT_ROOT "d:/repositories" SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /git/ "C:/Program Files/Git/libexec/git-core/git-http-backend.exe" <VirtualHost 172.16.0.5:80> <LocationMatch "^/git/.*/git-receive-pack$"> AuthType Basic AuthName "Git Access" Require group committers </LocationMatch> </VirtualHost> 有人可以提供在Windows上使用git-http-backend来设置Git服务器的步骤吗?
我在运行Apache Httpd的服务器上托pipe了一些网站。 每个网站都有自己的域或子域和虚拟主机。 所以我不需要默认的文档根目录。 可以在/etc/httpd/conf/httpd.conf禁用DocumentRoot吗?
我有2个LAMP Web服务器,通常用掉交换空间(请参阅附上的截图)。 Apache的设置如下: <IfModule prefork.c> StartServers 64 MinSpareServers 64 MaxSpareServers 128 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4096 </ IfModule>configuration PHP的资源限制是: max_execution_time = 30 max_input_time = 30 memory_limit = 80M 我是新来的服务器pipe理员这样的东西(我是一个开发人员); 我可以调整什么以防止交换? 以下是其中一台服务器崩溃时的屏幕截图: