apache

IP restriction with htaccess

Hi guys! I want to restrict an entire site in such a way that just two IPs could enter the site. I have the following in my .htaccess (at the root of site): ErrorDocument 403 http://www.example.com/views/error403.html Order Deny,Allow Deny from all Allow from 311.311.311 322.322.322.322 ErrorDocument 404 /views/error404.html ErrorDoc...

Redirect requests only if the file is not found?

I'm hoping there is a way to do this with mod_rewrite and Apache, but maybe there is another way to consider too. On my site, I have directories set up for re-skinned versions of the site for clients. If the web root is /home/blah/www, a client directory would be /home/blah/www/clients/abc. When you access the client directory via a w...

Is it possible to run Apache and IIS on the same machine with one IP-Address (and different ports ?)

The "main" one should be IIS. Is there an option to address the Apache without typing in the port-number The reason for this is: I cannot get Django to work on IIS Any ideas will be appreciated ...

Rails cookie session sharing and "www.example.com" or "example.com" problem

When people access my app on www.example.com and log in, they get a cookie. I'm using the cookie option to store session on Rails. Accessing example.com (without the www), they must log in again, because Firefox does not recognize the previous session. So, what do you think is the best way to avoid this? I guess I will use a small .hta...

With Apache httpd, how do I configure no caching for a given UserAgent?

I have Apache HTTPD configured to add a cache header to requests for most static content: ExpiresActive On ExpiresDefault "access plus 1 year" # Force JNLP and BSH files to expire immediately so updates are checked for # and seen (We need this so we see changes in the dynamic content in both) ExpiresByType application/x-java-jnlp-file ...

Apache not using mod_rewrite.c

So I just setup a linode server with debian, apache, etc. and now I'm trying to get an app that I'm developing running, but it requires mod_rewrite.c. So naturally, I went to the directory of the application (happens to be in PHP if that matters) and created a .htaccess with this inside of it: <IfModule mod_rewrite.c> RewriteEngine On R...

How can I use "mod rewrite" to redirect a folder path to a subdomain, but without a browser redirect?

I have a file that I want to redirect to a subdomain using mod_rewrite. For example, I would like to redirect the request for http://www.mydomain.com/xyz to the subdomain xyz.example.com I don't want to send a redirect to the browser though (so it doesn't know the page is different). BTW. xyz is a CNAME record, pointing to www.otherdo...

Weird apache behavior when trying to display urls without html extension

Hello, I have a url that is easily accessible when you request it as: http://example.com/2005/01/example.html or http://example.com/2005/01/example (I actually don't know why it works without the extension. Instead, it should return the usual 404 error.) However, when I try to access the following url: http://ex...

What are the best techniques for making my LAMP sites download faster?

Hi Everyone I have a few sites I built for my work, nothing major, mainly just little tools which people can access and use when they're out of the office. I'm not very experienced as a developer but I like to tinker quite a lot and I was wondering if anyone had any clever little tweaks I could do to my sites to make them download faste...

Why modRewrite applies automatic .php to this simple rule?

Ok guys i have maybe a stupid problem, but i'm probably dumb :) I have this simple .htaccess: Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^news/([^/]+)$ news-inside.php?n=$1 [L] RewriteRule ^news/?$ news.php [L] RewriteCond %{REQUEST_FILENAME} !-f Every time i try to get into firs...

Mod rewrite issue

Hello, As many others I am having issues with doing some very simple mod_rewriting in apache. I have the following in my .htaccess: Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^view/([0-9]+)/([0-9]+)$ view.php?advertId=$1&publisherId=$2 [NC,QSA,L] Which is supposed to translate /view/4093/203?qs=val -> /view.p...

How do I redirect from Apache to Tomcat?

I'm working on my first Java site. I'm running Apache Tomcat on port 8080, and Apache HTTPD on port 80. The current URL that I can access the site at is (for example) 123.4.5.6:8080. I want to remove the port number from the URL before I point the domain at the new IP. At the moment I am only using Apache for phpmyadmin, however I plan ...

How can I view DOMString (from apache xerces library) in MS visual studio debugger?

I am working on code (legacy code) which uses Apache Xerces-C library. I am trying to view the value of DOMString (and other related DOM objects) in Microsoft Visual Studio Debugger but in vain. I have tried the following 1) I Added the following in the autoexp.dat file: ;---------------------------------------------------------------...

How to read Java properties file from a JAAS LoginModule

I'd like to read a properties file in my applications WEB-INF folder or my tomcat/apache server from a JAAS loginModule. But I'm not understanding how to properly refer to the location from the LoginModule, in a host name independent manner. ...

Is storing config variables in an XML file on a PHP site under the site root too risky?

I've noticed that Magento stores MySQL connection details in an XML file which isn't secured above the docroot. This seems.... well dangerous. XML seems like a handy way to store config data, except for one thing, typing in http://www.domain.com.au/library/config.xml will show the world your private details! I went ahead and used an XM...

What ec2 image (ami) do you recommend for working with java 5, jboss, mysql, apache?

What ec2 image (ami) do you recommend for working with java 5, jboss, mysql, apache? ...

What do these declarations mean in my .htaccess file?

I am a newb to PHP. Can anyone tell me what each line does here. Do I need this? It is giving me errors RewriteCond %{REQUEST_URI} /~([^/]+)/? RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) /~%1/rewrite.php?p=$1&%{QUERY_STRING} [L] RewriteCond %{REQUEST_URI} /~([^/]+)/? RewriteRule ^index\.p...

When deploying TRAC/Subversion (SVN) on Apache with mod_wsgi, TRAC doesn't open any page at all

I've deployed trac using apache/mod_wsgi (no SSL) (preferable, since the problem I'm facing with CGI is performance), and it works fine WITHOUT SVN integration. But I actually need SVN, so when I configure the repository path (i.e: repository_dir = c:/projects/svn/my_project) I can't even get my project TRAC to even open any of its pages...

Mod include is not including recursively

Hello! So I have a django application that generates html that have server side includes in them. So in my apache config I added to the Directory directive SetOutputFilter INCLUDES my problem is mod include will process the include in the generated page but it if the include contain includes those do not get processed. Anyone know how...

Firefox requesting images slowly

I have created a simple JSF image browsing app, and I'm having a problem with firefox. The app itself is running inside Tomcat. The pictures are stored in a directory that is served by Apache. I've got 9 pictures that get shown on a page. The servers are on a machine separate from the client. When I try to load the page in firefox...