apache

Accessing Apache's Mime-Type to Extension Mapping

Does PHP expose Apache's Mime-Type to extension mapping in any way shape or form. That is, Apache typically has a list of files extensions (.gif, .pdf) that it maps to a list of Mime-Types (image/gif, application/pdf, etc.) in a file typically called mime.types. Is there anyway to get a list of these mapings for the current running apa...

Single ErrorDocument directive to catch all errors (.htaccess)

Hello. Is there something like a wildcard directive to catch all possible errors and deal with them in a single custom error page? ErrorDocument 404 /error.php?code=404 ErrorDocument 403 /error.php?code=403 ... ErrorDocument NNN /error.php?code=NNN #possible use of RegExp? I know I probably won't be dealing with a lot of custom error...

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...

Buddypress on local server install has issues

I have buddypress working nicely on a server, however I can't display the 'members' page or any individual profile page on a local webserver install I have made. If I try and visit /members/ I just get redirected back to the main buddypress page. I also just noticed online members never shows whose online and the link to the default bl...

nginx serving Django static media | 502 bad gateway

I'm trying to serve Django static media through nginx, Here's my nginx.conf server { listen 7777; listen localhost:7777; server_name example.com; location / { proxy_pass http://localhost:7777; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote...

Random blank pages on Safari when developing webapp

Hey guys, I've been experiencing a safari problem while building a web application. The screen goes completely blank (white) and refreshing won't help. Going to another page on the site gives the same problem. Then magically, after a little while, everything goes back to normal and pages are rendered correctly! This started happening ...

PHP execution timing out after update

Needed Finfo but deleted msi package, so uninstalled php 5.3.0, downloaded 5.3.2 and installed. Now all my sites have max execution time error's when they hit my custom error handlers. No problems until I updated - has anyone ran into this before? Checked all error logs and ran through config files - nothing stands out. Edit: Commente...

Building path independent mod_rewrite statements for generic .htaccess file

Say I have three small web applications stored under a shared web root: www.example.com/app1/ www.example.com/app2/ www.example.com/app3/ www.example.com/app4/ each application has a .htaccess file containing some run-off-the-mill mod_rewrite statements to rewrite urls like RewriteCond %{REQUEST_URI} ^/app1/([^/]+)/([^/]+)\.html$ Re...

How mature is apache sshd (MINA)?

Has anyone ever used apache sshd (based on Apache MINA)? I would like to get some user input. Is it mature? Does it have (annoying) bugs? How is the API? Can useful documentation/tutorials be found? etc. Thanks all for your feedback. ...

about httpd.conf

Hi I'm starting to learn symfony for php framework and I got problem with httpd.conf configuration. First, I have xampplite installed on my windows c:\xampplite\ and then I created a symfony project (as described on getting started guide) c:\xampplite\htdocs\symfonytest\ Everything works fine when I tried to access http://localhost/...

Mod Rewrite Hide Folder

I think this is a pretty simple question. How do you an apache rewrite to hide a folder. EX: www.website.com/pages/login.php to www.website.com/login.php or www.website.com/pages/home.php to www.website.com/home.php The folder needs to alway be hidden. thanks ...

Can I force Apache 2.2 connection close from inside a C module?

Hello, We'd like to have a more fine-grained control on the connections we serve in a C++ Apache 2.2 module (on CentOS 5). One of the connections needs to stay alive for a few multiple requests, so we set "KeepAlive" to "On" and set a short keep-alive period. But for every such connection we have a few more connections from the browse...

How can I limit user bandwidth usage?

Ok, I have a site, and it serves all images and mp3s through a php script and can be controlled and limited, but I am now worried about overall bandwidth of my site. For example, what if someone just sends a million requests to one of my pages? Does anyone have any suggestions into server methods used to prevent this? Should I use mod_cb...

Trying to create tiny urls, getting redirect loop.

I'm trying to create tiny urls like this: site.com/abc123 goes to: site.com/index.php?token=abc123 but I keep getting redirect loops no matter what I try, or it tries to redirect to index.php?token=index.php.. Current .htaccess is: Options +FollowSymLinks Options -MultiViews RewriteEngine On RewriteRule ^([^/]*)$ /index.php...

REMOTE_ADDR and IPv6 in PHP

Is it safe to assume that $_SERVER['REMOTE_ADDR'] always returns a IPv4 address? Thanks! ...

Redirecting http request to two different weblogic servers using the Weblogic proxy and Apache2

Hello All, I've read previous posts like "Redirecting https requests to two different weblogic servers using the Weblogic proxy and Apache2". But I have a different situation and I don't think I'm understanding this to well. I have an Apache 2 server (server1) that will receive http request for my application. Then I have two more serve...

What is an ideal instance size on ec2 servers for a busy site, as in a portal

I want to know the ideal instance site for a portal, may it be a news portal or sports portal and is there a better hosting solution than ec2 for such a site ? ...

Not able to open a file in php

The code chokes at fopen(): <?php ini_set('display_errors',1); error_reporting(E_ALL); $fp = fopen("/path/to/file/some_file.txt","a") or die("can't open file"); fwrite($fp,"some text"); fclose($fp); ?> And the resulting web page says: "Warning: fopen(/path/to/file/some_file.txt) [function.fopen]: failed to open stream: Pe...

non www .htaccess redirect - ignore other subdomains.

Hi, I have a .htaccess redirect for "non www" like this: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] it is working. But, i have also some subdomains other than www. If I call for example http://shop.example.com it redirects me to: http://www.shop.example.com I dont want t...

How can I redirect directory using htaccess including files with spaces in the names

Hi, I am dealing with a situation where someone has handed me a bunch of old files on the server which already have a lot of incoming links directly to them (mostly pdf files). I now have the files organized but in a different directory. Before it was 'domain/manuals/file' now it is 'domain/media/manual/file'. I am trying to resolve this...