apache

RewriteCond backreference not working

If I go to http://www.example.com I want it to stay there, which is working fine. If I go to http://bar.example.com it redirects to http://www..com, which is wrong I want it to go to http://www.example.com given the backreference in the RewriteCond RewriteEngine On RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} !^www.(exa...

.htaccess same url with or without /

Howdy Guys, I am doing a painful rewrite of many urls on a website I am currently working on, but I have noticed a small problem: RewriteRule ^domains/transfer$ ./cart.php?gid=11 [L,NC] This line with navigate if I go to: http://my-site/domains/transfer But it won't work with a trailing /: http://my-site/domains/transfer/ Is the...

apache HTMLUNIT..... PROBLEM in handling javascript

I want to login to a website (http://www.orkut.com) through com.gargoylesoftware.htmlunit.WebClient But when I click on the "Submit" button, it doesn't take me to the expected page that should come after login. Instead it returns the same login page again. In clear sense, there is some problem in login. When I try the same code with ...

Web page finished loading before all images are completed

Hi, After the release of the new web site I've developed I have a strange case with the images on the site. It seems like the page is finished loading before all images are completed. The images is located on another server using samba to share the images. Could this connection be to slow? On my development server this worked out all...

Cancelling an HTTP authentication login?

Im working on a site that uses an old school http authentication log in. The problem is if someone reached the log in prompt by mistake and presses the cancel button the log in box disappears and then reappears a total of 3 times before sending the user off to an ugly "authentication required" page. Does anyone know how to tweak the lo...

PHP CLI vs PHP WEB

Hiya All, I am currently running a script that i've created in PHP that parses and sorts out 6 different xml files of around 40mb each. I currently run the script through a browser, and a cron job to wget the page. But sometimes with the server load it can clog up apache and and the rest of the server, Would it make sense to convert...

PHP URL Rewriting

Hi, I am setting up some rewrite rules on an Apache server using mod_rewrite. I was wondering if it was possible to write a rule that will basically re-direct the user to the home page if the page is not found i.e. http://example.com/test <-- does not exist However, I would like if the user was to navigate to this domain they are au...

Weird behaviour with two Trac instances under Apache + mod_wsgi

I am trying to configure two Trac instances in order to access them via browser each one with a different url: http://trac.domain.com/trac1 http://trac.domain.com/trac2 First time I access them Apache response is fine, I get the first Trac with /trac1, then the second one in /trac2. But when I access /trac1 again, it keeps giving me t...

PHP + gzip: close connection and continue executing

I am responsible for the backend portion of an API, written in PHP, which is primarily used by a Flash client. What happens right now is: the Flash client makes a call, the backend loads the necessary data, does any necessary processing and post processing, logging and caching and then returns the result to the client. What I would like...

PHP file not found for require_once, others are in same directory

Hi all I'm working on a site here where I include parts of the site that are called in multiple locations in it's own sub directory. I created a file in said directory and tried to include it in a file, but for some reason tis' not working. Here's the code that is within that file. <?php require_once("a_file.php"); //this file loads r...

force download script

I worked on a nice "force download file" script which purpose is to make sure files are being offered to download instead of displayed in the browser, no matter what type of file that is. It used to work well but recently i received feedback that it wouldn't work, notably for pdf and xls files (MS Excel). The file is either detected as ...

Why does my mod_perl script freeze my server?

Hi! I cannot make my Perl script run stable on the server. Here is the problem. When the script is accessed more than 5 times a second, the server freezes. And some time later the server hangs forever. SSH does not respond and I have to restart the server. I'm using Apache with mod_perl. The script is hosted on Virtual Dedicated Serv...

Apache -> MySQL multiple connections vs one connection

I've been thinking, why does Apache start a new connection to the MySQL server for each page request? Why doesn't it just keep ONE connection open at all times and send all sql queries through that one connection (obviously with client id attached to each req)? It cuts down on the handshake time overhead, and a couple of other advantag...

JSON object max size?

Using jquery, I'm able to send json objects from client to server using ajax like this: var strJSON = '{"event":[{ "dates":[ "2009-10-14","2009-10-15"], "teams":[ {"id":"0","country":"USA","state":"CA","name":"California Polytechnic State University","subteam":""}, {"id":"1","country":"USA","state":"CA","n...

throttle connections to apache load balancer

I have a load balancer using apache: http://httpd.apache.org/docs/2.2/mod/mod%5Fproxy%5Fbalancer.html The problem is our bandwidth. We're trying to get more, but the ISP has to run new lines and keeps putting us off, so I'd like to throttle down the spiders to conserve bandwidth until we can get more. I tried mod cband, but it won't w...

How do I search set of keywords from keywords field in Solr?

So I have a keyword field with this schema Indexed, Tokenized, Multivalued, TermVector Stored, Omit Norms then I wanna search set of keywords against it like q=keyword:keyword1, keyword2, keyword3, etc, etc and want to return most matching keywords, even 1 match keyword is fine, but ordered by most match. thank you ...

ASP.NET 2.0 Application with a Sqlite Backend on Mono

Hello: I have an extensive ASP.NET Sqlite driven application that will run through Apache with the help of Mono. For testing purposes, I created an application that has two textboxes and a button. When the textboxes are filled with text and the button is executed, a Sqlite table will receive the text within the textboxes. This test a...

When to use Mongrel as web server for Rails application?

When I started my first bigger Rails application, I chose to use Apache (with Passenger), because I already had some experience with it with PHP, but I don't have any deep knowledge of deploying Rails applications. How would one choose web server for a Rails app? Are there any main differences between Apache and Mongrel? Or is it just ...

How to check the cause for a HTTP request latency/waiting time?

I issue a simple GET request to my server, and it's coming back after ~1.2 seconds on average (using firebug NET tab, the "waiting for reqponse" part- not even the whole reponse time) My ping to the server is 0.250 Using Passenger with rails 2.3.3, in the rails log the request is taking ~0.023 My server is on GoDaddy, so I checked the...

increasing ServerLimit & MaxClients on Apache

This has happened to me in the past and I somehow fixed it now I cant remember... After increasing MaxClients and ServerLimit and restarting apache, it still doesn't let new connections to come in... KeepAlive Off ServerLimit 1000 MinSpareServers 20 MaxSpareServers 50 StartServers 50 MaxClients 900 ...