apache

How can I block mp3 crawlers from my website under Apache?

Is there some way to block access from a referrer using a .htaccess file or similar? My bandwidth is being eaten up by people referred from http://www.dizzler.com which is a flash based site that allows you to browse a library of crawled publicly available mp3s. Edit: Dizzler was still getting in (probably wasn't indicating referrer in ...

.htaccess mod rewrite 301-redirect

I want: all links which not contained filename (not .html, .jpg, .png, .css) redirect with state 301 to directory, for example: http://mysite.com/article -> http://mysite.com/article/ But http://mysite.com/article/article-15.html not redirects. What regulat expression I must write to .htaccess for adding slash to virtual directories? ...

Looking for DOS/DDOS protection tools and strategies

I am working on a java application that exposes webservices for a flash client. Any idea on how to prevent DOS/DDOS attacks ? I cannot use mechanism unfriendly for the end user such as captcha. So far I have found mod_evasive, an apache module which looks quite promising... Any suggestions, best practices, tools I might use ? Thanks in a...

FollowSymLinks - how to setup

I am trying to have Apache follow a symlink to a raid array server that will contain some large data files. I have tried modifying httpd.conf to have an entry like this Options FollowSymLinks AllowOverride all Order allow,deny Allow from all to have Apache follow any sym link in the Sites folder. I keep getting an error ret...

Detect browser connection closed in PHP

Does anyone know if it is possible to detect whether the browser has closed the connection during the execution of a long PHP script, when using apache and mod_php? For example, in Java, the HttpOutputStream will throw an exception if one attempts to write to it after the browser has closed it -- Or will respond negatively to checkError...

Make apache automatically strip off the www.?

For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for http://www.foobar.com/anything to http://foobar.com/anything. The best I could come up with is a mod_rewrite-based monstrosity, is there some easy simple way to tell it "Redirect all requests for domai...

Can regex capture and substitution be used with an Apache DirectoryMatch directive?

Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following: <DirectoryMatch ^/home/www/(.*)> AuthType Basic AuthName $1 AuthUserFile /etc/apache2/svn.passwd Require group $1 admin </DirectoryMatch> but so far I've had no success. Specifi...

Apache gives me 403 Access Forbidden when DocumentRoot points to two different drives

I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the apachefriends release. This is my httpd-vhosts.conf file: NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> ServerName foo.localhost Document...

How can I ban a whole company from my web site?

For reasons I won't go into, I wish to ban an entire company from accessing my web site. Checking the remote hostname in php using gethostbyaddr() works, but this slows down the page load too much. Large organizations (eg. hp.com or microsoft.com) often have blocks of IP addresses. Is there anyway I get the full list, or am I stuck with ...

What's the best way to run Wordpress on the same domain as a Rails application?

I've got a standard Rails app with Nginx and Mongrel running at http://mydomain. I need to run a Wordpress blog at http://mydomain.com/blog. My preference would be to host the blog in Apache running on either the same server or a separate box but I don't want the user to see a different server in the URL. Is that possible and if not, w...

Why easyphp stop all apache processes on severals PC?

Hi, on some Windows PC, when I have both easyPHP and a standalone apache service configured on another network port and with a specific service name, I have a problem : when I stop easyphp, the other apache is stopped too. The problem do not occur on all PC I have, but seems very strange to me. Any idea? more information after answer...

Can I serve a ClickOnce application with Apache?

We're testing our ClickOnce deployed application internally on IIS (Internet Information Services), but we're wondering if we can deploy it to the wider internet using Apache on Linux so we can make use of our existing external website host. If so, is there anything else I need to consider other than as specifying the correct mime types...

How to put up an off-the-shelf https to http gateway?

I have an HTTP server which is in our internal network and accessible only from inside it. I would like to put another server that would listen to an HTTPS port accessible from outside, and forward the requests to that HTTP server (and send back the responses via HTTPS). I know that there are several ways to do this with some programming...

Automated Apache Server Maintenance Page

I have a website running on a Linux/Apache/Tomcat stack that needs to be automatically taken offline every few months for server maintenance, which will last an arbitrary amount of time. What are some options for getting Apache to put up and take down a "server maintenance" page? I need to be able to control this via shell script. (The ...

Restrict Apache to only allow access using SSL for some directories

I have an Apache 2.2 server with an SSL certificate hosting several services that should be only access using SSL. ie: https://myserver.com/topsecret/ should be allowed while http://myserver.com/topsecret/ should be either denied or, ideally, redirected to https. http://myserver.com/public should not have this restriction, and should...

How to combine requests for multiple javascript files into one http request?

This concept is a new one for me -- I first came across it at the YUI dependency configurator. Basically, instead of having multiple requests for many files, the files are chained into one http request to cut down on page load time. Anyone know how to implement this on a LAMP stack? (I saw a similar question was asked already, but it se...

How does debug level (0-99) in the Tomcat server.xml affect speed?

The server.xml which controls the startup of Apache Tomcat's servlet container contains a debug attribute for nearly every major component. The debug attribute is more or less verbose depending upon the number you give it, zero being least and 99 being most verbose. How does the debug level affect Tomcat's speed when servicing large nu...

Apache and J2EE sharing security realms/logins, single sign-on

Here is the situation I'd like to create: www.blah.com/priv - protected by Apache HTTP Basic Auth, realm "foo" www.blah.com/application - protected by Tomcat/Servlet HTTP Basic Auth, realm "foo" User access /priv, apache requests login info, they provide and are given access Same user then requests /application. Since they have authen...

Where's the best source of up to date RPMs for RedHat?

Where can I find up to date RPMs for different versions of Redhat Enterprise Linux? Specifically I'm looking for an Apache RPM. Normally I would turn to: http://dag.wieers.com/rpm/packages/ but they don't seem to have any RPMS for apache. Any ideas? ...

Locking File using Apache Server and TortoiseSVN

Guys, I am seeting up Apache server with TortoiseSVN for local source code repository. Currently on trial purpose I am setting only two users. Is it possible for administrator to set up some thing so that file get compulsory locked once its checkout (copy to working directory) by some one. Abhijit Dhopate ...