apache2

RewriteCond and Alias

I have defined alias that looks like this: Alias /pictures/sm/ /var/www/my_site/data/_active_thumbnails/ Later in the VirtualHost section have: DocumentRoot /var/www/my_site/sites/www.my_site.com/htdocs RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/thumbnails/(.*)\.(jpg|JPG) /images/stg-list-img.png [PT,L] What I'm tryin...

XAMPP is caching .html files running as PHP

I have XAMPP (latest version) installed on my Mac OS 10.6.3 I've added the following to .htaccess because I want .html to be interpreted as PHP. AddType application/x-httpd-php .php .html The problem is that the default XAMPP config seems to be caching .html files as static... so even though the PHP statements inside are being called...

Best practice for setting up wsgi on root directory?

what's the best ways to mix static files and wsgi app served on the root directory? http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide recommends setting up WSGIScriptAlias / /usr/local/www/wsgi-scripts/myapp.wsgi and alias other directories and files: Alias /robots.txt /usr/local/www/documents/robots.txt Alias /favicon....

Apache/PHP is determined to serve the wrong file

I have a page that is called with a url like http://testserver/path/to/foo/bar/ but apache is serving the wrong file altogether. /path/to/ is a real directory where all the code and .htaccess file is. foo/bar/ is supposed to redirect to foo_bar.php with a RewriteRule, but it never gets there. It's not a mod_rewrite issue as I have comme...

vHost RewriteRule is creating a 500 Error

Hello, Below you will find my current vHost entry that I am using for a site that I currently have under development. This vHost entry works fine when I have it on my local machine, but when I push my code to my staging server that is running this same vHost record I receive a 500 Internal Server error. The machine I'm running this vHo...

Problems debugging virtual host with Netbeans

I'm running Ubuntu 9.10 I installed apache2 and downloaded the php 5.3.2 tar.gz, untarred and compiled. I then installed xdebug via pecl. After that I installed mysql-server and PhpMyAdmin. PhpMyAdmin can change apache2 settings, and now, xdebug is no longer included in my phpinfo(); overview. I've done a search for all possible php.in...

How do I tell mod_perl2 to find my Perl modules?

I just installed my system with Oracle 64-bit Linux5.4 running Apache Server version: Apache/2.2.3 and mod_perl 2. Now, I have my Perl libraries set in a specific path: /my/perl/libs and I have adjusted my httpd.conf to compensate for this (I added the below): SetEnv MY_LIBS /my/perl/libs and in my CGI programs I'm setting my envi...

Checking if file exist with RewriteCond in a chained RewriteRule

Hello, I hope you could help me here. I have a RewriteRule which gives you a crossdomain.xml file depending on the domain name. I have it in a way that ignores the ".dev." string in the middle, example: Request: http://site1.dev.mydomain.com/crossdomain.xml Returns file: /etc/httpd/conf/crossdomain/site.mydomain.com.xml RewriteCond %...

Implementing Google Crawlable AJAX URL's with Mod Rewrite

I'm looking to implement the Google crawlable AJAX states as described here: http://code.google.com/web/ajaxcrawling/docs/getting-started.html Essentially this requires specifying your AJAX states with a #!state value at the end of the url. This should then be passed to the application server (PHP in my case) as part of the query stri...

How do I have a reverse proxy work with or without the trailing slash?

I have a apache web server that needs to reverse proxy a site. So example.com/test/ or example.com/test pull from the same other webserver. I have setup a reverse proxy for the one without the trailing slash like this: ProxyPass /test http://othersite.com/test ProxyPassReverse /testhttp://othersite.com/test But it doesn't work with ...

apache front end using mod_proxy_ajp to tomcat on different servers

Anyone knows the steps to run Apache on server A as front end and run mod_proxy_ajp to connect to tomcat instances on server B? I want to run apache on sever A to do name based vhost that connects to many tomcat servers. I can run mod_proxy_ajp, only if apache and tomcat are on the same server. What I've tried so far: In server A, run...

using mod_auth_mysql and mod_auth together

is it possible to use a database and a flatfile to authenticate a user for a directory. for example, if the requested user is not found in the database, apache should check the flatfile via mod_auth for the user. this is my current .htaccess files AuthMYSQLEnable On AuthName "Restricted" AuthType Basic AuthGroupFile /dev/null AuthMySQL...

Apache loads any file that begins with the same string as used in url. How to prevent this?

If I point to: mywebsite.com/search and there is a file called search.php or search.html or search.inc.php or search.whatthehell.php in website's directory, Apache will point to that file instead of 404'ing. What is even more annoying is that if I point to: mywebsite.com/search/string?also=whatever Apache will still display any file...

Automatically enabling an output filter in Apache module

I am developing a module for Apache which contains an output filter that I would like to always be invoked so that it can determine whether to process the request data or just pass the data along. Since I would like the module to be compatible with Apache 2.0 as well as 2.2, I do not want to use mod_filter. Ideally I would like to do th...

Passenger apache default page error

I asked this a couple of days ago on Server Fault but am getting no responses and little interest. Since it is related to setting up a dev environment I thought the SO community might be able to help me out... I just installed Passenger and the Passenger Pref Pane on OSX. However, when I try to browse to one of my Rails applications I...

mod_fcgid - strange log line wraping

In my shell script that I run as a cgi application using fast cgi, when I echo as below, the log lines in apache error log appears broken up ( as shown below ). Anu idea why this happens? echo "a few words - some other words" 1>&2 In the log file [Tue Apr 27 12:27:54 2010] [warn] mod_fcgid: stderr: a few words - [Tue Apr 27 12:27:54 ...

Can Apache httpd be made to log errors to console instead of log files under Windows?

I'm doing infrequent development with Apache/PHP on my Windows machine so I've opted to run apache as a console process instead of a service. It would be nice if errors could be logged to the console window instead of a logfile so I can see them immediately. Can this be done somehow? It doesn't seem that apache has such a capability buil...

localhost not going to desired VirtualHost

I have several VirtalHosts set up on my computer. I'd like to visit the site I'm currently working on from a different PC using the my comp's ip address, but every config i've tried keeps taking me to a different virtual host (in fact the first virtualhost I set up on my comp). How do I set up the apache virtualhost configs to ensure t...

Rewrite only URLs that don't exist

I'm looking for a way to rewrite URLs only if the path doesn't exist. This isn't to handle 404s, but to redirect page URLs to a shared PHP file (ie: '/contact-us/' -> '/show_page.php?page=contact-us'). The basic redirect is easy enough to achieve, however I want to be able to override the default page by adding '/contact-us/index.php' i...

Problems with mod_rewrite, help!

I have the php mail function on a page but every time I load that page, I wil get 8-12 mails instead of 1 mail. The problem is the htaccess I suppose. My .htaccess: Options +FollowSymLinks Options -MultiViews RewriteEngine On RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d...