apache2

[SOLVED] Apache2 + RewriteMap + Python -- when returning 'NULL', apache hangs

[SOLVED: See solution below.] I'm having a problem writing a RewriteMap program (using Python). I have a RewriteMap directive pointing to a Python script which determines if the requested URL needs to be redirected elsewhere. When the script outputs a string terminated by a linebreak, Apache redirects accordingly. However, when the s...

Rails Comments on View if-end statement screw up rendering on Linux/Apache/FastCGI

Hi, the following code does work under my Windows development environment, but not on my production Linux/Apache2/FastCGI env. in my view rhtml file : <td id='first_column' class='column'> <% content_for :head do #DO NOT CACHE THIS content for : HEAD %> <%= stylesheet_link_tag('live_tree') %> <%= javascr...

Unable to make a 301 domain redirection

Hi I have an application which uses opencart. I would like to make a 301 reditect in case the user types http://example.com. To be redirected in http://www.example.com (301 status code) Here is my .htaccess content: RewriteEngine On \#OPENCART REWRITES START RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Re...

Rewrite URLs for static content

I have problems with static files url rewriting in current .htaccess setup on apache2. My app structure is: /siteroot /siteroot/app /siteroot/lib /siteroot/... /siteroot/public <- all the static files (images, js, etc.) stored here /siteroot/index.php /siteroot/.htaccess So, i need to rewrite url like /css/style.css to /public/css/st...

appengine, urlfetch, and the content-length header

I have a Google Appengine app requesting pages from another server using urllib2 POSTs. I recently enabled gzip compression on the other server running Apache2, and the Appengine page requests started failing on key-error, indicating 'content-length' is not in the headers. I am not explicitly declaring gzip as an accepted encoding in m...

Reaching files outside od the documentroot scope

Hi. I'm writing a script to build a dynamic website, the website is created by loading external components. The DocumentRoot is location at /sites/website/public the components directory is located at /sites/website/components i wannna reach the data directory of each component depends on the requested url. for example: the url: htt...

Reverse Proxy with Apache2 don't work

Hi, I'm using Apache/2.2.8 (Ubuntu) and have a problem. There is a file /etc/apache2/sites-available/backuppc with the following: <VirtualHost *> ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /backuppc http://192.168.134.59:80/backuppc ProxyPassReverse /backuppc http://192.168.134.59:80/backuppc ...

htaccess rewrite not working for all rules

This is a very strange problem, and I just hope that I can clearly explain it. Basically, we made a major update on a client site today, and needed to update some rewrite rules in the htaccess to accomodate the new structure, etc... So, where we originally had things like: RewriteRule ^/resources/?$ index.php?id=resources RewriteRule...

Add missing final boundary of HTTP request with Apache / PHP?

Hello, I receive HTTP Post requests from an application, which is already deployed on mobile phones. This application worked fine the last months, but now PHP started complaining with respect to a POST file upload: UPLOAD_ERR_PARTIAL via HTTP 1.0 and PHP5. (After a crash the server had been set up again with new Apache and PHP versions,...

Rewrite Rules Behavior Changes When Used Together

Each rule set below works fine when used alone. However, when used together, the rules' behavior changes. When rule set # 2 is used by itself, a request for https://internal/Security/login is rewritten by Apache to sapphire/main.php without the browser's knowledge. This is the expected behavior. When both rule sets are used together,...

Gettext, not displaying

I'm trying to load my .mo translations using the following code, but it doesn't work. I have the php gettext ext. enabled in my phpinfo() and all the required locales are installed. Did I miss anything? $locale = "en_US"; putenv("LC_ALL=$locale"); setlocale(LC_ALL, $locale); bindtextdomain("messages", "./locale"); textdomain("message...

How to get permission to edit the file apache2.conf? [Ubuntu]

Hello there, I'm a beginner Ruby on Rails Programmer and I'm trying to install Apache2 + Passenger(That's for Rails Deployment).. and at the end of the installation process, Passenger gave me a few lines to add to the file apache2.conf at /etc/apache2/ but I can't override this file.. I have no permission =( I've also uploaded an image s...

How to set up an Apache 2 reverse proxy with dynamic backend servers?

I would like to set up Apache 2 as a reverse proxy using name-based virtual hosts to decide how requests are routed to back-end servers. Simple enough. The catch is that these back-end servers may be added and removed in a dynamic fashion. My first idea was to programmatically re-write an Apache configuration file and call apachectl gra...

mod_python req.subprocess_env not "seeing" PythonOptions

I'm having trouble getting an environmental variable out of apache config. (don't ask why it's being done this way, I didn't originally code it) This is what I have in the apache config. <Location "/var/www"> SetHandler python-program PythonHandler mod_python.publisher PythonOption MYSQL_PWD ########### PythonDebug On <...

pylons/paste config files in fastcgi (deployment)

I'm running a pylons app using fastcgi and apache2. There are two versions (different revisions from my svn repo), one for staging and one for production. I'd like them to use different paste config files. Right now, my dispatch.fcgi inside htdocs in the pylons app just uses one config file (so both stage and live use the same confi...

Compressing xls content with apache deflate module

I am trying to compress an excel spreadsheet being sent from my application using apache deflate module. I have added the following line to the my sites-enabled file: AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/excel But is seems to make the response data bigger??? Using firebug, w...

What Perl RESTful framework do you recommend?

Hi I'm looking for a Perl RESTful framework that have to : work under apache2/mod_perl2 be simple be elegant be light be flexible Am I just dreaming or can I avoid the 'Roll our own' approach? What framework would you recommend? ...

How do I suppress the default apache error document in mod_perl?

I'm developing a RESTful API and I wrote a mod_perl2 handler that takes care of the request. My handler deals with error codes by setting $r->status($http_code) and return $http_code; Everything is fine, except a little problem: when my http_code is different than 200 (for instance 404), apache appends a default HTML error document to ...

Proxy URL without authentication

I have an Apache web server with basic authentication enabled at the root directory. I can't change this due to business restrictions. However, we want a particular URL to be a proxy to a different site, with different authentication, without being asked for authentication by the main site. Example: My site is http://foo.com/ If you g...

HTTP/1.1 200 OK...

What does this mean, and why does it appear on bottom of ALL html, php, css, js files? HTTP/1.1 200 OK Date: Fri, 06 Nov 2009 00:35:42 GMT Server: Apache Content-Length: 0 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/plain I am running a nph-proxy.cgi script. I already turned off ServerSignatures, and set...