I'm having trouble getting ProcessMaker running on CentOS 7. I've got through the CentOS 7 installation and have all of the prerequisites. I've modified my virtual hosts file to look like this:
NameVirtualHost my.host.com
<VirtualHost my.host.com:80>
ServerName my.host.com
DocumentRoot /opt/processmaker/workflow/public_html
DirectoryIndex index.html index.php
<Directory /opt/processmaker/workflow/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride none
Order allow,deny
Require all granted
Allow from all
ExpiresActive On
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/(.*)$ app.php [QSA,L,NC]
</Directory>
</VirtualHost>
I receive the following error message:
Sistem Configuration Error:
Please review your apache virtual host configuration file, and be sure you have the following rules:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
</IfModule>
I've verified that mod_rewrite is installed and loaded:
# ls /etc/httpd/modules | grep mod_rewrite
mod_rewrite.so
# grep rewrite /etc/httpd/conf.modules.d/00-base.conf
LoadModule rewrite_module modules/mod_rewrite.so
What am I missing here?
<VirtualHost *:9999>
ServerName 127.0.0.1
DocumentRoot /opt/processmaker/workflow/public_html
DirectoryIndex index.html index.php
<Directory /opt/processmaker/workflow>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
ExpiresActive On
ExpiresDefault "access plus 1 day"
ExpiresByType image/gif "access plus 1 day"
ExpiresByType image/png "access plus 1 day"
ExpiresByType image/jpg "access plus 1 day"
ExpiresByType text/css "access plus 1 day"
ExpiresByType text/javascript "access plus 1 day"
</Directory>
</VirtualHost>
I still don't understand why this was happening, but reinstalling everything slightly differently fixed it. The major change was using the default PHP installation, but adding the current EPEL repository to get php_mcrypt, but otherwise following the stock installation instructions. I don't see any good reason why this would have changed anything, but it now works.
Related
I have a DigitalOcean droplet running Ubuntu.
On it, I host three sites using Apache. I am trying to add a fourth, "newsite.com", swapping from another host. This fourth site is live on another environment with SSL enabled.
The existing three sites run fine. They have SSL enabled using LetsEncrypt and I use virtual hosts to set up multiple domains with the same IP. However, for the fourth one, the new site, if I try to view the site (by editing my Win10 hosts file to point at the server IP) I see one of the other three sites, "oldsite1.com", which is the highest in the list sorted alphabetically. I understand Apache works its way down the list of enabled sites to select one. The new site does not have SSL enabled as I cannot run LetsEncrypt until the DNS has been changed.
The .conf file for the new site looks like this:
<VirtualHost *:80>
ServerAdmin webmaster#newsite.com
ServerName newsite.com
ServerAlias www.newsite.com
DocumentRoot /var/www/newsite.com/public_html
<Directory /var/www/newsite.com/public_html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteEngine on
RewriteCond %{SERVER_NAME} =newsite.com [OR]
RewriteCond %{SERVER_NAME} =www.newsite.com
RewriteRule ^ http://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
This matches the .conf files of the other sites.
My newsite .htaccess file:
#Force SSL
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://newsite.com/$1 [R=301,L]
# Prevent Directory listing
Options -Indexes
#Whitelist IP
#RewriteEngine On
#RewriteCond %{REMOTE_ADDR} [removed]
#RewriteCond %{DOCUMENT_ROOT}/error.html -f
#RewriteCond %{DOCUMENT_ROOT}/error.enable -f
#RewriteCond %{SCRIPT_FILENAME} !error.html
#RewriteRule ^.*$ /error.html [R=503,L]
#ErrorDocument 503 /error.html
#Header Set Cache-Control "max-age=0, no-store"
# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>
# SEO URL Settings
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off
# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off
# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M
# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M
# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200
# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
# 7. disable open_basedir limitations
# php_admin_value open_basedir none
###Compression stuff###
# Enable Gzip Compression
AddOutputFilterByType DEFLATE text/text
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Leverage Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 month"
</IfModule>
# Remove Browser Bugs
#BrowserMatch ^Mozilla/4 gzip-only-text/html
#BrowserMatch ^Mozilla/4\.0[678] no-gzip
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
#Header append Vary User-Agent
Running sudo apache2ctl -S returns:
VirtualHost configuration:
*:443 is a NameVirtualHost
default server oldsite1.com (/etc/apache2/sites-enabled/oldsite1.com-le-ssl.conf:2)
port 443 namevhost oldsite1.com (/etc/apache2/sites-enabled/oldsite1.com-le-ssl.conf:2)
alias www.oldsite1.com
port 443 namevhost oldsite2.com (/etc/apache2/sites-enabled/oldsite2.com-le-ssl.conf:2)
alias www.oldsite2.com
port 443 namevhost oldsite3.com (/etc/apache2/sites-enabled/oldsite3.com-le-ssl.conf:2)
alias www.oldsite3.com
*:80 is a NameVirtualHost
default server 127.0.0.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost 127.0.0.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost oldsite1.com (/etc/apache2/sites-enabled/oldsite1.com.conf:1)
alias www.oldsite1.com
port 80 namevhost oldsite2.com (/etc/apache2/sites-enabled/oldsite2.com.conf:1)
alias www.oldsite2.com
port 80 namevhost oldsite3.com (/etc/apache2/sites-enabled/oldsite3.com.conf:1)
alias www.oldsite3.com
port 80 namevhost newsite.com (/etc/apache2/sites-enabled/newsite.com.conf:1)
alias www.newsite.com
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
I have tried emptying the newsite .htaccess and restarted apache multiple times but I am always shown oldsite1.com when I try to view newsite.com.
Assuming there is nothing wrong with my .conf or .htaccess, why is Apache preferring the vhost of the first site in the list?
You are forcing ssl. The moment you load http://newsite.com you are being redirected to https://newsite.com.
You only have a vhost for newsite.com on port 80 and not on port 443.
Since there is no vhost for the requested domain on port 443 you will be served the default site.
You will get your site as expected if you comment out this part:
#Force SSL
RewriteEngine On
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://newsite.com/$1 [R=301,L]
I am trying to create multiple serveralias in apache2.4.25. It works but one of the serveralias sometimes shows 403 fobidden error. Here's my apache virtual config.
<VirtualHost *:80>
ServerName sajhamanch.com
ServerAlias www.sajhamanch.com
ServerAlias english.sajhamanch.com
ServerAlias webmail.sajhamanch.com
ServerAlias autoconfig.sajhamanch.com
ServerAlias autodiscover.sajhamanch.com
DocumentRoot /home/sajhamanch/public_html
ErrorLog /var/log/virtualmin/sajhamanch.com_error_log
CustomLog /var/log/virtualmin/sajhamanch.com_access_log combined
ScriptAlias /cgi-bin/ /home/sajhamanch/cgi-bin/
ScriptAlias /AutoDiscover/AutoDiscover.xml /home/sajhamanch/cgi-bin/autoconfig.cgi
ScriptAlias /Autodiscover/Autodiscover.xml /home/sajhamanch/cgi-bin/autoconfig.cgi
ScriptAlias /autodiscover/autodiscover.xml /home/sajhamanch/cgi-bin/autoconfig.cgi
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/sajhamanch/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddType application/x-httpd-php7.0 .php7.0
</Directory>
<Directory /home/sajhamanch/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.sajhamanch.com
RewriteRule ^(.*) https://host.crystalsoft.com.np:20000 [R]
<LocationMatch "^(.*\.php)$">
ProxyPass fcgi://127.0.0.1:9002/home/sajhamanch/public_html
</LocationMatch>
Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
</VirtualHost>
<VirtualHost 139.59.22.58:443>
ServerName sajhamanch.com
ServerAlias www.sajhamanch.com
ServerAlias english.sajhamanch.com
ServerAlias webmail.sajhamanch.com
ServerAlias autoconfig.sajhamanch.com
ServerAlias autodiscover.sajhamanch.com
DocumentRoot /home/sajhamanch/public_html
ErrorLog /var/log/virtualmin/sajhamanch.com_error_log
CustomLog /var/log/virtualmin/sajhamanch.com_access_log combined
ScriptAlias /cgi-bin/ /home/sajhamanch/cgi-bin/
ScriptAlias /AutoDiscover/AutoDiscover.xml /home/sajhamanch/cgi-bin/autoconfig.cgi
ScriptAlias /Autodiscover/Autodiscover.xml /home/sajhamanch/cgi-bin/autoconfig.cgi
ScriptAlias /autodiscover/autodiscover.xml /home/sajhamanch/cgi-bin/autoconfig.cgi
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/sajhamanch/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddType application/x-httpd-php7.0 .php7.0
</Directory>
<Directory /home/sajhamanch/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.sajhamanch.com
RewriteRule ^(.*) https://host.crystalsoft.com.np:20000 [R]
SSLEngine on
SSLCertificateFile /home/sajhamanch/ssl.cert
SSLCertificateKeyFile /home/sajhamanch/ssl.key
SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2
####### http2 #########
Protocols h2 http/1.1
######## php fpm link #############
<LocationMatch "^(.*\.php)$">
ProxyPass fcgi://127.0.0.1:9002/home/sajhamanch/public_html
</LocationMatch>
SSLCACertificateFile /home/sajhamanch/ssl.ca
Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
</VirtualHost>
Here's my .htacess
ExpiresActive On
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/bmp "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/x-javascript
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "public,max-age=25920000"
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.sajhamanch\.com
RewriteRule ^(.*)$ https://www.sajhamanch.com/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^english\.sajhamanch\.com
RewriteRule ^(.*)$ https://english.sajhamanch.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^sajhamanch\.com
RewriteRule ^(.*)$ https://www.sajhamanch.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
But when I visit to https://english.sajhamanch.com, apache sometimes shows me 403 error page.
No Problem in DNS Config. And I also have these meta tags in all pages
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
What could be the problem?
I've been struggling whole day with that issue, but still have no clue, why it does not work. I deployed a website from hosting to local server to test/update purposes. Admin park works fine, main page works fine and directories and components work fine. But every component which relies on url -rewrite engine fails to work. It sends me to 404. For example I can look through /catalog/ directory but if I request /commodity/good/ I am sent to 404, so happens with news component etc. I've tried many variations of server config but result either the same either server error.
I reset my experiments to default config, it seems it has to work
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory "C:\VertrigoServ\www">
Options Indexes FollowSymLinks Includes
AllowOverride All
Require all granted
</Directory>
And it seems it works, but in a strange manner. If I add Redirect instruction to .htaccess it performs that redirect. But Bitrix does not work properly anyway.
Here is what I left in main .htaccess file
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag allow_call_time_pass_reference 1
php_flag session.use_trans_sid off
#php_value display_errors 1
#php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
</IfModule>
If you faced similar issue please help me to find solution...
I am trying to install SugarCRM Enterprise 7.2 and I keep getting this error during system check:
Test for .htaccess rewrites failed. This usually means you do not have
AllowOverride set up for Sugar directory.
I am running Ubuntu 14.04 with LAMP, and I am trying to install Sugar to the local path
var/www/html/sugar_ent_7
I have already tried putting both
<Directory /var/www/ >
Allowoverride All
Order allow,deny
Allow from all
</Directory>
and
<Directory /var/www/html/sugar_ent_7 >
Allowoverride All
Order allow,deny
Allow from all
</Directory>
to my
/etc/apache2/apache2.conf
file, and no results. I have also tried making a
/etc/apache2/sites-available/sugar_ent_7.conf
file with this code
<Directory /var/www/html/sugar_ent_7>
Order allow,deny
Allow from All
AllowOverride All
</Directory>
and still nothing. What am I doing wrong?
Run the command
a2enmod rewrite;
in your terminal and restart your apache.
Hope this helps.
I met the same problem.
its aim is just to check the following code exists in your .htaccess:
# install/installSystemCheck.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$basePath}
RewriteRule ^itest.txt$ install_test.txt [N,QSA]
</IfModule>
I don't think SugarCRM is enough to check this setting, so let's just comment it out and make it passed:
#
// if($res != "SUCCESS") {
if(false) {
....
This error can also (misleadingly?) occur when sugar tries to address itself vi IP during the system check. When vhosting is configured it cannot find itself via IP, thus an entry to the hosts file can solve this. In the terminal enter:
vi /etc/hosts
Then add the IP of the system Sugar is running on with the URL you're referring to it, e.g.:
123.234.123.234 subdomain.host.com
# BEGIN SUGARCRM RESTRICTIONS
RedirectMatch 403 (?i).*\.log$
RedirectMatch 403 (?i)/+not_imported_.*\.txt
RedirectMatch 403 (?i)/+(soap|cache|xtemplate|data|examples|include|log4php|metadata|modules)/+.*\.(php|tpl)
RedirectMatch 403 (?i)/+emailmandelivery\.php
RedirectMatch 403 (?i)/+upload
RedirectMatch 403 (?i)/+custom/+blowfish
RedirectMatch 403 (?i)/+cache/+diagnostic
RedirectMatch 403 (?i)/+files\.md5$
# END SUGARCRM RESTRICTIONS
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /dir
RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jslang&module=app_strings&lang=$1 [L,QSA]
RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoint=jslang&module=$1&lang=$2 [L,QSA]
</IfModule>
<FilesMatch "\.(jpg|png|gif|js|css|ico)$">
<IfModule mod_headers.c>
Header set ETag ""
Header set Cache-Control "max-age=2592000"
Header set Expires "01 Jan 2112 00:00:00 GMT"
</IfModule>
</FilesMatch>
<IfModule mod_expires.c>
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
</IfModule>
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 Rails/Passenger
Here is my virtual host setup for the Rails app:
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias *.mydomain.com
DocumentRoot /var/www/mydomain/current/public
<Directory /var/www/mydomain/current/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
ExpiresActive on
ExpiresDefault "access plus 1 year"
FileETag MTime Size
</Directory>
RewriteEngine On
# Check for maintenance file and redirect all requests
ErrorDocument 503 /system/maintenance.html
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ - [redirect=503,last]
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/xml application/xhtml+xml text/javascript application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
ErrorLog /var/log/apache2/mydomain.com-error_log
CustomLog /var/log/apache2/mydomain.com-access_log combined
</VirtualHost>
Somewhere in the middle a RewriteCond/RewiteRule should be added, so accessing http://mydomain.com/foo/123.txt does not go to the Rails app, but the filesystem instead.
For this I need help. It would by great if someone can can give me a hint.
Found the solution by myself:
RewriteCond %{REQUEST_URI} ^/foo/.*$
RewriteRule ^.*$ /var/www/special/foo%{REQUEST_URI}