apache

How to use apache's mod_rewrite rewriterule without changing relative paths

I've the following rewrite rule in .htaccess: RewriteRule ^groups/([^/\.]+)/?$ groupdetail.php?gname=$1 [L,NC] This takes something like www.example.com/groups/groupname and calls www.example/groupdetail.php?gname=groupname. And it works just fine. But all the relative links on groupdetail.php use groups/ as the relative path, and ...

192.168.0.71... What is this special address used for?

I have some accesses from 192.168.0.71 on my apache logs. I looked up this IP (because my server almost exclusively takes requests from 127.0.0.1, and I saw that it's reserved for "special purposes." What types of purposes might those be? Edit: I didn't tell you, typing 192.168.0.71 brings me straight to my site, just as 127.0.0.1 ...

Best way to sandbox Apache on Linux

I have Apache running on a public-facing Debian server, and am a bit worried about the security of the installation. This is a machine that hosts several free-time hobby projects, so none of us who use the machine really have the time to constantly watch for upstream patches, stay aware of security issues, etc. But I would like to keep t...

Setting PHP variables in httpd.conf?

Hi, I'd like to automatically change my database connection settings on a per-vhost basis, so that I don't have to edit any PHP code as it moves from staging to live and yet access different databases. This is on a single dedicated server. So I was wondering, can I set a PHP variable or constant in httpd.conf as part of the vhost defi...

Top & httpd - demystifying what is actually running

I often use the "top" command to see what is taking up resources. Mostly it comes up with a long list of Apache httpd processes, which is not very useful. Is there any way to see a similar list, but such that I could see which PHP scripts etc. those httpd processes are actually running? ...

How do I configure Apache 2.2 for Ruby on Rails in Windows?

I'm trying to get started writing some Ruby on Rails apps and have been successful with Mongrel but, I'd like to deploy my apps to my Apache 2.2 instance on Windows? All the tutorials I've found seem out of date and are for older versions of Apache/Rails. Does anyone know of a good, current tutorial for configuring Apache 2.2 for Ruby ...

How do I password protect IIS in a method analogous to Apache's AuthType / AuthUserFile mechanism?

I'm used to doing basic password protection for Apache w/ the following method in Apache config files: AuthType Basic AuthName "By Invitation Only" AuthUserFile /path/to/.htpasswd Require valid-user However, I've been asked to put some protection on a subdirectory of a site running ColdFusion on top of IIS6, and I'm unfamil...

Apache/php guru needed! htaccess files, php, includes directories, and windows XAMPP configuration nightmare!

XAMPP makes configuring a local LAMP stack for windows a breeze. So it's quite disappointing that enabling htaccess files is such a nightmare. My problem: I've got a PHP application that requires apache/php to search for an /includes/ directory contained within the application. To do this, htaccess files must be allowed in apache and ...

How can I read MS Office files in a server without installing MS Office and without using Interop Library?

Interop library are slow, and need MS Office installed. Many times you don't want to install office on servers. I'd like to use Apache POI, but I'm on .NET. I need only to extract the text portion of the files, not creating nor "storing information" in office files. I need to tell you that I've got a very large document library, and ...

Mask redirect to temporary domain with mod_rewrite

We are putting up a company blog at companyname.com/blog but for now the blog is a Wordpress installation that lives on a different server (blog.companyname.com). The intention is to have the blog and web site both on the same server in a month or two, but that leaves a problem in the interim. At the moment I am using mod_rewrite to d...

What is the best XSLT engine for Perl?

I would like to know what of the many XSLT engines out there works well with Perl. I will use Apache (2.0) and Perl, and I want to obtain PDFs and XHTMLs. I'm new to this kind of projects so any comment or suggestion will be welcome. Thanks. Doing a simple search on Google I found a lot and I suppose that there are to many more. ...

How would I go about creating a mod_rewrite that redirects to launch.php?i=/the/url/that/they/want?

So if the user types mydomain.com/dashboard, the document the server actually sends them is /launch.php?i=/dashboard. The one caveat is that I would like to leave requests for /flags /people /posters /css /icons /images /libraries /patterns alone, and they should request the actual folder. How would I create such a mod_rewrite? ...

What happens first? .htaccess or php code?

If I use mod_rewrite to control all my 301 redirects, does this happen before my page is served? so if I also have a bunch of redirect rules in a php script that runs on my page, will the .htaccess kick in first? ...

mod_rewrite for trailing slash problem

I'm pulling my hair out on what should be an insanely simple problem. We are running WebSphere IHS (Apache) through an F5 BigIP. BigIP is doing the https translation for us. Our url (changed for web, not valid) is https://superniftyserver.com/lawson/portal. When someone types in just that without the slash after portal, Apache assume...

How do I create a custom directive for Apache Velocity

I am using Apache's Velocity templating engine, and I would like to create a custom Directive. That is, I want to be able to write "#doMyThing()" and have it invoke some java code I wrote in order to generate the text. I know that I can register a custom directive by adding a line userdirective=my.package.here.MyDirectiveName to my v...

How can I parse Apache's error log in PHP?

I want to create a script that parses or makes sense of apache's error log to see what the most recent error was. I was wondering if anyone out there has something that does this or has any ideas where to start? ...

Apache mod_rewrite to catch XML requests

How do I create a apache RewriteRule that catches any request URL ending in .xml, strips off the .xml and passes it to a specific script? http://www.example.com/document.xml, becomes http://www.example.com/document passed to script.php ...

Why is Apache + Rails is spitting out two status headers for code 500?

I have a rails app that is working fine except for one thing. When I request something that doesn't exist (i.e. /not_a_controller_or_file.txt) and rails throws a "No Route matches..." exception, the response is this (blank line intentional): HTTP/1.1 200 OK Date: Thu, 02 Oct 2008 10:28:02 GMT Content-Type: text/html Content-Length: 122...

Is there any way to determine the amount of time a client spends on a web page

Assuming I have an open source web server or proxy I can enhance, let's say apache or squid. Is there a way to determine the time each client spends on a web page? HTTP is of course stateless, so it's not trivial, but maybe someone has an idea on how to approach this problem? Thanks. ...

How do I ignore a directory in mod_rewrite?

I'm trying to have the modrewrite rules skip the directory vip. I've tried a number of things as you can see below, but to no avail. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #RewriteRule ^vip$ - [PT] RewriteRule ^vip/.$ - [PT] #RewriteCond %{REQUEST_URI} !/vip RewriteCond %{REQUEST_FILENAME} !-f Rewrit...