Articles of Apache的2.2

通过URL保护Apache页面

是否有可能只允许特定的url访问某些networking? 基本上,我想限制访问pipe理区域只有本地networking该区域的页面前缀/pipe理本质上,我想所有/pipe理员/ *被禁止公共访问。 Apache可以处理这种情况吗? 谢谢 UPDATE 使用你的build议,我想到了 <LocationMatch admin> Order allow,deny deny from all Allow From 192.168.11.0/255.255.255.0 </LocationMatch> 然而,即使我在networking上,我也能得到403。 另外,如果我把apache放在haproxy后面,这是否正常工作? 因为stream量将从127.0.0.1到apache 更新1 正确的指令如下 <LocationMatch admin> Order deny,allow deny from all Allow From 192.168.11 </LocationMatch> 但是,在Apache前面的代理的问题是不是由上述处理是有什么办法来克服呢?

我可以设置一个“拒绝从x”,覆盖其他confs进行debugging吗?

我目前正在Apache上开发/部署一个Django应用程序,并且经常在debugging设置上调整Django接受连接的方式,忽略或使用ALLOWED_HOSTS 。 如果DEBUG是错误的,它会使用它们,这样可以方便地在我的施工现场保留一些围墙。 但是,真正的相关信息很有用。 我目前只是使用SSH隧道,只是在DEBUG为False的情况下允许本地主机,但是如何让所有人不依赖上述的ALLOWED_HOSTS ? 编辑源代码pipe理中的httpd.conf文件有点令人烦恼, 我不小心犯了一些拙劣的configuration。

使用Plesk 11启用服务器状态

我试图获得apaches服务器状态与Plesk 11工作。但运行sudo /usr/sbin/apache2ctl fullstatus结果在: Forbidden You don't have permission to access /server-status on this server. __________________________________________________________________ Apache Server at localhost Port 80 'www-browser -dump http://localhost:80/server-status' failed. Maybe you need to install a package providing www-browser or you need to adjust the APACHE_LYNX variable in /etc/apache2/envvars 我怎样才能启用服务器状态? 到目前为止,我试图插入 <Location /server-status> SetHandler server-status Order Deny,Allow Deny from […]

删除一个Apache别名子目录

我在Ubuntu 12.04上使用Apache 2。 我添加了一个子目录的别名,指向gitweb。 我意识到我应该使它只能在https上访问 – 所以我删除了别名并重新启动了Apache 。 我仍然可以导航到http://xyz/gitweb – 即使在我的任何configuration文件中都没有别名。 我如何删除它? 编辑 configuration文件看起来像这样: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/administrator/webroot <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/administrator/webroot/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> Alias /gitweb/ /usr/share/gitweb/ <Directory /usr/share/gitweb/> Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All order allow,deny Allow […]

Apache有时会缓慢地提供一些文件types

所以只是解释这个是奇怪的,我不知道提供什么信息。 从本质上讲,与其他文件相比,apache提供的文件types非常缓慢,但不一致。 一般来说,缓慢的文件types是媒体文件,如avi,mp4,mpg等。传输一个大的.txt文件是没有问题的。 我不知道从哪里开始寻找问题。 有任何想法吗?

如果请求的主机不是apache中的虚拟主机,如何closures连接

在我的Web服务器上,我有一大堆使用VirtualHost定义的网站。 目前,如果我从我的networking服务器请求一个没有被定义为虚拟主机的网站,我将返回列表中的第一个虚拟主机。 我想这样做,以便任何要求在虚拟主机中没有定义的网站的请求将closures连接,无论是HTTP和HTTPS。 我想这将涉及到创builddefault和default-ssl虚拟主机,但我不确定究竟是什么放在他们。

如何在Apache中创build一个目录的例外?

我有一个VirtualHost服务http://wiki.example.com ( dokuwiki ): <VirtualHost *:80> ServerName wiki.example.com DocumentRoot /var/www/dokuwiki # some access restrictions on directories </virtualHost> 我应该如何configuration我的服务器,以便URL http://wiki.example.com/other提供/var/www/other的内容? 在上面的设置中,dokuwiki通过内部重写机制处理URL,并使其指向由其引擎处理的新(空)页面。 我意识到我可以创build一个新的VirtualHost但这不是一个直接的选项(我必须保持主机名wiki.example.com )

Apache 2重新启动失败

圣诞节快乐! 我正在build立一个Ubuntu 12.04的networking服务器。 因此我安装了Apache2,也是mod_security。 我编辑了有关mod_security的configuration。 一切正常昨天工作。 今天我要重启Apache,但是这个失败,出现如下错误: $ /etc/init.d/apache2 restart Syntax error on line 2 of /etc/apache2/conf.d/DEADJOE: Invalid command '***', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. The Apache error log may have more information. …fail! 我检查了Apache的错误日志,但在syslog中找不到任何相同的东西。 /etc/apache2/conf.d/DEADJOE的内容是: *** These modified files were found in JOE […]

在哪里创build从源代码编译分离虚拟主机

因为我在文件/etc/apche247/conf/extra/httdp-vhost.conf有很多虚拟/etc/apche247/conf/extra/httdp-vhost.conf ,所以这个文件是非常广泛而且没有组织的。 我知道一些创buildVirtualHostdynamic的方法,但是使用启用了站点的文件夹自动安装Apache(apt-get / yum / pacman install)。 但是,如果编译好的Apache这样的文件夹不存在,并且不知道dynamic的方式(不需要在httpd.conf中包含文件)就可以做到这一点。 这是我的Apache(2.4.7)文件夹: root@ubuntu:/etc/apache247# ll total 76 drwxrwxrwx 15 root root 4096 Jan 19 12:16 ./ drwxr-xr-x 153 root root 12288 Jan 19 21:38 ../ drwxr-xr-x 2 root root 4096 Jan 19 12:16 bin/ drwxr-xr-x 2 root root 4096 Jan 19 12:16 build/ drwxr-xr-x 2 root root 4096 […]

Apache别名到虚拟主机中的文件

我试图设置z-push,它需要一个别名/Microsoft-Server-Activesync ,它指向VHost位置以外的另一个目录中的文件index.php 。 为了testing我在同一个path中设置一个文件,并创build了以下内容 Alias /info /var/www/z-push/info.php <Directory "/usr/share/z-push/"> Options -Indexes AllowOverride None Order allow,deny allow from all </Directory> 哪个不起作用,但是如果我改变这个别名 Alias /info.php /var/www/z-push/info.php 我可以通过url example.com/info.php访问它。 除了我需要能够有ActiveSync东西的工作example.com/info 。 我认为我可以用RewriteRule来解决这个问题,但我没有任何运气。 谢谢。 编辑: 这是我的虚拟主机configuration: SetEnv RAILS_ENV production RewriteEngine On # Rewrite index to check for static RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached page […]