我有要求在服务器configuration中设置一个独特的Environment Variable 。 但是,用户不应该能够通过.htaccess文件更改variables。 我怎样才能防止这种行为而不破坏.htaccess其他function 主要要求是将一个唯一的SPECIAL_PATHvariables传递给cgi-module 有没有任何非官方的模块来控制这个。 问候。
我将Apache 2.2的服务器升级到了Apache 2.4 现在我无法访问 www.example.org/ 再 www.example.org/index.php 工作中。 我已经设定 DirectoryIndex index.php
我试图在所有通过Apache HTTPD的请求上设置一个请求头。 该值需要从附加到请求的cookie中获取。 从Apache文档,它看起来像mod_headers可能工作。 从这个页面上的例子,我把它放在一起: RequestHeader set MyHeaderName "expr=%{req:access_token}" 其中“access_token”是cookie值的名称。 这确定了标题,但价值是通过空,所以我不认为我有这个expression的权利。 有没有一个expression式可以用来获取cookie值?
我有几个http(端口80)的虚拟主机,我想redirect到http如果一个https请求是对他们。 显然有些事情已经改变了Apache 2.4(NameVirtualHost不像以前那样使用,等等)。 Apache 2.4上centos 5.5,这是所有使用单一的IP下面的所有虚拟主机,我没有这个盒子上的多个IP, 我的/usr/local/apache2/conf/extra/httpd-vhosts.conf: # <VirtualHost www.dom1.com:80> ServerName www.dom1.com ServerAlias dom1.com DocumentRoot /usr/local/apache2/htdocs/dom1/wordpress </VirtualHost> <VirtualHost webmail.dom2.com:443> ServerName webmail.dom2.com DocumentRoot /usr/local/apache2/htdocs/webmail SSLEngine On SSLCertificateFile /usr/local/apache2/webmail.crt SSLCertificateKeyFile /usr/local/apache2/webmail.key </VirtualHost> # 我的/usr/local/apache2/conf/extra/httpd-ssl.conf, # Listen 443 SSLPassPhraseDialog builtin SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) SSLSessionCacheTimeout 300 Mutex default SSLRandomSeed startup file:/dev/urandom 512 SSLRandomSeed connect builtin SSLCryptoDevice builtin # webmail.dom2.com工作正常。 问题是我可以连接到https://www.dom1.com […]
我试图利用Apache 2.4的<If>指令的能力来通过评估它的参数来定制一个<Macro> 。 我目前正在尝试执行以下操作: 如果authenticationMode ==“htpasswd”使用.htpasswd文件 如果authenticationMode ==“server”使用pwauth 否则打破Apache的configuration 以下代码( <Macro>标记内)不起作用 SetEnv ROOT_PATH /somewhere #Set outside macro <If "$authenticationMode == 'htpasswd'"> # Guilty line! AuthUserFile $ROOT_PATH/path/to/.htpasswd </If> <ElseIf "$authenticationMode == 'server'"> AuthBasicProvider external AuthExternal pwauth </ElseIf> <Else> DO_CRASH </Else> 错误消息是Cannot parse condition clause: syntax error, unexpected T_OP_STR_EQ, expecting '(' 怎么修?
我有一个项目读取$_SERVER['PATH_INFO']variables时加载页面,因此它读取格式为http://address/index.php/pagename的页面 ,我想使用mod_rewrite删除索引。 PHP的一部分的url,并使以前的URL http://地址/ pagename 。 如果访问http:// address / pagename ,则需要像访问http://address/index.php/pagename一样加载页面。 使用Nginx,下面的configuration工作,并重写… server { listen 80; server_name localhost; root /srv/http/web/html; index index.php; location ~ ^/[^/]+\.php($|/) { fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; } location ~ .* { rewrite ^/(.*)$ /index.php/$1 last; } } 我将如何完成这个在Apache中。 我目前正在工作,以便根显示正确,并与index.php部分工作编写url。 我怎样才能使重写规则工作,仍然能够使用$_SERVER['PATH_INFO']variables? 我可以在.htaccess中添加什么function?
这在Apache error_log中: [Thu Nov 17 17:08:22.935022 2016] [mpm_event:error] [pid 27241:tid 139681776355296] AH00484:服务器达到MaxRequestWorkers设置,考虑提高MaxRequestWorkers设置 在access_log中,16:41和17:21之间什么也没有。 另外,服务器密度显示在17:08(与Apache error_log同时) – 平均负载:34 – php-cgi(nobody)进程:87 – php-cgi(无人)CPU:140% apache说如何可能达到MaxRequestWorkers,并且在access_log中没有任何内容? 笔记: 我运行一些crons,但他们显示为一个用户(所以不是“无人”),他们运行在PHP CLI(所以不通过Apache) 在htop中,“nobody”通常具有/ usr / sbin / httpd Centos 6,WHM cPanel,Apache 2.4
我有一个没有理由的Apache 2.4.7的Directadmin服务器(可能是一个bug) 一些日志: [Wed Feb 19 08:16:48.801505 2014] [mpm_prefork:emerg] [pid 23327] (38)Function not implemented: AH00144: couldn't grab the accept mutex [Wed Feb 19 08:16:49.179768 2014] [core:alert] [pid 30295] AH00050: Child 23327 returned a Fatal error… Apache is exiting! [Wed Feb 19 08:16:55.660600 2014] [core:notice] [pid 30295] AH00060: seg fault or similar nasty error detected in […]
这个问题是关于Apache重复崩溃,而它运行时,它没有反应,即我无法到达网站,所以我想弄清楚为什么。 Ubuntu 14.04上的Apache 2.4.7服务的My Owncloud站点无法访问。 为了检查什么是错的,我跑了apachectl -S: ~$ sudo apachectl -S AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message VirtualHost configuration: *:443 oc.benopp.org (/etc/apache2/sites-enabled/000-default.conf:1) *:80 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:18) ServerRoot: "/etc/apache2" Main DocumentRoot: "/var/www" Main ErrorLog: "/var/log/apache2/error.log" Mutex mpm-accept: using_defaults Mutex watchdog-callback: […]
我们刚刚从Apache 2.0.53迁移到Apache 2.4一切完美的HTML / JS / CSS文件等 但是,我们的服务器上有许多端点会返回纯文本。 例如 – 一个端点将返回 – RIL~Reliance Industries~1234~abcd 默认情况下,这些响应不包含任何“内容types”,但我期待“文本/纯文本” 在Apache 2.0.53中,我们正在使用 DefaultType text/plain 但是在Apache 2.4中,这个指令是禁用的。 (参考: http : //httpd.apache.org/docs/2.4/mod/core.html#defaulttype ) 我有大量的请求,并希望一个通用的解决scheme,我可以适用于我的Apache,所以如果没有提供的内容types,那么它应该发送“文本/平原” 任何build议,请。