Articles of apache 2.2

Apache反向代理:在链接中更改协议,并将目标从http转换为https

我有一个HTTP服务运行在10.1.1.187:8080。 这是作为一个公共https服务交付到https://public.example.com这是通过Apache代理魔术10.1.1.186:443: <VirtualHost 10.1.1.186:443> ServerName public.example.com #Configure Reverse Proxy ProxyRequests Off ProxyPreserveHost On <Location /> ProxyPass http://10.1.1.187:8080/ ProxyPassReverse http://10.1.1.187:8080/ Order allow,deny Allow from all </Location> #Define Virtual Host Specific SSL information. SSLEngine On SSLProxyEngine On SSLProxyProtocol all -SSLv2 SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key </VirtualHost> 当我在浏览器中inputhttps://public.example.com并点击证书时,我可以得到包含login表单的第一页: <form action="http://public.example.com/login" method="post"> <– … contains username, password fields and a […]

nginx将REMOTE_USER传递给apache2

我运行一个nginx反向代理背后的apache2实例,nginx执行基本身份validation,apache2提供Nagios cgi脚本。 我能够将authentication的用户从nginx发送到apache(目前使用X-Forwarded-User头设置为$ remote_user) – 但是我很努力地让apache2识别这个头并在执行CGI脚本之前设置REMOTE_USER envvariables。 我相信mod_rewrite可能能够做到这一点,但我所看到的所有例子都与相反的场景有关,其中apache2发送REMOTE_USER下游到另一个后端服务器。 甚至有可能将apache中的REMOTE_USER设置为apache自己的mod_auth模块之外的东西?

Apache网页内容拥有者的最佳做法? (www数据,根,用户等?)

对于简单的LAMP设置,处理/ var / www目录(或子目录)文件所有权的最安全的方法是什么? Apache作为www数据运行,所以如果它是所有者,它将有写权限。 这可能是一个坏主意,但是使file upload更方便。 如果他们拥有root权限,是否存在任何安全问题? 让每个用户成为/ var / www / site文件夹的所有者是否合理? (我意识到〜/ public_html是这样做的正确方法,但是使用/ var / www /下的所有Web内容可以很容易地看到服务器上当前正在运行的站点)

Apache HTTPD:允许htpasswd或LDAP中的用户使用特定的组

在apache auth中有一个相关的问题:LDAP和htpasswd的组合,但是我想扩展一下。 我想要允许用户在htpasswd文件中,或者他们在LDAP和有效组的成员。 因此, Require valid-user来自另一个问题的Require valid-user不够严格,因为它将允许来自LDAP的任何人。

Apache的mod_perl与mod_cgi:我如何决定使用哪个?

在configuration现有的Web应用程序时,在决定是使用Apache的mod_perl还是mod_cgi时应考虑哪些因素?

Apache被胡言乱语的请求吓坏了,怎么停止?

我的VPS越来越受到我的服务器上不存在的随机文件/目录的尝试,每秒大概两次。 据推测,这只是一个机器人,试图找出是否有任何安全漏洞在我的服务器上的脚本,或者我的服务器是否可以用作代理。 日志条目如下: 组合(访问)日志: – – – [02/Mar/2011:14:10:18 +0000] "GET http://ad.xtendmedia.com/st?ad_type=iframe&ad_size=728×90&section=1697270 HTTP/1.0" 403 204 "http://www.findthemovies.net/" "Mozilla/4.0 (Windows; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" 错误日志: [Wed Mar 02 14:10:18 2011] [error] [client 61.139.105.162] client denied by server configuration: /var/sites/***/public/st, referer: http://www.findthemovies.net/ 请求来自随机引用的随机IP地址,所以没有特定的IP阻塞,我似乎能够做到。 没有安装任何可以滥用的脚本,并且我的服务器上没有启用代理,但主要担心的是这些不断请求正在耗尽资源,并减缓了对我的站点的真正请求。 是否有阻止这些请求,通过能够识别它们,阻止它们被Apache处理并使用分配给它的所有资源? (我使用的是Prefork,所以很显然,请求量开始启动Apache进程,并消耗客户端和资源)。

如何在CentOS上chroot Apache?

系统pipe理员build议我在chroot监狱里运行Apache,以防止攻击者控制服务器。 所以我的问题是: 什么是在RHEL / CentOS 5中对Apache / 2.2.3进行chroot的最好的方法是什么?我只使用Apache提供的默认模块,比如mod_php和mod_security。 我听说过mod_security SecChrootDir,但我不知道它是否适合我的configuration,它说,它只build议在文档中的静态文件服务。 谢谢!

Apache:将一个虚拟主机映射到另一个虚拟主机的子目录

我试图将一个虚拟主机映射到另一个虚拟主机的子目录,例如http://host2.com -> http://host1.com/host2 。 此时,无论何时访问http://host2.com ,都会映射到http://host1.com而不是http://host1.com/host2 我的默认站点文件是这样的 <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName "host1.com" <Directory /srv/www/host1> Options Indexes FollowSymLinks MultiViews AllowOverride None Order deny,allow Allow from all </Directory> DocumentRoot /srv/www/host1 WSGIScriptAlias / /srv/www/host1/apache/django.wsgi </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName "host2.com" DocumentRoot /srv/www/host1 <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://host1.com/host2 ProxyPassReverse / http://host1.com/host2 […]

通过系统日志添加Apache日志导出仍然写本地日志

为了安全和日志检查的原因,我们将syslog / syslog-ngconfiguration为将Apache日志导出为专用的日志服务器。 但是我想在Apache服务器上保留一个错误日志的副本,以便在出现问题时方便理解。 这是configuration文件 ErrorLog /space/www/vhost/data/logs/errors.log ErrorLog "|/usr/bin/logger -t vhost_error -p local6.info" CustomLog /space/www/vhost/data/logs/access.log combined CustomLog "|/usr/bin/logger -t vhost_access -p local6.info" combined access.log在两台服务器(apache one和log one)上,但是errors.log只在日志服务器上。 我不明白为什么。 也许我可以在Apache服务器上configurationsyslog来编写本地日志并将其发送到日志服务器?

尝试在Ubuntu Lucid Lynx上启动Apache2 mod_wsgi而无法成功运行Django

我有一个最小安装ubuntu lucid-lynx与约256MB内存的小vps ,它是新安装的没有什么特别的运行。 我试图部署django到它,而我成功地运行服务器使用manage.py,我不能得到Apache与wsgi工作: # service apache2 start && service apache2 status * Starting web server apache2 [ OK ] Apache is NOT running. Erorr日志/var/log/apache2/error.log : [Thu Apr 14 21:17:29 2011] [warn] pid file /var/run/apache2.pid overwritten — Unclean shutdown of previous Apache run? [Thu Apr 14 21:17:29 2011] [notice] Apache/2.2.14 (Ubuntu) mod_wsgi/2.8 Python/2.6.5 configured — […]