apache

A tool to debug and test mod_rewrite (.htaccess) directives

Although being a decent web developer, I and most of my colleagues always struggle with basic tasks when using mod_rewrite. I read the manuals and understood most of it, however most skills I've learned in life are by doing. The trouble is, there's no easy way to debug the configuration. Most of the time if I succeed at configuring the...

how to disable http_auth on a single zend controller

Hey All, Project which I am currently working is developed using ZF and dojo. For our Development and Production server we have basic user authentication which is handled using apache's virtual host config file (by having users and password files). When we type the server URL, it will pop-up the authentication window. It is working wel...

HTTP to HTTPS redirect not working on Apache with PHP

I have a script that handles several different redirects on a server with a snippet that looks like follows: if($url == "http://www.url.com") {header("Location: https://www.url.com/index.html");} The script works exactly as intended with one issue - all of the https redirects end up redirecting to http (versus the https as defined...

getContentLength() return -1 only in WiFi ?

I want to know the length of the file, so i try getContentLength(). It works fine with network connection (edge/3g) but return -1 with WiFi ??? Why ? the wifi is good the file was found, can be download but the return of contentlength is always "-1", i dont understand, please help me. Is there an other way to get the length ? My code ...

Handling URL rewriting for a multi-language website

Hello, I'm working on a multi-language website and I'm having a little trouble with rewriting URLs. So lets say I want to rewrite URLs for the products page. I must have something like this: http://www.mywebsite.com/products/some-product-name-34.html (for english) http://www.mywebsite.com/produits/some-product-name-34.html (for frenc...

Using mod_rewrite to hide the .py extension of a Python script accessed on a web browser

I want to hide the .py extension of a Python script loaded in a web browser and still have the script run. For example: typing url.dev/basics/pythonscript in the address bar fires pythonscript.py and shows the results in the browser window. The URL url.dev/basics/pythonscript fetches the static file /pythonscript.py The browser...

httperf for load testing and validating response

I want to load test a site with httperf. But this is not for performance testing. It is to reproduce a random bug where sessions are not maintained correctly and content generated by users are swapped. Can i use httperf to make simultaneous post requests and verify the response/results of the post are consistent? ...

Migrating from ISAPI Rewrite to Mod_REwrite

I'm currently using ISAPI Rewrite I'd interesting in moving my ColdFusion app to Apache and would therefore like to use MOD_Rewrite. Is this possible? Or do I need to rewrite all the rewrites? ...

Apache need to bypass .PDF files in here

Ok, I'm not fluent in Apache... I have a .htaccess file setup like so: <Files *> Order Deny,Allow Deny from all Allow from localhost </Files> RemoveHandler .php .php3 .phtml .cgi .fcgi .pl .fpl .shtml The Problem is I am needing to use .pdf files to link to a URL like so within this directory: <iframe name="FRAME2" src=...

What's wrong with this MOD Rewrite Rule?

# Tags RewriteRule ^tags/(\d+)/$ /tags/view/index.cfm\?tagURL=$1 [L] the tag can be anything. What's wrong? ...

How do I get around apache owning files uploaded to a PHP webserver?

Hey all, I am working on a PHP web app on a Linux web server for grades and documents for a course that I am co-teaching. The page I am writing at the moment is for submitting assignments, where the student selects an assignment from a drop-down menu and then uploads the assignment and submits. On submit, all the information about the s...

How to use encrypted password in apache BasicDataSource?

At present i am keeping the password [ unencrypted ] in a property file. This password get placed as is in the configuration xml using ant. [ The configuration xml is for datasource, it is creating the object of dbcp.BasicDataSource ] Now, is it possible that after the ant target the password is copied in encrypted form. Heard the Ja...

Apache config: send methods other than GET, POST, HEAD to cgi?

I've tried it before and remember that apache2 did not allow to send requests with methods other than HEAD,GET,POST to cgi. Is that true or did I just not find the correct solution back then? I've found somewhere that a line like: Script PUT /cgi-bin/put.pl to access.conf could be used.. What I am trying to do is setting up simple Web...

Compiling Apache on Windows

I'd like to custom compile Apache for my Windows (Vista) machine. Do I need a special compiler for this, and how do I know if I already have a compiler (I have eclipse, but not sure if that's suitable). Also, all I can find is linux tutorials. How would one get this done on Windows? ...

Ajax page does not update consistently

I've recently started exploring using AJAX for a small project, and I've had reasonable success though it's not as smooth as I would like. The Basic setup is that an applications named ProphetX which interfaces with Excel to show stock market prices. Prices are updated as they change in Excel. Using VBA I save the data from the spreadsh...

List of useful Apache modules for PHP development

I'm rethinking which modules I need for local PHP development. Which of these modules have you found essential for you, or rarely used, or never used for PHP development. Please share your experience, or share any other that aren't on this list. a: actions_module, alias_module, asis_module, auth_basic_module, auth_digest_module, authn_...

.htaccess : languages redirection

Hi everyone, I'm trying to redirect visitors of my blog to either the french or the english version. So I made this .htaccess : <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #--------------------- # Language Redirection #--------------------- # Checking if the redirection didn't occur yet # Checking that the url doesn't begin...

AppleScript to create VirtualHost

Hi I'm trying to write an AppleScript which will add new virtualhost by name and absolute path. It works when I try on test files (txt files on desktop) but when I try real files (/private/etc/hosts and /private/etc/apache2/extras/httpd-vhosts.conf) it just does not work. The problem seems to be somewhere around user permissions, but ...

Ruby on Rails 403 Not Found

I am trying to get a simple demo of Ruby on Rails working on my local version of Apache (Mac OS X 10.6). I have a folder in the localhost linked to the public folder (/Users/david/Sites/demo/public to localhost/demo), I have permissions set to read write execute for the group and the group set to _www. I have the directory set to: <Dire...

PHP / Apache - Refreshing screen while exec'd script is running

Hello, One page on my web site is a PHP script that uses exec() to launch a separate PHP script which generates a PDF document. The PDF may take 30 seconds to generate. When I hit the refresh button during this process, I am finding inconsistent behavior. On both my Mac and Windows local dev machines, refreshing the page will hang Ap...