apache2

zend community server very slow on first request with OS X 10.6

I have installed Zend CE 4.0.5 for php 5.3 on my Mac Book Pro running Snow Leopard osx 10.6. I use this setup for my local development environment. When I haven't done a request in a while ( > 20 mins) or after a reboot, the first request takes quite some time to respond. Maybe 45 seconds. After that initial lagged request it acts as...

How do I pass the HTTP username from Apache to Mongrel/Rails?

The goal: running a Rails application on Mongrels, allowing access through Apache after doing basic HTTP Authentication The problem: reading the supplied username from within Rails Apache: <Proxy balancer://mongrel_cluster> BalancerMember http://127.0.0.1:4001 # ... Order deny,allow Deny from all AuthType Basic AuthName "<real...

X-Sendfile and VERY big files on Apache2

Any filesize over about 4GB is not going to work with the mod_xsendfile for Apache2 (as it sets the content length to a long). I am willing to rewrite it to support this; however, I can find no documentation on how to set content length from the apache api to something larger than a long and thus serve large files through Apache. I know...

Mac OS X 10.5 Apache and Subversion upgrade alternatives

I've found myself down a rabbit hole and would like advice. It looks like Mac OS X 10.5.8 comes bundled with a pre-configured version of Apache 2.2.11 (located in /usr/sbin), PHP 5.2.10 (located in /usr/bin) and subversion 1.4.4 (located in /usr/bin). I have installed MAMP for MySQL 5.0.41 (located in /Applications/MAMP/...) which come...

image rendering issue

I am running Apache/2.2.3 (CentOS). For some reason certain images, jpg, gif, or png will show up as byte code when accessed directly on the server. Firefox 3 and Safari both think the content type is text/html. IE I believe has something built in to recognize it is an image and ignore the content type and renders the image correctly reg...

mod_rewrite rule not working

I have the following rules in my htaccess: RewriteRule ^([^/.]+)/?$ list.php?categoryShortForm=$1&locationShortForm=world [QSA] RewriteRule ^([^/.]+)/([^/.]+)/?$ list.php?categoryShortForm=$1&locationShortForm=$2 [QSA] RewriteRule ^([^/.]+)/([^/.]+)/[^/.]*-p([0-9]+)/?$ view.php?categoryShortForm=$1&locationShortForm=$2&postingId=$3...

Pylons deployment questions

I'm a beginner with Pylons and I've mostly developed on my localhost using the built-in web server. I think it's time to start deployment for my personal blog, I have a Debian Lenny server with apache2-mpm-prefork module and mod_wsgi - I've never really used mod_wsgi or fastcgi and I hear either of these are the way to go. My questions:...

Rewrite to index.php best practices

I notice that there are a few common ways to setup RewriteRules for MVC based PHP applications. Most of which contain: RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d Followed by a RewriteRule: RewriteRule ^(.*)$ /index.php?$1 [L,QSA] or RewriteRule .* /index.php/$0 [PT,L] ...

IE Sending OPTIONS Request for File Downloads

On my site I have a very basic setup: an 'a href' tag that just points to a file. Nothing fancy: <a href="/path/to/my/file.doc">File</a> No fancy javascript, nothing. Some users who are using old IE versions less than 8 have been having spotty problems downloading different files like this. What I've been able to trace it back to is t...

mod_rewrite: Rewriting / to cgi script

Is there any way to rewrite a GET / to a cgi script with a parameter? Basically redirect / to /cgi-bin/scipt.cgi?123. This does not work: RewriteEngine On RewriteRule ^/$ /cgi-bin/script.cgi?123 [L] Instead it somehow rewrites / to /index.html/ Any way of doing this? ...

How do I configure Apache to forward some URLs to two resin containers?

Good day, I have two resin servers - r-server-a and r-server-b. I created two because both have web applications that need to be in the root context path '/' (and using same port '80'). However, both web applications need to see each other (i.e. access the other application's resources & pages). Which is why I thought I'd use an apach...

URL/Apache redirection question. (domain+directory redirect to sudomain)

Hello, I have been trying to figure this out for about 2 hours now. A new requirement came up where it was asked of me to try to find a way to send requests from foo.bar.com/blah to blah.bar.com. Technically /blah doesn't exist, but I was hoping to have the server redirect before it gets to that point. Has anyone had to do this before...

Apache 2 Upgrade Killed Our .htaccess, Can't fix, please help!

We were forced to upgrade to Apache 2 today and as soon as we did our rule set that was working for months stopped working. The behavior it shows is completely ignoring the .htacess, even after we delete it (.htacess) the server seems to use a "phantom" rule. IE: site/stuff/ without .htacess should show a 404... but instead it goes to ...

Is there a better way to handle authentication?

Right now I have a server set up for multiple clients: clientA, clientB, clientC. Each client has their own users. The way I have it setup is clientA goes to http://www.site.com/clientA and is presented with a login screen which is triggered by an .htaccess file in a directory called /clientA. The .htaccess file has rules which direct...

.htaccess File Options -Indexes on Subdirectories

I have the following .htaccess line, simple no indexes on root. Options -Indexes What do we add so it propagates to any sub directory instead of having to create one file for each? One .htaccess on root only. ...

httpd.conf: ignore certain directories?

I have an httpd.conf file that looks like this: Alias /media/ /var/projects/potato_gun/media/ WSGIScriptAlias / /var/projects/potato_gun/django.wsgi The problem is, I broke all my URLs that start with /~username because they get sent off to django.wsgi instead. Is there anyway I can get it to ignore any URL that starts with /~? ...

Multiple requests on PHP

I have an application on an Apache2. The applications plays some media files like video files, mp3 files and wav files using a php file in order to avoid direct download from not-registered users. Now, I'm having problems because during the media file is loading, I cannot go to another page on the application until the media file is full...

How to remove a cookie in Apache

I need to remove a cookie from the HTTP request that gets to the server. Doing it on the client (that writes this cookie) or on the server (that reads it) is not an option. I have Apache 2.0 that proxies requests between client and the server, so I was hoping to remove the cookie right there in Apache using mod_rewrite. My question is,...

Issue in Kohana 2.3.4 (2.4) with routing and 'Index' controller

I have: brand new clean copy of Kohana 2.3.4 (tried 2.4 RC1 also), a controller named 'index' on a Debian with Apache 2.2.9. When i type address like http://localhost/kohana/index/index i expect controller 'index', action 'index' to be executed. It works on Windows localhost, works on shared hosting. But does not on my Debian server. ...

URL rewriting and GET forms in Apache/PHP

I enabled URL rewriting on my PHP site with Apache (http://example.com/index.php?param=12 becomes http://example.com/index/param/12). I have a few forms which are in GET instead of POST. After subitting the form, the resulting URL is not rewritten. Is it possibile to keep rewritten URLs after submitting a GET form? UPDATE: I found th...