webserver

Log4j in clustered environment

Deadly 提交于 2019-12-23 05:02:02
问题 I am using log4j for a web application running in clustered environment. Under few circumstances the logging is lost for some of the processes (not particular). I am not able to pin point why. When run on single server instance, it works fine. I am using a daily rolling file appender. Any additional attributes to be added/modified ? Will Async Appender help ? Any solution on this ? EDIT : Following is log4j XML along with AsyncAppender that I am planning to use <?xml version="1.0" encoding=

How to secure PHP files from being downloaded?

余生颓废 提交于 2019-12-23 04:50:42
问题 I have a doubt about PHP, Apache, server interpretation... I know that when a PHP file is loaded by the browser from an Apache+PHP server it is interpreted and only the HTML and plain text is showed but is there a way to download this files instead of interpreting them? In this case it would be very unsecure because MySQL passwords would be unsafe. Is it any security measure to prevent this or it's impossible to download this files? 回答1: As long as your server is setup properly it isn't going

Angular: setting baseHref does not create subfolders

ε祈祈猫儿з 提交于 2019-12-23 03:37:18
问题 When you run ng build with --base-href "/some/path/" , why does angular not create subdirectories according to the path? When I start a http-server in my /dist/ I get errors like GET /some/path/assets/images/image.png Not Found! thrown in my face. when you look into /dist/ , the problem is clear: there is only the assets folder directly, not inside other folders. So what is the right way to set a baseHref? What I try to accomplish is having different versions of the app (with different i18n

redirect all files with .php extension

穿精又带淫゛_ 提交于 2019-12-23 01:18:08
问题 have this code in a htaccess file to hide the final php extension of each file RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php but now i want to redirect to another page if the user try to complete the extension. i tried this line after the script above but i get a 500 internal error RewriteRule \.php$ - [R=404] thanks ! 回答1: Have your rewrite rules like this: RewriteEngine on Options +FollowSymlinks -MultiViews

Android embedded web-server

自古美人都是妖i 提交于 2019-12-23 00:39:28
问题 I want to embed a web-server in my android application where devices connecting to it will have two abilities. One is send an xml-file that I can parse and do some stuff and the other to be able to download a file from my sd-card. I found nanoHTTPD and AndroidHTTPD etc but not good documentation and I'm facing problems especially on how to give the ability to download the File. Is there any good tutorial/example that handles files or an easy-to-use library except of the ones I noted above?

Android embedded web-server

北城余情 提交于 2019-12-23 00:39:03
问题 I want to embed a web-server in my android application where devices connecting to it will have two abilities. One is send an xml-file that I can parse and do some stuff and the other to be able to download a file from my sd-card. I found nanoHTTPD and AndroidHTTPD etc but not good documentation and I'm facing problems especially on how to give the ability to download the File. Is there any good tutorial/example that handles files or an easy-to-use library except of the ones I noted above?

Why do I need to change IE settings to enable HTTP/2 on Windows 10?

强颜欢笑 提交于 2019-12-22 12:38:38
问题 I recently enabled HTTP/2 on a site I was developing. To do this I had to Be on Windows 10 Use a browser that supports HTTP/2 (in my case Chrome) Configure my webserver (iisexpress) to serve the site using https Enable HTTP/2 in the Internet Explorer options It all works, but I'm confused about why 1 and 4 are necessary. Especially 4 as I'm not actually using Internet Explorer. Now the above link suggests that it has something to do with the WININET library and I understand that IE options

How to know when HTTP-server is done sending data

别来无恙 提交于 2019-12-22 10:58:16
问题 I'm working on a browser/proxy oriented project where I need to download webpages. After sending a custom HTTP request to a web server I start listening for a server response. When reading the response, I check the response headers for a Content-Length:-row. If I get one of those, it's easy to determine when the server is done sending data since I always know how many bytes of data I have received. The problem occurs when the server doesn't include the Content-Length header and also keeps the

React PHP get POST data

*爱你&永不变心* 提交于 2019-12-22 08:36:37
问题 I'm trying to run a simple Web app over a ReactPHP Web server, but I can't figure out where to get POST data coming from an HTML form. The server is defined as: include 'vendor/autoload.php'; register_shutdown_function(function() { echo implode(PHP_EOL, error_get_last()), PHP_EOL; }); $loop = React\EventLoop\Factory::create(); $socket = new React\Socket\Server($loop); $http = new React\Http\Server($socket); $http->on('request', function(React\Http\Request $request, React\Http\Response

Expires header for Facebook JS SDK and Google Analytics

北城余情 提交于 2019-12-22 05:45:09
问题 We all know adding a far-future expiration date to static resources is a good practice to increase our websites' page load speed. So we've ensured it for all of our resources BUT the all-too-common Facebook JS SDK and Google Analytics don't do that and thus lower the entire page's speed score. Examining the headers shows Facebook do 20 minutes: Cache-Control public, max-age=1200 Connection keep-alive Content-Type application/x-javascript; charset=utf-8 Date Tue, 23 Sep 2014 04:46:38 GMT Etag