apache

Problem with internal anchors and links

I've set up a brochure ware kind of site - with links to different sections in the page. http://www.leoniepalmer.com/ When clicking a menu item in the top right corner, everything works great! Now I have a second page at http://www.leoniepalmer.com/our-gourmet-tours/ And I want the menu to then go back home to the relevant anchor, ...

Do ping requests put a load on a server?

I have a lot of clients (around 4000). Each client pings my server every 2 seconds. Can these ping requests put a load on the server and slow it down? How can I monitor this load? Now the server response slowly but the processor is almost idle and the free memory is ok. I'm running Apache on Ubuntu. ...

Avoiding sub-directory request rewrites with Apache mod_rewrite

I want to a rewrite rule such that if a user goes to the URL example.org/stuff/junk.jpg the rule will process and end up at re-writer.php but if the user goes to example.org/stuff/hackingisawesome/junk.jpg the rule will not be triggered and they will get a standard 404 (or a page, if one should exist). I can't tell, based on the environ...

How can I defer processing during apache / mod_perl page rendering?

I have an apache2 / mod_perl website. On one page, I need to do some server/server communication via SOAP. The results of this communication are not required for the rendering of the page (but user input is required to trigger this communication). The SOAP communication is very slow. So what I want to do is process and print the page ...

.htaccess : allow download of Mercurial archive but only that

Hello, I was fairly happy with my Mercurial setup until now. I use it for personal projects and it is hosted on a shared server at OVH (a French hosting provider). Currently, I have a .htaccess to protect my projects and only allow certain people to pull/push from my repositories. However, I would like to make the changesets archives p...

Programmable transparent forward proxy

I'm looking for a way to script a transparent forward proxy such as the ones that users point their browsers to in proxy settings. I've discovered a distinct tradeoff in forward proxies between scriptability and robustness. For example, their are countless proxies developed in Ruby and Python that allow you to inspect each request resp...

Internal Apache request to PHP script overhead

I have a PHP page that gets its content by making an HTTP request to another site on the same server, using file_get_contents. Both sites run in Apache 2 which calls PHP using suPHP (which is FastCGI, right?) How significant is the overhead of this call? Does Apache do a lot of processing before sending a request to PHP? An alternative...

Controller pages inaccessible in new RoR project...why?

I set up a new RoR project on MAC OS Leopard, created a repository, svn added the whole Rails project, committed, checked out at my site, set up a vhost (see below), and I cannot get to a new controller page I created (/mycontroller/index). I CAN get to the "Welcome Aboard" page. I have another Ruby install (Redmine project management so...

.htaccess rewritting subdomain + folder to uri

Hi, I want to redirect this: subdom.mydom.com/mydoc TO mydom.com/subdom/mydoc.php Sorry for being too obvious. I know the htaccess rewritting basis but this is making me a little crazy :) ...

.htaccess map a /images to images.blabla.com which is on another host

It is possible to do that, invisible to the users (without redirect) ? I want to save the bandwidth ...

mod_rewrite causes loss of stylesheet

Hi there! I'm using mod_rewrite to clean up some of my URL's (duh) and I got it working. Sorta. It redirects to the correct page, but the stylesheet doesn't show up. Here's my code in .htaccess: RewriteEngine on RewriteRule ^blog/([^/\.]+)/?$ post.php?page=$1 [L] So what's going on? This is my first time working with mod_rewrite, by t...

Python Service File Caching Apache Race Condition

I am writing a python service (pyamf) through which a user can access images. All images are stored on a central server. The python services will be running on satellite machines which have network access to server. The service should work as follows: check locally to see if the file exists, if so, use it. check locally to see if fil...

How many files do search engines index per directory

I'm using Apache Mod RewriteRule to deal with dynamic URLs. And trying to figure out the best URL structure to go with. Here are the options I am thinking about: They will all rewrite to: mydomain.com/myprogram.php?username=$1&cat=$2&item=$3 Option 1: mydomain.com/username-category-item-5.html Option 2: mydomain.com/username/categor...

PHP JPEG headers to stop image from downloading

I am currently using the script below to output the contents of a JPEG straight from a file. The reason I'm doing so is because I'm using mod_rewrite/php to mask the name of the original file. This is working partially as expected, except that Safari insists on downloading the photo instead of just allowing me to see it in the browser. A...

How can I rewrite urls into pretty urls using mod_rewrite and php?

Hello, First off I wanna apologize for my ignorance but mod_rewrite and regex seems just a bit complicated for me and I need this done fairly quickly. Basically what I'm trying to accomplish is the followings: Get rid of the .php extensions and get rid of the index.php - Basically when a user enters http://www.example.com/index.html ...

Apache 2 Sites-Available Configuration

Hello, I am trying to write about 5 websites all on one Apache server which is all on one IP address. For example: /var/www/site1 /var/www/site2 /var/www/site3 /var/www/site4 /var/www/site5 However, if I create a link on site 2 just using, for example. /index.php, you would expect it to look in /var/www/site2/index.php... but it a...

PHP parsing error in Drupal-based website

I am working on a Drupal-based website that works fine on the remote server (LAMP stack) as well as all other developer's systems (WAMP stack). But when I try to run it, the PHP code is spit out in the browser along with the HTML instead of being parsed like it should. There's very little information that I can glean from error logs. PH...

mod_wsgi on Snow Leopard python version mismatch

Hello, I'm trying to run mod_wsgi 3.1 under Apache 2.2.14 using a non-default python installation on Mac OS X 10.6. After downloading the mod_wsgi source I run: sudo apachectl -k stop then ./configure --with-python=/usr/local/Cellar/python/2.6.4/bin/python make sudo make install I then start up apache again sudo apachectl -k sta...

Apache returns truncated image (cross posted on serverfault.com)

I am bringing up an image directly through firefox (no PHP or other scripting code) and it appears that Apache is returning either a truncated image or a corrupted image. I get the top 5-10% of the image. It appears that I get complete width and height info. If I hit "refresh" (in firefox) I get about 5 more lines of the image. And if ...

Read If-Modified-Since header in PHP CGI

My PHP script depends on being able to read the value of the If-Modified-Since header (yes, I know how to do this). It worked correctly when I used PHP as mod_php, but now that I've switched to suPHP (CGI), it appears Apache itself handles requests that contain this header, without forwarding them to PHP at all. This is silly, because...