apache

FTP Upload Problem - 0 bytes transfered

Hi, In one of our project we are using Apache's FTP client APIs. I have to upload xml file to a FTP server, where a process will keep polling that server directory. So using the upload API, I am uploading the xml file with .TRANSFER extension, and after successfully uploading full file, the file will be renamed to .xml file. The wei...

Can I pass matched variables to the new URL with mod_rewrite?

I'm quite experienced in PHP but I don't quite use mod_rewrite (although I should). All I want to ask is if it's possible to pass many variables through a single rewrite rule. For example, is it possible to rewrite this: localhost/test.php?id=1&name=test&var1=3 into this: localhost/mysupertest/ and also use the same rewrite rule f...

HTTPS on Apache; Will it slow Apache?

Our company runs a website which currently supports only http traffic. We plan to support https traffic too as some of the customers who link to our pages want us to support https traffic. Our website gets moderate amount of traffic, but is expected to increase over time. So my question is this: Is it a good idea to make our website ...

Push email to a apache/php server

We've built a web service that needs to check constantly for email messages. Basically, an user sends us an email, and the server should make actions based on that email. We could use a crontab PHP script that checks for new messages every minute, with POP. But that's kind of offensive to the popserver and not very efficient (1min is too...

Python + CGI script cannot access environment variables

I'm coding a webservice on python that uses an Oracle database. I have cx_Oracle installed and working but I'm having some problems when I run my python code as CGI using Apache. For example the following code works perfectly at the command line: #!/usr/bin/python import os import cx_Oracle import defs as df os.putenv('ORACLE_HOME...

Settings for uploading large files (video/mp4)?

Background: I'm planning on using the JW FLV Media Player for streaming some videos: http://www.longtailvideo.com/players/jw-flv-player/ Question: What settings, both PHP globals and php.ini, would I need to change in order to handle the uploading of large video files? Sub-question: Is there anyway, through maybe the .htaccess file, th...

How to count number of different IPs that have accessed certain URL from Apache accesss log?

I'm doing something like zgrep "somepattern" access_log.X.gz But I find that a lot of the entries are from the same IP and I'd like to count them as one. ...

Problem with Numeric/String using Apache POI...

Hi! I have excel file with such contents: A1: SomeString A2: 2 All fields are set to String format. When I read file in java using poi it tells that B1 is numeric cell format. The problem is that the value in A1 can be 2 or 2.0 so I can't just use .toString(). Can anyone help please? ...

mod_rewrite based on ip

Hi, I'd like to implement mod_rewrite to put my site into maintance. Basically all ips except a handful we specify would be forwarded to a static html page. Please can someone help with this rule. Also is there a way to turn this on and off easily without editting the htaccess file? Thanks, Josh ...

Apache rewrite engine, get subdomain and path after it

I have the basic code to rewrite a subdomain to another page. But how do I use this to get the path of the directory specified within it and pass it to my script as well as the subdomain itself? Current code RewriteCond %{HTTP_HOST} ^([^.]+)(\.example\.com)$ RewriteRule ^$ handle.php [L] I'd like to provide handle.php with the file p...

get name of current PHP script in include file

I have files served like so: AJAX request handler -> Include file I would like to retrieve the name of the include file within the include itself. Neither $_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] is suitable for this, as they return the "parent" script name. Thanks. ...

Hide directories from listing, but don't disable directory listings.

For example I want to hide the directory foo in the root of the public directory. I want to show the contents of the directory, but I don't want foo to be in there. Thanks. ...

Internet Explorer 8 + Deflate

I have a very weird problem.. I really do hope someone has an answer because I wouldn't know where else to ask. I am writing a cgi application in C++ which is executed by Apache and outputs HTML code. I am compressing the HTML output myself - from within my C++ application - since my web host doesn't support mod_deflate for some reason....

hosts file and multiple sub-domains

For local testing (and learning), I wish to use x.com host name instead of localhost. I changed my Windows XP host file to this - 127.0.0.1 x.com Now http://x.com/ works beautifully but http://www.x.com doesn't. :( What changes should I make so that www.x.com, sub1.x.com, sub2.x.com etc.. all work on local. WordpressMU will let...

Can I re-write my URLs like this and is it a good idea?

Hello all, Is it possible to re-write (Apache Mod-Rewrite) a URL from this: http://www.example.com/view.php?t=h5k6 to this http://www.example.com/h5k6 The reason for this re-write is that the URL needs to be very short (a bit like a tiny URL service). Would that new URL still hit my view.php page? Would it be able to still make use o...

apache to tomcat: mod_jk vs mod_proxy

What are the advantages and disadvantages of using *mod_jk* and *mod_proxy* for fronting a tomcat instance with apache? I've been using mod_jk in production for years but I've heard that it's "the old way" of fronting tomcat. Should I consider changing? Would there be the benefits? thanks ...

Apache: VirtualHost with [PHP|Python|Ruby] support

Hi there, I am experimenting with several languages (Python, Ruby...), and I would like to know if there is a way to optimize my Apache Server to load certain modules only in certain VirtualHost, for instance: http://myapp1 <- just with Ruby support http://myapp2 <- just with Python support http://myapp3 <- just with Php support ... ...

How can I use mod_rewrite to 301 redirect example.com to www.example.com?

I need to redirect any URLs without "www." to URLs with "www." for better search engine optimization. I read that this is possible with mod_rewrite and .htaccess files, but I do not know the right code to use. Can anyone help? ...

Apache Tomcat executing a Java class

Hi, I've coded some algorithms in java and I need to include those algorithm in my web application. I'm using Apache Tomcat and what I need to do is that when, for example, I click on the start button on my web page a java class should be executed. I think this done by using servlets, am I right? If so, do you know where I can find some...

Mod Rewrite Easy problem with Cookies

I'm trying to catch all the non-logged-in users who are trying to get to a directory (where my .htaccess is placed). If someone is not logged-in and try to access some page in this directory, it will be redirected to page "user/?login=222" A user is logged-in, when the Cookie "HDV-UL" starts with a 5 digit number. This is my .htaccess: ...