Articles of apache 2.4

Apache POST数据临时存储

我已经高低起伏,我似乎无法find它。 当apache接收POST / HTTP / 1.1与正文字段中的一些数据时,是存储在内存或文件中的数据? 从我已经能够testing它不在记忆中。 这个问题的答案是否根据数据的MIMEtypes而改变? 如果是这样,那么file upload在哪里(multipart / *)去? 我知道这样的数据作为CGI的STDIN传递到目标文件,而THOSE系统的答案取决于那里的特定程序。 例如python制作临时文件。 这不是我问的问题。 我具体询问数据保存在哪里,服务器在套接字中接收数据,然后在STDIN中传递数据。 感谢您的考虑!

Apache上的LDAP身份validation拒绝有效的凭据

我正在尝试将我的LDAP与专用于我的SVN存储库的Apache 2.4服务器相关联,所以我使用Apache mod dav_svn和authnz_ldap 。 LDAP可以自行正常工作。 我可以设法将服务器与pipe理员DN绑定,然后search我需要的用户。 连接时,如果用户不存在,这是一个[没有这样的对象]错误(耶!)。 但是,如果用户存在,即使密码正确,LDAP始终会返回[Invalid credentials]错误。 这里是Apache的error.log结束 [authnz_ldap:debug] [pid 9243:tid 2990508864] mod_authnz_ldap.c(516): [client ::1:46639] AH01691: auth_ldap authenticate: using URL ldap://my_ldap_ip:port/ou=aaaa,dc=company,dc=fr?uid?sub [ldap:debug] [pid 9243:tid 2990508864] util_ldap.c(379): AH01278: LDAP: Setting referrals to On. [authnz_ldap:info] [pid 9243:tid 2990508864] [client ::1:46639] AH01695: auth_ldap authenticate: user mr.myself authentication failed; URI /svn/ [ldap_simple_bind() to check user credentials […]

AWS写入权限,httpd 2.4

amazon web services,服务器版本:Apache / 2.4.6(红帽企业Linux) apache日志报告: [Fri Aug 07 13:53:40.793562 2015] [:error] [pid 10730] [client 149.88.114.40:40800] PHP Warning: file_put_contents(./test.txt): failed to open stream: Permission denied in /var/www/html/vraim/index.php on line 18 这里是试图写入当前目录的PHP代码: <?php file_put_contents("./test.txt", "Test"); // <=== This cannot write!!! $uid = posix_getuid(); echo "PosixGetUID: " . $uid . "<br/>"; $userinfo = posix_getpwuid($uid); print_r($userinfo); ?> 目录上的权限: […]

如何禁止通过IP子网访问Apacheconfiguration中的pipe理员URLpath?

我只想让私有IP范围能够访问我的网站上的pipe理员面板。 我find了一篇文章解释如何做一个特定的目录path,如/ var / www / admin /,而不是通过URL。 我无法使用确切的目录path,因为我使用的MVC框架没有可以指向的静态文件。 有没有可能在虚拟主机configuration中做到这一点? 我脑海中的伪代码看起来像这样, <Directory $domain/admin> Order allow,deny Allow from 192.168.1.0/24 </Directory>

虚拟主机文档根改变整个服务器的web根目录

我目前有example.com指向服务器之一。 我想从一个不同的目录(/ WebData)服务器example.com。 我通过编辑httpd.conf来做到这一点 http://pastebin.com/UjHhRNTX 我这个按需要工作。 然后我发现我需要将website.org添加到服务器。 于是我挂载了另一个磁盘,并创build了一个名为/ WebDataWebsite的目录 并使用以下VHost创build/etc/httpd/conf.d/websiteorg.conf: http://pastebin.com/GTmqtABf <VirtualHost *:80> DocumentRoot "/WebDataWebsite" ServerName website.org ServerAlias www.website.org <Directory "/WebDataWebsite"> Require all granted </Directory> </VirtualHost> 出于某种原因,所有到example.com和website.org的stream量都被引导至/ WebDataWebsite中的index.htm 我做错了什么? 如何使WebData(在httpd.conf中)成为默认的网站,但用VHOST过滤servername website.org?

PHP-FPM不能使用htaccess

我有一个VirtualHost : <VirtualHost *:80> DocumentRoot "/var/www/html/example.com" ServerName example.com ServerAlias *.example.com <Directory "/var/www/html/example.com"> Require all granted Options -Indexes +FollowSymLinks -ExecCGI AllowOverride All DirectoryIndex index.php <IfModule mod_proxy_fcgi.c> RewriteEngine On RewriteBase / RewriteOptions InheritBefore RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^([^\.]+\.php)$ fcgi://127.0.0.1:9000/var/www/html/example.com/$1 [L,P] </IfModule> </Directory> </VirtualHost> 还有位于/var/www/html/example.com/mysub/.htaccess的.htaccess文件。 在.htaccess文件里面,我有: Options -MultiViews RewriteEngine On RewriteBase /mysub Options +FollowSymLinks RewriteCond $1 !^(index\.php|assets|css|js|favicon\.ico|robots\.txt) RewriteCond […]

mod_wsgi继续使用系统python

我在ubuntu 14.04上安装了apache 2.4,使用了源代码mod_wsgi 4.4和pyenv来使用python 2.7.9。 我设置了Apacheconfiguration来使用pyenv。 运行我的web2py应用程序时出现以下错误: File "/home/ubuntu/.pyenv/versions/w-2.7.9/lib/python2.7/site-packages/boto/https_connection.py", line 131, in connect ca_certs=self.ca_certs) File "/usr/local/lib/python2.7/ssl.py", line 387, in wrap_socket ciphers=ciphers) File "/usr/local/lib/python2.7/ssl.py", line 138, in __init__ self._sslobj = _ssl.sslwrap(self._sock, server_side, AttributeError: 'module' object has no attribute 'sslwrap' 我不知道为什么,但突然看到它停止使用pyenv python并跳转到/usr/local/lib/python2.7/ssl.py并使用它。 问题不是ssl sslwreap函数,而是mod_wsgi切换到系统python(/usr/local/lib/python2.7/ssl.py),而不是pyenv 怎么了?

在Apache服务器上运行Python脚本:403禁止的错误

我需要在运行Ubuntu的AWS EC2实例上使用Apache设置的网站子域上运行一些python脚本。 我试着按照这篇文章中提到的一些步骤。 在尝试访问子域时,出现了403错误(“禁止访问。您无权访问此服务器上的/index.py”)。 我在index.py文件上有755(-rwxr-xr-x)权限。 subdomain.website.com.conf文件: <VirtualHost *:80> ServerAdmin [email protected] ServerName subdomain.website.com DocumentRoot /var/www/html/subdomain.website.com/public_html Options +ExecCGI DirectoryIndex index.py AddHandler cgi-script .py </VirtualHost>

使用.htaccessredirect到维护文件

我试图做一个简单的redirect到维护页面,但似乎像Apache不会让我这样做! 我有一个维基的3个版本的文件夹(每个都有一个特定的语言),所以我想redirect每个维基交通到他自己的维护页面。 这里是我的.htaccess #Redirect trafic to maintenance page RewriteEngine On RewriteCond %{REQUEST_URI} !maintenance.htm$ [NC] RewriteRule "(.*\/wiki.*\/).*" "$1/maintenance.htm" [R=302,L] mod_rewrite已启用 AllowOverride All已启用 我testing了我的正则expression式https://regex101.com/r/jN2kA7/1 RewriteRule ^。* $ maintenance.htm [R = 302,L]奇怪地redirect到http://myserver/var/www/wiki/maintenance.htm 目标是将“myserver / wiki / ANYTHING”redirect到“myserver / wiki / maintenance.htm” 如果有人能告诉我我做错了什么,这将是很好的 谢谢 编辑: 经过一些更多的testing,似乎我正在寻找类似的东西 RewriteRule "(.*)" "??PROTOCOL??://%{HTTP_HOST}/??SITEFOLD??/maintenance.htm" [R=302,L]

Apache中的系统错误与httpsredirect加上密码要求和错误文档的组合

在Apache 2虚拟主机中,我有以下configuration(在我的情况下,文档根目录的.htaccess (为简单起见,http:80和https:443也是如此) RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 为了将任何http连接redirect到https而且, ErrorDocument 500 /error.php ErrorDocument 404 /error.php ErrorDocument 403 /error.php ErrorDocument 402 /error.php ErrorDocument 401 /error.php 生成自定义错误消息。 第三个要素是一个受保护的子文件夹,需要进行身份validation(每个.htaccess在该文件夹中): AuthType Basic AuthName "Test" AuthUserFile /some/path/to/passwords Require user joe 一切工作正常,除非有人试图检索http://example.com/protectedfolder事实上,会发生什么事情是,客户端获得302 Found答复redirect到https://example.com/error.php 另一方面, 如预期的那样, https://example.com/protectedfolder会导致一个自定义(即,由error.php生成) 401 。 http://example.com/publicfolder导致302redirect到https://example.com/publicfolder ,然后301永久redirect到https://example.com/publicfolder/ ,最后(因为DirectoryIndex被禁用)a自定义403错误。 正如所料。 而且, http://example.com/nonexistent也会导致302到https://example.com/nonexistent ,然后按照预期的那样定制404 。 如果我禁用了ErrorDocument 401configuration,则http://example.com/protectedfolder的查询会立即生成401 […]