apache

using RewriteCond, can i change how fast content is served to users in different parts of the world?

using RewriteCond or similar mechanism on apache, can i change how fast content is served to users in different parts of the world? because it seems like this: I am hosting a site on netfirms.com, which is based in Toronto, and hosting another site on dreamhost.com, which is based in California. Both sites are almost empty. So I just...

How to turn off optimization (-02) for apache modules built with APXS

I'm trying to debug an apache module on RHEL and the optimization is getting in the way. I tried deleting the '-O2' from EXTRA_CFLAGS in apache_2.2.4/build/config_vars.mk, but it didn't help. APXS is sufficiently complex (and my perl sufficiently poor) that I'm at a loss as to how to figure out how this flag is getting set. Anybody kno...

mod_deflate on apache causing browser to do a 200 instead of 304?

I enabled mod_deflate on Apache 2 on an Ubuntu machine and noticed that my browser doesn't cache the compressed file types on page refreshes. I used firebug's net settings to check this and verified on another computer. Under mod_deflate if I compress css and js files, the browser makes a request each time. If I turn off mod_deflate, t...

Implementing Tiny MCE As Local HTML Editor

UPDATE: There are stupid questions, and this is one of them. I didn't realize that serving JavaScript via Django was so large a question. When I've answered it, I'll post the most useful resources for those who want to RTFM, unless the mods close this first. Until then, sorry for wasting your time. How do I install and configure Ti...

Does Apache Rampart work with maven?

In the project I'm working we are using maven to manage dependencies. However we are having problems with the apache rampart which is a security module to Axis2. We have tried to use the following dependencies tags: <dependency> <groupId>org.apache.rampart</groupId> <artifactId>rampart</artifactId> <version>1.3</version> <type>...

Negative Cell Value Styles in Apache POI

Using Apache POI to generate a document and i'm having a small problem with cell styles, currentlly i'm using: CellStyle currencyCellStyle=workbook.createCellStyle(); currencyCellStyle.setDataFormat(format.getFormat("$#,##0.00")); Which works totally fine for positive numbers, however I would like to assign a different style to negati...

Configure Apache to recover from mod_python errors

I am hosting a Django app on Apache using mod_python. Occasionally, I get some cryptic mod_python errors, usually of the ImportError variety, although not usually referring to the same module. The thing is, these seem to come up for a single forked subprocess, while the others operate fine, even when I force behavior that requires usin...

what's the best way to force a domain with a rails app? ex: example.com instead of www.example.com

My rails app seems to break when it answers on www.example.com, it previously was working fine with just example.com...however I've moved servers recently and would like to know the best way to redirect all www.example.com requests to go to http://example.com/.../ thanks. ...

Redirecting a Directory to a Script on Apache

So I'm playing with a script that makes it super easy to mirror images off of the web. The script works great (based off of the old imgred.com source, if you've seen that) problem is, it looks a little clunky when using it. Currently, in order to use the script, you go to a url like: http://mydomain.com/mirror/imgred.php?Image=http://o...

How do I use System.Net.WebRequest to access an .htaccess protected page?

I'm trying to figure out how to use the System.Net.WebRequest class to send my credentials when the Apache server has a .htaccess file protecting access. It appears to be something to do with the Credentials property (imagine that!) but I am not sure how to create the correct ICredentials object. Sample code = accepted answer. ...

Can I coerce Apache into not including a WWW-Authenticate header for failed HTTP Basic Auth?

I'm using HTTP Basic Authentication with AJAX requests. Firefox 3 is a whiner and always displays a dialog box for failed credentials -- even though I don't want one. This question summarizes some of the browser and JS issues; you'll notice it's unresolved on the client side. Luckily, I have at least some freedom to change the serve...

Source unavailable under an OpenSource license

I'm interested in the Google's Wave project, it is listed as Apache License 2.0 yet the source is unavailable : Quote : Welcome to the Wave Robot Java Client Library This project hosts the JAR and the JavaDoc for the Wave Robot Java Client Library. In the near future, we will also release the source code. If you r...

Is it safe to put database file in htdocs?

Gudeve, Can you recommend me a directory in my web server where I should put sensitive files? My htdocs is arranged like this: XAMPP/htdocs/NewsFeed The NewsFeed directory have index.php. The index.php file's function is to connect to a database. Now, should I put the database file inside htdocs? Will it be safe? ...

diacritics problem in project made with Zend Framework

Hi, found a interesting problem during testing our web application. I have application on localhost (Windows) and online testing server (Linux). Both are connected to same DB (on Linux server). When I tried to edit one text field through form in application located on Linux server it crop diacritics from result and save it to DB witho...

Rewrite rule not working

I've done the first steps in Zend Framework with akrabat.com/zend-framework-tutorial/. The Demo-App works fine, but the CSS. I think my rewrite rules are wrong. All hrefs looks like: /~cm/zf-tutorial/public/index.php/index/edit/id/1 /~cm/zf-tutorial/public/index.php/css/site.css The .htaccess is: RewriteEngine On RewriteCond %{REQU...

apachebench aborts with a strange error message

I run a very simple php file on apache. Then I benchmark apache, using ab -n 10000 -c 5 http://localhost/~me/hello.php?name=Niko But I get this error message, depending on c (for c=1, things are fine): apr_socket_connect(): Operation already in progress (37) I'm using ApacheBench, Version 2.3 on OSX 10.5.7. The very simple PHP f...

Apache is incorrectly converting jsp pages to "text/plain"

I've got a fairly normal setup in which Apache proxies requests to a servlet running inside Tomcat over the AJP protocol. We've run this setup on Apache 2.0.46/Tomcat 5.0.28 for ages without problems but have recently updated to Apache 2.2.3/Tomcat 5.5. The problem is that we've noticed that intermittently (maybe one time in 3) Apache...

How do I conditionally add a line to Apache .htaccess based on the domain?

My local development PC is set up to use PHP5 by default, my client's host (1and1.co.uk) is set up to use PHP4 by default. To enable PHP5 on a 1and1 account, you must add the following line to your .htaccess file: AddType x-mapp-php5 .php If I add this line to my local .htaccess file, it breaks my PHP. How do I add this line conditi...

Is it possible to use https (own-server) without paying anything?

I want to use SSL (https) to secure communication. Is it possible to do it without buying a certificate of some sort? ...

Loading a PHP app/framework into memory only once possible with FastCGI?

I was under the impression that FastCGI allowed you to kinda load in your web app once, and then you just "provide" FastCGI with some function, like myHandleHTTPRequest($url), that would then be called whenever a request came. This way you'd get much better performance as your app is ready in memory all the time, right? But I'm starting...