Apache How to make this work? RewriteCond %{ENV:UNIQUE_ID} !%{QUERY_STRING}

/foo/.htaccess does an internal redirect RewriteRule ^(.*)$ /bar/?%{ENV:UNIQUE_ID} /bar/.htaccess needs to recognise that the request was NOT internal, the issue is that I cannot figure out how to make the comparision work RewriteCond %{ENV:UNIQUE_ID} !%{QUERY_STRING} even a RewriteCond %{QUERY_STRING} %{QUERY_STRING} won't match, I suppose there is a syntax issue in the right-hand of the expression, escaping % doesn't help. I tested that the above both variable have the same value on

Redirect 404 to another domain with apache?

Hey guys, have a question regarding apache. I have a site that's been re-engineered, but I want to capture all the 'old' links that people may have bookmarked or come from search engines to the old site which is under a new domain name. How do I get apache to redirect only 404 not found to the old site? TIA, J

Apache: how to setup in Apache/mod_proxy an upper bound on the number of concurrent forwarded requests?

I have a fairly standard setup where a front-end Apache server forwards requests to Tomcat through mod_proxy/AJP. How can I setup Apache/mod_proxy so it only forwards at most N (say, N=4) concurrent requests to Tomcat? Other concurrent requests coming into Apache should not be rejected, and should instead be queued to later be sent to Tomcat. PS 1: Note that this is something you can do this at Tomcat level with the maxThreads attribute, but I prefer to handle this at the Apache level. PS 2: I

Adding decision logic to Apache's mod_proxy_balancer with Memcache

What I am trying to achieve is to have Apache's mod_proxy_balancer check if a request was already made using a Memcache store. Basically: Streaming media request comes in. Check if streaming media has already been served with Memcache. If so, can that streaming media server handle another request. If so send request to said streaming media server. If not send request to the next streaming media server in line. Store key:value pair in Memcache. My questions are: Does mod_proxy_balancer already

Apache 403 forbidden using fastcgi

Trying to set up a ReviewBoard server, using apache 2.2 with fastcgi on Windows 7 (no, Linux isn't an option). I'm using (basically) the default httpd.conf, with mod_fcgid and mod_rewrite loaded, and Include C:\mars\reviews\conf\apache-fastcgi.conf added at the bottom. This too is the default, excepting the Order, Allow, and +Indexes. The trouble is, when I attempt to load the site, I get 403 for / (which, according to the rewrite rule, would become reviewboard.fcgi). I added +Indexes to pr

Apache Why am I getting a 500 error with these RewriteRules

I am setting up a site on a shared hosting plan so I am stuck using Apache and a .htaccess file. I have 2 RewriteRules defined. Both rules work perfectly on a local machine running Apache. The first rule is to rewrite requests for /css/*.css to /www/css/*.css The second rewrites everything else to /www/index.php. The first rule regarding CSS/JS files is the one causing 500 errors but I can't figure out why. I have tried every different incarnation of these rules and always get a 500. RewriteEngi

Apache Dont open images in browser force download if navigated directly on image

Is there a setting for apache or .htaccess to not open images in browser, but instead force the user to download them to their computer to open e.g. when he navigates to http://site.com/image.jpg this will make him download the file. The only time I want images loaded in the browser is when they're embedded in a HTML page. e.g. http://site.com/mypage.html If it is not possible then can we at least just block it completely if they go to http://site.com/image.jpg, they will get error 403 or some

Apache .htaccess: Check if query string has a certain value or else redirect it

I'm trying to learn a bit of .htaccess and am really anxious on what it can do. I saw a snippet online but can't get it to work, it basically goes like this If a query string does not have a certain value, redirect it to index.php instead or some other page. How do I do that? This looks for the value apples: www.domain.com/somefile.php?a=apples&b=xyz This will redirect to index.php instead: www.domain.com/somefile.php?a=stinkycheese&b=xyz

Apache Subdomain not working

I created a Subdomain for one of my domains. After creation in Apache & entry in DNS the Subdomain isn't pointing to it specified directory instead it points to its Main Domain's Directory Main Domain <VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com *.domain.com ServerAdmin webmaster@localhost DocumentRoot /var/www/domain/ <Directory /var/www/domain/> Options FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Di

moving sites on apache2

I have three live sites, and they were in my /home/user/www directory. I decided I would rather they reside in the /var/www directory. I changed the virtual host Document root to reflect the change. changed from /home/kb2tfa/www/site to /var/www/site. I reloaded apache2 and got a warning that one of the sites document root is still reflecting to the old path. something is stll seeing the old path and I don't know what it is because the virtual hosts were changed and two of the sites work. an

Apache redirect to another domain, but keep the url

I have 2 vhosts: www.example1.com and www.example2.com I have a page on www.example1.com/page.html I want this page to be accessible in the other domain, meaning I want people to be able to get to www.example2.com/page.html and view that page that is physically on the other vhost. But the URL must display www.example2.com I don't want to simply move the page physically to the other vhost, because it is a wordpress page and it would be a huge hassle. Is this possible?

Apache can't get virtualhost run on different port

I'm trying to setup on ubuntu, virtualhosts on different ports, but I can get it work. My configuration in sites-available looks like NameVirtualHost Listen 5050 <VirtualHost> ServerName localhost DocumentRoot "/var/www/example" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/example/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all

apache lucene tokens

I started experimenting Apache Lucene Core 4 and my question is... Lets asume that I created Index of some text and it is stored in a Field with name "context" Is it posible to get the list of tokens of this field, that was successfully indexed? I am looking at IndexReader and Field, but have no idea how to retrieve tokens.

Apache error starting tomee server from eclipse servers tab

My OS is win 7 ultimate 32 bit After installing JDK 7u9, eclipse Juno (4.2) SR1 for Java EE and finally adding into it the new server Apache TomEE 1.5.0 October 2nd, 2012 apache-tomee-1.5.0-webprofile.zip (using eclipse wizard to add new servers and choosing tomcat 7 profile and then the directory where it's installed) i'm getting the following console error ... ... ... nov 13, 2012 8:07:53 PM org.apache.tomee.catalina.OpenEJBContextConfig processAnnotationsFile SEVERE: OpenEJBContextConfig.pr

Apache How to execute a script on all subdomains

I have a domain with subdomains witch are used by bunch of people... The thing is that I can't understand wich subdomains are in use by the right people. So my question is: How to execute a javascript alert with a message(in all subdomains) to users to send me a email if subdomain is in use... Sorry for my bad English and bad explanation.

Apache beginner tutorial for .htaccess

I am trying to use .htaccess for my website, but I could not use it. I am unknown on how to use it. I have created .htaccess file. I am trying to use my custom 404 error message (for now) From this link I used ErrorDocument 404 /notfound.html But it did not work Also from this I tried things, but could not. Can anyone walk me through? What could be permission provided for the file What is owner for the file. Is there any setting to be set in any apache/php config file? I am using Mac OS

Apache RedirectMatch don't work

I want to tell to my Apache that i want a redirect permanent rules. I have theses 2 kinds of hits in my logs: xx.xxx.xx.x - - [15/Mar/2013:08:14:21 +0100] "POST /oldEndPoint/services/toto HTTP/1.1" 200 - 6003 - xx.xxx.xx.x - - [15/Mar/2013:08:15:40 +0100] "POST /newEndPoint/services/Tutu/toto HTTP/1.1" 200 - 1316 - I want to tell to Apache, when he receive hits to /oldEndPoint/services/toto then he should do a redirect permanent (301) to the new url: /newEndPoint/services/Tutu/toto. I have

Apache accessing network drive with php open dir

I have a flash drive(or hdd) connected to Linksys Router and set it up for access without login. Then I setup netword drive at Computer(Windows 7 Proffesional x64). I tried opendir(\; but i'm getting this error Warning: opendir(\\\s2,\\\s2): The network name cannot be found. (code: 67) in C:\xampp\htdocs\movies.php on line 4 Warning: opendir(\\\s2): failed to open dir: No such file or directory in C:\xampp\htdocs\movies.php on line 4 Warning

Apache 2.4 mod_status configuration with virtual hosts Getting Forbidden error

I am trying to get mod_status set up on my apache 2.4 server. I have trawled the net for hours but all the examples given just show the tags in the main httpd.conf file, not how to place the directives into a virtual host setup. This is my virtual host config with what I have tried. When I do this and then open a local browser or a browser from my allowed ip address (my remote public address) I get a forbidden error in the browser. <VirtualHost *:80> ServerName www.thevmscloud.com Serve

Can't understand these lines in apache log file

I get lines like these - - [13/Sep/2013:15:20:53 +0300] "\xda\x85^iK\x94bUt\xb2DR\x12l\x19\x11\x06\xd0\x86\x88\xf43\x0c\x14e\x17\xab\xf8SUGF{L\xb0T\x91\x12\xeb\xce\xdc\x1e\x19NS\xc6+\x82;c\r\x96\xd7@\xfb\x01n" 400 226 - - [13/Sep/2013:15:23:00 +0300] "-" 408 - - - [13/Sep/2013:15:27:23 +0300] "-" 408 - - - [13/Sep/2013:15:59:56 +0300] "\x9e\x89\xd6" 200 4487 in my apache log and i don't know what do they mean. I use WAMP just to test st

Apache httpd.conf: BalancerMember can not have a balancer name when defined in a location

Hi there I am trying to implement a simple load balancing experiment: Changing between the 3 load balancer scheduler algorithms available for use: Request Counting, Weighted Traffic Counting and Pending Request Counting. Reference: http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html I configured my conf file in apache server as such: code: <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> LoadModule proxy_balancer_module modules

What is a tested combination of versions of Mono+mod_mono for running ServiceStack in Apache on Debian?

I am trying to deploy a ServiceStack solution to Apache running on Debian with mod_mono. I am running into problems like this one: HttpCompileException: "External exception" when trying to access razor view in ServiceStack hosted on Apache+mod_mono The project uses Razor (which is the source of the biggest problem I ran into at the moment, see linked question). What is a tested and recommended combination of versions of Mono+mod_mono (+XSP?) for running ServiceStack in Apache on Deb

Apache mod-rewrite 1 single image to another

I have 2 domains that essentially point to the same virtualhost directory on the server running apache. Therefore: foobar.com/images/booya.png is the same file as boofar.com/images/booya.png I would like the 2 to be different images, for example: boofar.com/images/booya.png to serve images/booya2.png instead. I don't believe this is acheivable with a 301 but seems like it should be doable with a RewriteCond and RewriteRule. Any help is appreciated!

Apache Mahout Naive Bayes Classifier without Hadoop

It is possible to use Naive Bayes Classification engine in Apache Mahout without Hadoop? StandardNaiveBayesClassifier uses NaiveBayesModel that is actually constructed from Hadoop related classes. Can i run any other classifier in Apache Mahout without the need to install Hadoop on deployments server?

pyramid on apache/mod_wsgi : ImportError: No module named registry

I am a very new pyramid learner, I just followed the documentation for creating a new pyramid project : I succeeded to install a virtualenv with pyramid 1.5 packages and run the project in developement mode with 'pserve'. But, when using apache + mod_wsgi, this is another story : I got this error into the apache error log : [Fri May 02 09:08:53 2014] [error] [client] File "/home/eric/perso/projects/Pyratest/pyramid.wsgi", line 8, in <module> [Fri May 02 09:08:53 2014]

Apache cache only one image (.png) with ".htaccess" and not all images(.png)?

Hy, I have in the home of my drupal site an image that i want cache, but if write this in the htaccess: ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresByType image/png "access 1 year" </IfModule> ## EXPIRES CACHING ## it will be cache all files (.png)... I want cache only one image.png; so i ask you if there is a way cache only one element with a rule in the ".htaccess" ???? Is possible?? Thank you :)) Bye from italy ;) EDIT : is possible write also: ## E

Xampp port for apache

so i installed Apache via xampp, but it kept saying the port 80 is being used and I should change the port, so I went into the config and changed the port to 81. It was then able to start successfully, but I was wondering is there a downside to this? will anything go wrong or work differently now that I changed to port to 81?

Apache Tika - read chunk at a time from a file?

Is there any way to read chunk at a time (instead of reading the entire file) from a file using Tika API? following is my code. As you can see I am reading the entire file at once. I would like to read chunk at a time and create a text file the content. InputStream stream = new FileInputStream(file); Parser p = new AutoDetectParser(); Metadata meta =new Metadata(); WriteOutContentHandler handler = new WriteOutContnetHandler(-1); ParseContext parse = new ParseContext(); .... p.parse(stream,ha

Tricky Apache Rewrite Push State + Adding WWW

What I'm trying to achieve is adding (forcing) WWW in front of my push state URLs when it is not present. I tried to get familiar with rewrites, and looked around for possible solutions. Also tried many variations on my local machine. Somehow I just don't get it right. Here is what I have, which is working (inside my httpd.conf file) RewriteEngine On RewriteCond %{REQUEST_URI} !emails/* RewriteCond %{REQUEST_URI} !icons/* RewriteCond %{REQUEST_URI} !src-svg/* RewriteCond %{REQUEST_URI} !svg/

Apache: how to double-decode double-encoded incoming URLs

I'm having an issue with my Rails app running under Passenger/Apache, where Googlebot is attempting to access URLs where the query string parameters have been double-encoded. (I have no idea where Googlebot is getting these URLs from -- they're not in any links anywhere on my app.) This is resulting in a lot of extra errors in my logs, making it very difficult to diagnose "real" issues since they're buried underneath the errors cause by the URLs Googlebot is trying to access. Here's an example

Apache ignore *.php files in rewrite directives but not other extensions

I'm trying to test some simple rewrite directives in .htaccess file on my test environment with Apache and PHP-FPM. It seems that a simple rewrite rule works well for any type of file but not for *.php files. This works : RewriteEngine On RewriteRule ^sandbox/video\.html?$ http://www.google.fr? [R,L] But this not : RewriteEngine On RewriteRule ^sandbox/video\.php?$ http://www.google.fr? [R,L] I run Apache 2.2 and PHP-FPM inside a VM on Debian Could it be related ? Thanks for your h

Redmine Invalid command RailsBaseURI to restart apache2

Subject: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_25x_on_Ubuntu_1404_with_Apache2_Phusion_Passenger_MySQL_and_Subversion $service apache2 restart Output: Syntax error on line 10 of /etc/apache2/sites-enabled/redmine: Invalid command 'RailsBaseURI', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. The Apache error log may have more information. ...fail! file /etc/apache2/sites-available/redmine:

JSP file is served as plain/text, when TOMCAT is behind an APACHE server

I'm running in a strange problem. I have a project based on MAVEN. When I run the project directly from my computer for testing it, using mvn tomcat7:run, my website display is correct. When I upload it to my distant Tomcat server, that is accessed through the JK Apache Tomcat connector, the JSP page is served as a text file. In response headers, I can see Content-Type:text/plainwhich is almost strange, and I'm suspecting the Apache server is adding it because of some erroneous configuration. A

Apache htaccess - redirect subdomain to another URL and mask it

I would like all requests to "forum.maximumtrainer.com" to be redirect to "http://maximumtrainer.com:4567/" Where my actual forum is hosted. I have tried a lot of htaccess code but without success. I can do a normal redirect fine, but I would like the URL to always stay "forum.maximumtrainer.com/..." instead of changing to "maximumtrainer.com:4567/.." Here is my current htaccess file (first Rule is for the forum) RewriteEngine on #Just do a normal redirect, not hiding the new URL RewriteCo

Apache Failing to recognize specific .pdf file as pdf and opens it in plain-text

I upgraded Apache from 2.2 to 2.4. The problem is when I try to open pm.pdf file, it displays plain text. Any other pdf in any folder including the folder pm.pdf is in opens normally. It is just this one pdf file that is giving me trouble and only in IE. httpd.conf: LoadModule mime_module modules/mod_mime.so <IfModule mod_mime.c> TypesConfig conf/mime.types </IfModule> # Adobe Portable Document Format (PDF) compound image AddType application/pdf .pdf AddType applicat

org.apache.poi.ss.formula.eval.NotImplementedException: DATEDIF

I used a formula in excel sheet: =DATEDIF(TODAY(),E2,"y") & " years " & DATEDIF(TODAY(),E2,"ym") & " months " & DATEDIF(TODAY(),E2,"md") & " days" where E2 = 14-Aug-2015 On Execution of HSSFFormulaEvaluator.evaluateAllFormulaCells(wb) I am getting and Exception of org.apache.poi.ss.formula.eval.NotImplementedFunctionException: DATEDIF Please help.

Apache OSGi bundle is installed and in Active state but not registered and hence no output displayed on console

I am new to OSGi world. I am using Felix 5.0.1 as OSGi container and Apache Aries Blueprint bundle set. Maven 3.2.1 , Eclipse Version: Juno Service Release 2 as IDE. windows 7 Pro OS. I have develop two small application using OSGi bundles. 1] Welcome application it has 3 bundles i] welcomeapi bundle ii] welcomeserver bundle iii] welcomeclient bundle The api bundle is having interface , server bundle is implementing the interface and exposing the service. client bundle

Apache (httpd) - You don't have permission to access

I'm trying to run the below command from my linux server curl -T helloworld.txt -u user:pwd http://<ip>/record/helloworld.txt Not able to upload a helloworld.txt file to my http url Error: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access /record/helloworld.txt on this server.</p> <hr> <address>

Tell Apache to always serve index.php, no matter what is in the URL

I have written a frontend SPA in Javascript. It uses Ember with its routing, fake URL, authentication and all the amazing stuff Ember handles almost implicitly. The backend is written in PHP and the page shall be served by an Apache server. Now, the page works just fine if the request is sent to the root file (aka index) and everything is handled from here. If I however reload the page at let's say localhost/login, Apache tries to find a file named login, which, naturally, doesn't exist, as e

`md5sum -c` won't work with Apache's MD5 file format

Let me take you on a journey.. I'm trying to download and verify Apache Spark (http://www.apache.org/dist/spark/spark-1.6.0/spark-1.6.0-bin-hadoop2.6.tgz) via MD5 on a fresh Debian (Jessie) machine. The md5sum script already existed on that machine without me needing to do anything. As such I continue by downloading the MD5 checksum (http://www.apache.org/dist/spark/spark-1.6.0/spark-1.6.0-bin-hadoop2.6.tgz.md5) to the same directory as the downloaded Spark, and then I execute: md5sum -c spa

Why can't my friends access my website built with Apache2?

So, I have been building this website with HTML and I decided to host it with on Apache2. It runs on an Ubuntu and me already changed the VM assigned Ip, which is, into another one. I can access it on the Mac where the VM is, but I asked my friend if he can open it, and he said it was a 404 Server not found error. Please help!

Why is the Apache Pid File undefined?

when i try to start, stop or restart my WebServer on a Debian vServer it says: "ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars"! Why is that and how can i repair it? Thanks for all answers!

Apache Nutch 2.3.1 Website home page handling

I have configured Nutch 2.3.1 to crawl some news websites. As websites homepages are going to change after one day that why I want to handle home page in some different way so that for homepage, only main categories are crawled instead of text as text will change after sometime ( I have observed similar things in Google). For rest of pages, its working fine ( crawling text etc.)

Apache How to resolve connection - obsolete connection settings

After installing a signed certificate on Apache version 2.4.33, I've noticed the information below under the security tab of my browser's console; Connection - obsolete connection settings The connection to this site uses TLS 1.2 (a strong protocol), RSA (an obsolete key exchange), and AES_256_GCM (a strong cipher). Below is the screenshot of the error above; The snippet below reflects my virtual host configuration; <IfModule mod_ssl.c> <VirtualHost *:443> Documen

Apache .htaccess mod_rewrite with encoded URL path not working while unencoded path works

I am newby on working with mod_rewrite on apache and I am currently trying to write an url-shortener that takes an URL like mydomain/s/short/{UriToShorten} and shortens the given URI. What happens When I pass an URI to the shortening route in my browser, like localhost/s/short/http://example.com , the script shorten.php is invoked and the shortening process works as expected. However, if I encode the URL-Component and pass an URI like localhost/s/short/http%3A%2F%2Fexample.com (which should be

Get real Visitors IP in Apache behind Nginx reverse proxy dont work

After 5 hours trying to solve the problem and read any tutorial i have found, i ask here for help. I have an Nginx Reverse Proxy Server that points to my Apache Web Server, but on Apache i got just the IP address from Nginx reverse proxy server not visitors ip. My nginx proxy file: /etc/nginx/sites-available/proxy.conf proxy_pass http://MYIPADDRESS; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header

Convert NGINX rewrite rules to Apache htaccess

I have a client who is moving away from an NGINX webserver to Apache. Everything is simple nothing complicated however since I'm an NGINX kinda guy I forgot how to convert the NGINX rewrite rules onto apache ones. For example, these are the NGINX rewrites rewrite ^/Tower-Topics-Calendar/?$ https://$host/events/ permanent; How would I convert something like that onto .htaccess to use with Apache?

Apache Implement a redirect to Secure to website

Implement a redirect to HTTPS to website Earlier we have a website with HTTP, and recently we have purchased in to HTTPS. Now I am tried to implement the redirect to HTTPS. For this I tried below code in <IfModule mod_rewrite.c> ## enable rewrites Options +FollowSymlinks RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ www.example.com/$1 [R,L] </IfModule> When I uploaded the .htaccess file with above code. The website is not

  1    2   3   4   5   6  ... 下一页 最后一页 共 146 页