apache

How do I throttle my site's API users?

The legitimate users of my site occasionally hammer the server with API requests that cause undesirable results. I want to institute a limit of no more than say one API call every 5 seconds or n calls per minute (haven't figured out the exact limit yet). I could obviously log every API call in a DB and do the calculation on every request...

.htaccess subdomain.(.*) go to url

i have a problem, i dont know how i can make this code to work. i need to know all subdomains ( scadmin.* ) its go to folder /admin/theme/(domain whitout subdomain)/ sombardy know what i can doe here? tanks a lot for all respons ...

Fails to load remote files from web, but not CLI

I can load a remote file (http) from the php CLI: php > print_r(getimagesize("http://www.google.ca/intl/en_ca/images/logo.gif")); Array ( [0] => 276 [1] => 110 [2] => 1 [3] => width="276" height="110" [bits] => 8 [channels] => 3 [mime] => image/gif ) However, the exact same code from a web script gives ...

How to use Wine from Apache/Php? - '/var/www' is not owned by you...

Hi! I need to run a windows command line tool from a php script on my Debian server. For that, I'm trying Wine. Invoking wine and the tool via terminal works fine: "$ wine tool.exe" But when running the same from my php script... exec("wine tool.exe"); ...I get the following in my Apache error log: wine: '/var/www' is not owned by yo...

SVN 1.6.1 Apache 2.2.11 Basic Authentication with SSL

Hi, I have set up an Apache2.2.11 server on a WinXP machine along with Subversion 1.6.1 and SVNService 0.52. I created a Windows directory C:\Repositories\ inside that directory I put my projects svnadmin create C:/Repositories/project1 svnadmin create C:/Repositories/project2 I created a password file using apache's htpasswd and pu...

How to get the HTTP_HOST from Rails?

I need to set some server specific variables in a rails application that will run on at least two different servers. What is the best way to get the request's HTTP_HOST value in order to know what is the current server and set these variables accordingly? I'm using Apache 2 with Passenger. ...

Can I setup a WAMP Virtual Machine on my guest OS that uses files from my Windows host?

I'm on a desktop PC, so I dont need Apache, MYSQL, PHP to run all the time on my main PC. Also I have all the good tools (adobe cs4, etc) on my XP box and they wont run on my Win2000 VM Guest, plus they would require another license even if they did. I'm not sure if its worth the trouble but figured I'd ask before I try to figure out how...

Massive URL Change

We need to make changes to an app that will cause all its URLS to change, we dont want to lose value and too many urls to 301. I am looking to change a mod rewritten URL to a non written one. My thoughts would be to Leave the mod rewritten URLS active (Temporarily) Place a canonical tag witht the NEW correct URL Make sure no links are ...

Managing ajax Couchdb calls and IE's (hta) agressive cache.

Hello all, I'm having a quite annoying problem, and came up with a quite ugly hack to make it work. I develop an Hta application using a CouchDB database (for internal company use). The problem is there seems to be some very aggressive caching of the database queries, and it's been hard to come up with solutions. So the updated data i...

mod_rewrite redirect to URL with propietary protocol

I'm using Apache 2.2 with mod_rewrite. Is there a way to force mod_rewrite to rewrite the entire URL, including protocol? I know it will automatically rewrite the whole URL if the redirect contains http:// at the beginning but I'm trying to redirect to a URL that uses a proprietary protocol: fcp:// When I add it in as the redirect it j...

Parse file upload directly without writing to the file system

With Apache/PHP5, is it possible to get the contents of an uploaded file directly without having it written to the file system? Not much on Google about this, but it appears that files are always written to a temporary directory once they are uploaded. ...

Will mod_gzip compress the cookies

I have a php web application that uses big cookies to store a lot of users data. If I set mod_gzip on the apache server, will it compress only the page content or will it compress the cookies also? ...

URL Shortening Site

I am working on a URL shortening site which uses PHP, MySQL and Apache. General idea of URL shortening as I look at open source projects: user gives a URL link and the system gets ID for that link from database. Then convert the ID X base system (I am using base 36). Then use Apache mod_rewrite and create shortened URL and then redirect....

.htaccess, mod_rewrite and subdirectories

Concerning the .htaccess documenation, putting a .htaccess file in a directory should affect this directory and all subdirectories. But I have problems getting this to work: I have to files, alice.html and bob.html (just printing "Alice" and "Bob"), and this .htaccess in the same directory (/tmp/rewrite): RewriteEngine on RewriteBase /...

Add Preprocessor to HTML (Probably in Apache)

I would like to add a preprocessor to HTML pages. Basically, I have a program that takes the name of an HTML file containing preprocessor instructions and outputs the contents of the file after preprocessing to stdout. This mechanism could change if it makes things easier. All I want to do is hook this into Apache so that all the file...

Increase PHP Memory limit (Apache, Drupal6)

I'm trying to run a Drupal installation on a shared hosting server. (I'm just subscribing to a provider - I don't own the box.) I need to increase the PHP memory limit for my Apache server. I have tried ini_set('memory_limit', '64M'); in settings.php (a file that is included in every request), but this causes Internal Server Error 50...

installing additional apache modules

Hi I need to enable additional modules for apache eg, mod_proxy, mod_proxy-html, and mod_proxy_balancer. Is there a way for me to do that without recompiling the whole apache? Thanks ...

how to add additional module with easyapache

i'd like to install the mod_proxy_balancer module for apache via easyapache (whm's) UI. Can someone point me to the right direction to do this please? Thanks ...

ModRewrite Split Issue

This is a complicated one which I hope has a simple answer... RewriteRule ^category/([^.]+)/([0-9]+)/([^.]+)/([0-9]+) category.php?c_id=$2&filters=$3&_p=$4&name=$1 This rule would pick up category/kitchen/10/0-0-0-0-0-0-0-0/1 with the following get vals: category.php?c_id=10&filters=0-0-0-0-0-0-0-0&_p=1&name=kitchen The reason fil...

Apache CGI redirect to absolute URI doesn't work

I have Apache 2.2.13 running in console mode on Windows. I have made an executable that handles requests. In a certain case, when it detects a URL pointing to a directory but has not trailing slash, it tries to redirect to the same URL with the missing slash appended. The exit-code is set to 301. Strangely enough, having this in the resp...