apache

Turning off redirect loop error in apache

I'm crawling a website using php. As I don't know much about turning php into a CGI and runing from command line the method I've chosen is, after one succesful iteration, to redirect back to the same php file so it runs again (it's not an infinite loop as I use both a cookie and a timestamp check to make sure it ends within a set time or...

Restart Apache from php on windows

I'm making a really simple virtual host administrator in my office intranet (on a windows pc) and I'm trying to restart the apache service from php when a new virtual host is created. But I can't manage to do it, I tried with apache -k restart, httpd -k restart with the system, shell_exec, exec passthru; I also tried using a batch file ...

Why doesn't my Perl script start under FastCGI?

I am getting this error in error_log one of my Perl CGI application. I am pretty sure I haven't changed my script at all and all of a sudden i have started getting this error. This is what I see in error_log: [Wed Jul 8 15:18:20 2009] [warn] FastCGI: server "/local/web/test/cgi-bin/test.pl" (pid 17033) terminated by calling exit ...

Why does my content change when running in Apache XAMPP?

Hi, I've been designing a website and when testing it I normally run it by either double clicking on the file or pressing "play" and running through a browser via Internal Server using Aptana Studio. Earlier I downloaded XAMPP and browsed the web page using Apache, and i've noticed some changes. Why would running it through Apache mak...

Calculate "Complete File Downloads" from raw access logs

Wondering if anyone can offer assistance with this. I have the raw access logs from my server. Do you know of any (low cost) tools to process this data to calculate successful requests which are the total size of the file? It would not be the entire log, just certain requests. The logs list the request size, so it can be done manually ...

apache redirect from non www to www

I have a mortgage calculator site that doesn't seem to redirect from mookal.com to www.mookal.com My apache config is as follows: RewriteEngine On ### re-direct to www RewriteCond %{http_host} !^www.mookal.com [nc] RewriteRule ^(.*)$ http://www.mookal.com/$1 [r=301,nc] what am I missing? thanks! ...

URL Rewriting Help

Thank you one and all for your patience and help. I am completely restating the question because it is getting quite long from all my revisions. I have an PHP MVC framework with 4 entry points: from the root: index.php index-ajax.php admin/index.php admin/index-ajax.php I needed a .htcaccess file that would take any request and rewrite...

F4V Player Works on Every Site But One

I almost don't even know how to begin describing this question - I am completely baffled. Basically, I have a custom-built F4V video player that grabs an F4V via an HTTP request, then plays the video with some standard AS3. Now, I have three sites on identical SliceHost slices, running the same OS, same PHP version, built on the same ...

Apache loading queue problems

Hello guys, I now have 8GB of ram in my server, so bare that in-mind when making recommendations on how much to up settings. Basically, Apache won't concurrently load more than one page at a time. What the hell could be causing this? This causes real problems when I execute a page that takes a long time to load, no other pages will loa...

Mod_rewrite rewriting things it's explicitly told not to

Hi, I have the following rewrites in my .htaccess: Options +FollowSymLinks RewriteEngine On RewriteRule \.(css|jpe?g|gif|png)$ - [L] RewriteRule ^index/error/([^/\.]+)/?$ index.php?error=$1 [L] As you can tell, it's supposed to not rewrite any .css/.jpg/.jpeg/.gif/.png files. Despite that, it's doing so. What's really odd is that ...

How to stop direct execution of a php page using htaccess rules?

In my .htaccess file I have defined the following rule to make my register page URL as http://example.com/register/ RewriteRule register/ /register.php The above rule is perfectly fine but I can access my register page from http://example.com/register/ as well as from http://example.com/register.php. I don't want that user will be ...

How do I set up RewriteRule for urls that all start with the same folder and then some but not all subfolders

I am trying to write a rule to redirect some but not all of the content of a certain folder: ^folder1/ any .html files ^folder1/blackberry ^folder1/content ^folder1/data ^folder1/images ^folder1/docs I need to use RewriteRule to send everything except ^folder1/blackberry to another site (eg, http://somedomain.com/main.html) and I'm s...

apache conf: setting .htaccess directives selectively by remote host

Hi, I have a situation where multiple hosts on the same server all point at the same physical directory using symlinks. In this directory, using .htaccess, I want to apply a certain php_flag, but only for a certain remote hostname. Here's what I've tried (doesn't work!) to give you an idea of what I'm trying to achieve: SetEnvIf Remot...

apache xampp gzip

Hi, I am trying to get the GZIP module working in XAMPP window vista 64 bit. I have added the .dll file for gzip into the module directory and added in httpconf. Once I add it say it cannot start apache since it cannot find the ApacheGZIP module in the directory that is mentioned in httpconf file...(which I can see exist in the directo...

serving xhtml + mathml to firefox and IE

Firefox requires xhtml extension for mathml but IE will not display pages with xhtml extension (it displays a download dialog box instead). I have tried apache content negotiation like so: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} .*MSIE.* RewriteRule \.xhtml$ - [T=text/html] but IE seems only to care about the extension. I ha...

htaccess rule to forward /login/ and /login to same page?

I have the following rule in my current .htaccess file to redirect /videos/login/ requests to /videos/login.php RewriteRule login/ /videos/login.php This works fine if I am access login page using http://mysite.com/videos/login/ but when I am trying to access the same page using http://mysite.com/videos/login (without ending slash) th...

502 Bad Gateway... invalid response from upstream server (apache and jboss)

I'm using apache on one machine to serve requests to jboss on another machine. Everything works fine when I startup jboss and I'm able to access the web app, but after a few hours I eventually start getting "The proxy server received an invalid response from an upstream server" errors. If I restart jboss then everything works fine agai...

mod_rewrite problem with subfolders paths

From : www.example.com/cut/456 To : www.example.com/cut/index.php?tag=456 I try this and it doesn't work RewriteEngine On RewriteRule ^([^/]*)$ /cut/index.php?tag=$1 [L] ...

How to make apache slow and unreliable?

I'm writing some code on a mobile device that uses a REST service to retrieve data from a host. That REST services is being proxied by Apache. In test mode I would like to be able to simulate network outages (as if the device has lost it's cell connection) to test the applications handling of intermittent failures. I also need to valid...

Apache: Redirect dynamic subdomains to different ip's

I have a application with dynamic subdomains that should be redirected to different servers depending on a part of the subdomain. Example (anything means whateveryouwant, a dynamic name): example.com --> server1 anything.example.com --> server1 a.example.com --> server2 b.example.com --> server1 a.anything.example.com --> server2 b.any...