apache-config

how to use “AND”, “OR” for RewriteCond on Apache?

做~自己de王妃 提交于 2019-11-27 09:22:28
问题 Is this how to use AND, OR for RewriteCond on Apache? rewritecond A [or] rewritecond B rewritecond C [or] rewritecond D RewriteRule ... something becomes if ( (A or B) and (C or D) ) rewrite_it . So it seems like "OR" is higher precedence than "AND"? Is there a way to easily tell, like in the (A or B) and (C or D) syntax? 回答1: This is an interesting question and since it isn't explained very explicitly in the documentation I'll answer this by going through the sourcecode of mod_rewrite;

Need to allow encoded slashes on Apache

非 Y 不嫁゛ 提交于 2019-11-27 06:26:41
I'm currently trying to place a URL within a URL. For example: http://example.com/url/http%3A%2F%2Fwww.url2.com I'm aware that I have to encode the URL, which I have done, but now I am getting a 404 error back from the server rather than my app. I think my problem lies with apache and can be fixed with the AllowEncodedSlashes On directive. I've tried putting the directive at the bottom of the httpd.conf to no effect, and am unsure what to do next. Am I putting it in the right place? If so, does anyone have any other solutions? This issue is not related to Apache Bug 35256. Rather, it is

How do I run Django and PHP together on one Apache server?

戏子无情 提交于 2019-11-27 05:59:54
I can currently run either Django through mod_wsgi or PHP on my Apache server. My Django projects run at: http://localhost and source is at C:/django_proj My PHP projects run at: http://php.localhost and source is at C:/web If I turn both on, php.localhost and localhost go to the Django project. I've already set them up through Apache virtual hosts. Here are some relevant lines in httpd.conf: DocumentRoot "C:/web" <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> <Directory "C:/web"> Options Indexes FollowSymLinks AllowOverride None Order allow

Best way to log POST data in Apache?

左心房为你撑大大i 提交于 2019-11-26 20:13:34
Imagine you have a site API that accepts data in the form of GET requests with parameters, or as POST requests (say, with standard url-encoded, &-separated POST data). If you want to log and analyze API calls, the GET requests will be easy, because they will be in the apache log. Is there a simple way to get the POST data in the apache log as well? (Of course we could log the POST data explicitly in the application, but I'd like to have an configuration-level way that let me not worry about it in code.) Spider Use Apache's mod_dumpio . Be careful for obvious reasons. Note that mod_dumpio stops

How do I configure Apache2 to allow multiple simultaneous connections from same IP address?

一笑奈何 提交于 2019-11-26 18:18:26
问题 By default, Apache2 seems to allow only 1 connection per IP address. How do I configure Apache2 to allow multiple simultaneous connections from the same IP address? Here is my situation: a web app being hosted on a server. a remote client makes an request that may take 15 seconds to complete. the same remote client makes another (independent) request. at present, the 2nd request sits in a queue until the 1st request completes, since Apache2 seems to impose a limit of 1 connection per IP

How do I run Django and PHP together on one Apache server?

此生再无相见时 提交于 2019-11-26 12:51:05
问题 I can currently run either Django through mod_wsgi or PHP on my Apache server. My Django projects run at: http://localhost and source is at C:/django_proj My PHP projects run at: http://php.localhost and source is at C:/web If I turn both on, php.localhost and localhost go to the Django project. I\'ve already set them up through Apache virtual hosts. Here are some relevant lines in httpd.conf: DocumentRoot \"C:/web\" <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow

Need to allow encoded slashes on Apache

邮差的信 提交于 2019-11-26 09:19:24
问题 I\'m currently trying to place a URL within a URL. For example: http://example.com/url/http%3A%2F%2Fwww.url2.com I\'m aware that I have to encode the URL, which I have done, but now I am getting a 404 error back from the server rather than my app. I think my problem lies with apache and can be fixed with the AllowEncodedSlashes On directive. I\'ve tried putting the directive at the bottom of the httpd.conf to no effect, and am unsure what to do next. Am I putting it in the right place? If so,

Best way to log POST data in Apache?

巧了我就是萌 提交于 2019-11-26 07:30:33
问题 Imagine you have a site API that accepts data in the form of GET requests with parameters, or as POST requests (say, with standard url-encoded, &-separated POST data). If you want to log and analyze API calls, the GET requests will be easy, because they will be in the apache log. Is there a simple way to get the POST data in the apache log as well? (Of course we could log the POST data explicitly in the application, but I\'d like to have an configuration-level way that let me not worry about

index.php not loading by default

梦想的初衷 提交于 2019-11-26 01:49:34
问题 I have just installed CentOS, Apache and PHP. When I visit my site http://example.com/myapp/, it says \"forbidden\". By default it\'s not loading the index.php file. When I visit http://example.com/myapp/index.php, it works fine. Any idea how to fix that issue? 回答1: Apache needs to be configured to recognize index.php as an index file. The simplest way to accomplish this.. Create a .htaccess file in your web root. Add the line... DirectoryIndex index.php Here is a resource regarding the

How to change the default encoding to UTF-8 for Apache?

一世执手 提交于 2019-11-26 00:16:46
问题 I am using a hosting company and it will list the files in a directory if the file index.html is not there ,it uses iso-8859-1 as the default encoding. If the server is Apache, is there a way to set UTF-8 as the default instead? Update: Additionally I found out that it is actually using a DOCTYPE of HTML 3.2 and then there is not charset at all... so it is not setting any encoding. But is there a way to change it to use UTF-8? 回答1: In httpd.conf add (or change if it's already there):