apache

Apache mod_rewrite - rewriting from subdomain to main domain

Hi, I want to redirect a url abc.xyz.com/123 to xyz.com. So the file that will be accessed will be index.php of xyz.com. That index.php should have available to it both abc and 123 (so 123 will be $_SERVER['PHP_SELF'], and abc will come out of $_SERVER['HTTP_HOST']) to enable appropriate processing. abc.xyz.com already goes to xyz.com ...

How to organize a webapp?

I'm starting my first webapp, and I'm not sure how things typically are done. I'm using Django and Apache: How do you manage a source control repository? Do you check out to a separate folder, and then have a build script that copies files over? What exactly should be added to the repository? In other words, how do you make sure that y...

PHP’s open_basedir value giving a binary value in Apache logs

Reviewing logfiles to figure out why my site was down a few days ago, I found hundreds of lines like these (partially redacted with "x"): [Fri Nov 27 23:14:36 2009] [error] [client xxx.xxx.xxx.xxx] PHP Warning: require_once(): open_basedir restriction in effect. File(/var/www/xxx/xxx.php) is not within the allowed path(s): ...

Apache mod-rewrite for shorter urls

...

How to connect to machine ip address & port via grails app

I'm running MacOS 10.6 with the default settings for my machine with Internet Sharing turned on. What needs to be configured to allow access to my machine's grails/jetty instance on a specific port? I can do 'http://localhost/' as well as 'http://192.x.x.x/' but if I were to set my grails app to run on a specific port, I can't access ...

artificial slowdown

Hi everyone, I've got a flash clip that is known to behave weird if user has slow internet. Now I want to troubleshoot that. Is there a way to slowdown the load speed? Preferably with local apache or may be even with firefox only. ...

Replace a trac site with a basic redirect page

We have trac site set up to listen on /tracproj/, this swiftly passes control onto mod_python and does some python magic (I'm a php coder :-p); anyway. I have a project at /tracproj/{projectname} and I'd like to replace all requests to that url with another page that redirects them elsewhere (We're migrating one trac to anotehr bug trac...

Free, portable, all included, all in one, php Apache based server?

Free, portable, all included, all in one, (opensource is + ) php server? I have a USB FLASH 16gb card. I want to install on to it some kind of PHP server - some programm.exe which i could run on different computers without installing - call some localhost/phpserver and get my php scripts running. So where to go to get such thing? ...

Apache/Tomcat site nesting

Hello, I have two standalone sites in tomcat webapps folder $TOMCAT_HOME/siteA which is registered in DNS as siteA.example.com and $TOMCAT_HOME/siteB which is NOT registered in DNS Both sites are written in Java/Servlets. Is there a way to setup apache/tomcat/mod-rewrite to call siteB like so? siteA.example.com/siteB Does this l...

Removing a row from an Excel sheet with Apache POI HSSF

I'm using the Apache POi HSSF library to import info into my application. The problem is that the files have some extra/empty rows that need to be removed first before parsing. There's not a HSSFSheet.removeRow( int rowNum ) method. Only removeRow( HSSFRow row ). The problem with this it that empty rows can't be removed. For example: ...

mod_rewrite not using multiple rules

I'm still pretty lost with mod_rewrite as its incredibly new to me. I'm trying to set up a few rules for better urls. However, after playing around with it for awhile it appears that it only ever uses the first rule listed. For example, if i go to "/frontpage/some-post-slug" it works perfectly but if i go to "/page/some-page-slug" I get ...

mod_rewrite not working consistently

I've got a rewriting scheme going on that was working fine. Basically, anything in the url is passed as a querystring to index.php, so /dave/bob is rewritten to /index.php?page=dave/bob. I deal with the parsing of this in index.php. Here's my .htaccess: RewriteEngine on RewriteRule ^([^\.]+)?$ index.php?page=$1 [L] The problem I'm hav...

How to configure a Apache primary web server to handle the SSL connections from users (Tomcat Servlet/JSP container)

How to configure a Apache primary web server to handle the SSL connections from users (Tomcat Servlet/JSP container) ...

Questions about PHP and Java

I want to know how Java (JSP) on Tomcat compares to PHP on Apache in terms of performance. Two servers with the same hardware configurations, one running Tomcat/Java (JSP) the other Apache/PHP, both servers maxed out with how many connections they can handle at once. Would they be somewhat close or would one pull away from the other one...

mod_rewrite and hyperlinks

Hi Guys, I'm trying to get my head around mod_rewrite and friendly URLS. OK, on a very basic level I have the following rule: RewriteRule ^register$ register.php [L] This allows me to browse to www.mydomain.com/register The hyperlink within my pages shows register.php. Do I have to manually change my links to register? Esentiallly...

exclude files from rewrite rule in .htaccess

I'm modifying an existing website that uses a fairly complex .htaccess file to implement a custom MVC type framework so all urls are redirected to index.php?[some parameters] or a 404 page. I'd like to add ajax support to a limited area of the site using XAJAX, and to implement that I need to place two files in the root which are ignore...

Relative / Root paths on apache / cpanel / php shared hosting

Hi all. I am trying to deploy a php / codeigniter project to a shared hosting environment. Locally I am running MAMP and all my paths are referenced thus:- background:transparent url(/img/myimj.jpg) left top no-repeat; When I deploy the shared host, these links do not work and to resolve them I need to add "../". Changing all these r...

What is called defer-node-expansion in XML?

Hello All, What this feature "http://apache.org/xml/features/dom/defer-node-expansion" does? i have read about this feature. But was really unable to understand what will happen if this is set to false. Can anyone come up elaborately on this as i don't find any other link that explain to the ability i understand. ...

Request a resource with percent sign in path

I need to request a file www.myserver.de/file%.pdf . The file exists and requesting the renamed copy www.myserver.de/file.pdf works. Is this expected behaviour? ...

How do I stop apache2 crashing when the website gets busy?

Normally what happens is that requests seem to back up, and apache begins to consume more and more memory and CPU, until eventually it runs out of RAM and then ALL apache processes die, leaving all visitors with no website. This seems to be a common problem from people I speak to but I can't seem to find a solution! Any help much appre...