apache

[Solved] Server-side, get progress on sending file

Hello fellow programmers. Basically, what I want to do is to check how much of a file my webserver has sent to a client, when the client is downloading one. Is this even possible? Does apache provide any module/extension that would help me accomplish my task? I use a linux distro, apache2 and php5. Regards. ...

What should I use .htaccess for in Zend Framework 1.9.5 application?

I've written several Web MVC apps but never before in PHP, and I'm trying to figure out the best way to work with Zend Framework v1.9.5. I'm confused about the role of .htaccess in a Zend Framework 1.9.5 application. I have consulted many tutorials, books, and SO questions on Zend Framework (but most of them are for v1.8 at newest) and ...

Rewrite rule not working

I want to write a rule that redirects all URLs of a certain pattern to a PHP file. Exception: the control/ directory where the CMS resides. Why does RewriteCond %{REQUEST_URI} ^/([^control]+)/([^/]+)$ RewriteRule .* /pages/index.php?language=%1&page=%2&%{QUERY_STRING} [L] not work for domain.com/deutsch/start (it throws a 404...

How do I convince mod_proxy_ajp to pass environment variables to its backend?

I'm trying to use Apache's mod_proxy with the AJP backend and an ajp-wsgi app server but it doesn't seem to be sending SetEnv variables to the application server. Configuration snippet: <Location /script> ProxyPass ajp://localhost:8009/script SetEnv FOO "barbobot" </Location> How do I pass environment variables from the Apach...

PHP Max Execution Time: Incorrect Reporting?

Hello all, Is there any reason for a PHP script to return a fatal error of: Fatal error: Maximum execution time of 60 seconds exceeded in H:\xampplite\htdocs\mlm\tera.php on line 1 When my PHP ini is set to "300000" and further more I set set_time_limit(300000); in the script itself. Safemode is off. In addition, Apache's timeout ha...

Apache/PHP experts? Large file download fails: empty file is saved with zero KB

I have a web page that I use to give authenticated users access to download files. The files are in the root folder (not normally HTTP accessible), and I use a PHP script and the fopen function to generate the web page that starts the download of the files. It works perfectly for three of the files (all of which are under 200KB), but the...

Disable https on localhost

I need to automatically redirect any https:// to http:// on my localhost environment. I tried to use a .htaccess file which I placed on my htdocs/ with the following code: RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] For some reason this is not working. Any advice? ...

Passenger + Rails App Not Loading

So I've just tried to migrate my first rails application from the development environment on my laptop to my hosted environment(just another machine that is externally facing), but I seem to keep getting errors with apache/passenger trying to run my app. Basically I've configured apache and passenger correctly in that the main site sti...

Why do WAMP apache try to load a module from php 5.2.8 ext dir, while its configured to use php 5.3.0?

I have a wamp installation on a vista machine ... This wamp is running Apache 2.2.11, Php 5.3.0, and mysql 5.051b Ther is another php 5.2.8 installation. I use nusphere phped 5.9 as php ide. For debugging i use dbg. I copied the dbg for php 5.3 dll to php 5.3 installations ext dir. I can use dbg from nusphere just fine. But recently...

How to remove a cookie in Apache

I need to remove a cookie from the HTTP request that gets to the server. Doing it on the client (that writes this cookie) or on the server (that reads it) is not an option. I have Apache 2.0 that proxies requests between client and the server, so I was hoping to remove the cookie right there in Apache using mod_rewrite. My question is,...

Pinax & Apache: deliver Attachments only to authenticated users

I want that Apache and Pinax only deliver Attachments to authenticated users. I found this post, but i can't make it work. My Apache-conf-file: WSGIPythonPath /usr/local/bin/python <VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com WSGIDaemonProcess k-production python-path=/path/to/app/pinax-...

Django: Large file uploads - custom processing with mod_wsgi

I'm doing file uploads using Django's File Upload mechanism with a custom handler (by subclassing django.core.files.uploadhandler.FileUploadHandler) which does some additional processing in the receive_data_chunk(self, raw_data, start) function. I was curious when the handler is actually called (i.e. after the file has been completely ...

Is there a standard permissions scheme for web server directories?

I have built many web sites and have used a few different ways of setting the permissions on my folders. I would like to know if there is a definitive configuration for web server directories. I have listed the folders which I consider to be standard in a typical web site directory, what is the permssion setting required for each one?...

How to prompt user to download the PDF file instead of opening?

in my project site if i click on a link and the PDF opens in a new or parent window. Well I want a box to appear that prompts the user to download the file instead of opening it. Does anyone know of a simple JavaScript onClick event that will do this? In all browser default with default settings. EDIT: sorry my server was PHP based ...

Deploying multiple grails applications with Apache/Tomcat + Virtual Hosts

I haven't been able to figure out how to deploy multiple grails applications with Apache/Tomcat where a virtual host is mapped to each grails app I can get it so that http://virtualhost1.example.com/myGrailsApplication-0.1/ works, but what I want is for http://virtualhost1.example.com/ to go directly to my application. A lot of tu...

Apache rewriteRule for root directory

I used to have the following rule in my .htaccess while building a website: RewriteRule ^test/(.*) cgi-bin/router.py?request=$1 [NC] Whenever the user goes to mysite.com/test/something they get redirected to cgi-bin/router.py?request=something. This worked very well. I have now finished the site and want to 'turn it on'. However simpl...

mod_rewrite proxy RewriteRule not working

I need to send all requests for the directory home/alphauser to backend/alphauser, but not requests to files inside the home/alphauser directory. For example: http://home/alphauser -> http://backend/alphauser http://home/alphauser/ -> http://backend/alphauser http://home/alphauser/icon.png -> http://home/al...

Apache httpd error and crash

I have a WAMP 2.0 server installed on Win XP . Apache version : 2.2.11 PHP Version : 5.3 MySQL : 5.1.36 I have about 11 tables in the mysql . Each run of my web application (HTML/Jquery/PHP/MySQL) fills about 100 rows in 2 of the tables.(One of the table has 2 Long blob columns where data of size upto 20MB is uploaded, I have changed...

.htaccess redirect to external URL while hiding redirect

I want to be able to redirect a domain pointed to my webhosting to an external domain. For example, I have this in my .htaccess: RewriteCond %{HTTP:Host} ^(?:www\.)?mydomain\.example$ RewriteRule ^(.*)$ http://myexternal.example/site [R=301,NC] However, when I visit the domain, the URL in my address bar changes to http://myexternal...

Apache: Deliver some urls from the file system, all others from Rails app

Hello! I want to host two different services on a Apache web server, reachable via the same domain: Some special URLs should go into the filesystem, all others should be handle by a Rails application. Example: http://mydomain.com/foo/123.txt => should deliver /var/www/special/foo/123.txt http://mydomain.com/users => should go to Rail...