apache

URL mapping in PHP?

I come from a Java background and with any servlets-based technology, it's trivial to map a range of URLs (eg /reports/, /secure/.do) to a specified servlet. Now I'm less familiar with PHP but I haven't yet seen anything that does quite the same thing with PHP (or mod_php). It's entirely possible that I'm missing something simple. How...

How do you use mod_rewrite to move a site down a sub directory?

I have a site with URLs like this: http://domain.co.uk/subdir/page.php I have redesigned the site so URLs are now like this: http://domain.co.uk/page.php How can I 301 redirect all the pages to their new locations using Apache's mod_rewrite? ...

Deny access to .svn folders on Apache

We have a rails application in subversion that we deploy with Capistrano but have noticed that we can access the files in '/.svn', which presents a security concern. I wanted to know what the best way to do this. A few ideas: Global Apache configuration to deny access Adding .htaccess files in the public folder and all subfolders C...

Long-lived connections (asynchronous server push) with Apache/PHP/Javascript?

I come from more of a Java background. In the last year or two, it's become somewhat popular to do server push over HTTP using long-lived HTTP connections in Comet. It's an extremely useful technique. So I'm curious what the equivalent is with Apache + PHP + Javascript? One option I see is just using straight AJAX calls (eg with jQue...

How to use mod_rewrite with Zend Framework?

I've just deployed a new site using Zend Framework. Due to the popularity of my tutorials I'd like to redirect any request for a tutorial to the relevant page on the new site. So far this is what I've got: URL before Rewrite: http://neranjara.org/tutorials/?tid=56 URL after Rewrite: http://neranjara.org/article/id/56 The .htaccess fil...

mod_rewrite: Check for Custom query string in URL?

I'm trying to use URL rewrite in my new project. But I also need to allow custom query sting in URL. I just want to know how to write rewrite rule for this URL http://www.mysite.com/edit/123/?q1=value1&q2=value2 to become this http://www.mysite.com/index.php?action=edit&id=123&q1=value1&q2=value2 The custom q...

Monit Daemon: Apache-Status connection failure

I'm setting up a cluster of servers for the company I work at, and I'm using Monit to monitor that all server processes are running and working as they should. For Apache monitoring, I wanna use the mod_status feature which is explained here. However, this has turned out quite difficult. As no matter how I configure both Monit and Apach...

Is it a good Idea to integrate IIS with Tomcat, or forget about it and stick to Apache HTTP with Tomcat

Do you think it is possible to achieve the same performance found in ["Apache Http"-"Tomcat"] with ["IIS"-"Tomcat"] ? Just want to know what you think about the IIS-Tomcat combo (Performance-wise) ...

What is the best folder distribution on Linux for user private folders?

In our site, users can have many private files. We are thinking what could be the best distribution so as to avoid destroying the server's performance, These files are served through Apache and should be listed each time the user needs to manage them. Our first approach right now is: var first_level = (int) $user_id/100; var files_fold...

How do I make Apache handle .pl (Perl) files, using mod_perl?

I'm using Apache 2. I know how to handle .pl files as "cgi-script", but mod_perl is supposedly way faster. I successfully built and installed mod_perl, but how do I change httpd.conf so that .pl files will be handled by mod_perl (and not as cgi-script)? ...

Protecting your images, CSS and Javascript files from being used by external sites with Apache?

I came across a site that demonstrated a Javascript library and it asked that you please not link to the Javascript file directly from your site. That's a reasonable request. In fact, it wouldn't have occurred to me to do that instead of hosting it myself but I guess will try and save on bandwidth any way they can. This got me thinkin...

mod_rewrite with spaces in the urls

I need to set up some RewriteRules to redirect a URL which has a space in it. I've tried this: RewriteRule ^article/with%20spaces.html$ /article/without_spaces.html [R=301,L] ... but it doesn't work. Putting in a space instead of %20 causes a 500 Internal Server Error. How do I add a space? ...

URL Rewrite with two distinct blanket redirects (one for WordPress permalinks)

I have a relatively complex .htaccess file to control page requests, this currently redirects all requests of files (with some type exclusions) to an index file, with an exception of one directory that includes a WordPress installation. I now need to enable the WordPress PermaLink support but I'm having some difficulty modifying the .ht...

Django file upload failing occasionally

Hi all, I am trying to port my first Django 1.0.2 application to run on OSX/Leopard with Apache + mod_python 3.3.1 + python 2.6.1 (all running in 64-bit mode) and I am experiencing an occasional error when uploading a file that was not present when testing with the Django development server. The code for the upload is similar to what ...

How to config Tomcat to serve images from an external folder outside webapps?

How can i use Tomcat to serve image files from a public folder outside webapps? I dont want to use a 2nd Apache fileserver on a different port since the image files are part of the same app. And i dont want to create a symlink to the public folder inside webapps since my app is deployed as a war file....Is there a simpler solution simila...

Why does the CakePHP Authorization Componentent automatically logout when openeing two sites in parallel?

Hi, i have a problem within my CakePHP application: I use the Authorization Component for the login/logout mechanisms. Unfortunately users are logged out automatically when they try to open two or more php pages at the same moment. Thats happening very often because we tend to use the middle mouse button to open many tabs in short inter...

Using Alias in Apache ONLY if local directory not present?

Hey all, We're running a reseller web host, and aliasing a particular directory for ALL the sites within. This is all happening through WHM/Cpanel, which could possibly complicate my question. We want all hosts to run their "/concrete" directory through a shared location on the server. This is working fine by adding "Alias /concrete/...

relocate apache's configuration files

Hi, is there a chance to use different location for apache's config files (on Windows)? Other than having to compile it myself and setting the proper #define HTTPD_ROOT value. Thx rezna ...

Apache unresponsive on Vista

I had been running Apache on Vista for around a year, but recently upgraded my workstation. I did a clean install of Vista Ultimate and installed the latest version of the Apache server for win32 (2.2.11, no SSL). The service runs fine and there were no errors reported during the install, nor are there any errors in the Apache logs. Howe...

SSO-plus-SSL and Shibboleth: What options for sites with numerous virtual hosts?

Background: Customer X is a low-budget non-profit outfit that nonetheless has a lot of activity configured on virtual hosts, and the virtual hosts multiply very frequently. Customer X also has a lot of users and is interested in getting them over to a single sign on solution. This way, all the users can use the same credentials on all th...