w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Node.JS reverse proxied with Nginx on diffrent machines
As I understand your question, you serve static content from your Node app. Better way is to move your static content from your Node app and let Nginx serve the static contents. Simply copy your static content (eg. /js, /css, /images) into your nginx www directory. In your case you will get also much better performance and you will save your raspberry resources. If it will interfere with your existing www content, move them to extra directory (eg. /assets/js, /assets/css, ...) and change your html accordingly.

Categories : Node Js

serving static files with nginx on diffent machine and gunicorn on a diffrent one for a django production
Please can any one advice me the right way to do this in a production environment. Use a network attached storage (NAS) device that is mounted on both machines. This is how you would do it the right way in production. You could do all sorts of other workarounds - like rsync, nfs, etc. however the most reliable way to have this working is with a proper NAS.

Categories : Django

How call volume slider function in diffrent keyFrames with diffrent sound channels?
An AudioSource is attached to a GameObject for playing back sounds in a 3D environment. In order to play 3D sounds you also need to have a AudioListener. The audio listener is normally attached to the camera you want to use. Whether sounds are played in 3D or 2D is determined by AudioImporter settings.

Categories : Actionscript

htaccess : wildcard folders and url
Do you still get a 500 internal server error if you wrap all of your rewrite rules inside an IfModule container? E.G. <IfModule mod_rewrite.c> # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/.*$ /$1/index.php [L] </IfModule> If you stop getting the error, but rewriting is still not working, that means you have to turn on the rewrite module. How this is done is entirely dependent on your setup, your hosting services setup, and/or whether you have access to the httpd.conf file.

Categories : Htaccess

PHP htaccess to nginx
@Harinder: There must be some RewriteCond based on which you're applying this RewiteRule The reason why i am saying this is that, according to your RewriteRule RewriteRule ^(.*)$ /all_drivers.php?id=$1 [QSA] whatever that comes as a request, you are sending it to all_drivers.php. And if this is the desired rule, then all the request, no matter what will be send to this file only. Also it will be nice if you give us the complete .htaccess code segment that you want to be translated. And please check if you have configured php execution block correctly with all the required fastcgi directives as this blank php's output comes in the case if you have not passed SCRIPT_FILENAME fastcgi directive.

Categories : PHP

htaccess to nginx (help)
Please try the following: server { listen 80; server_name www.website.com; return 301 $scheme://website.com; } server { listen 80; server_name website.com; root /path/to/root; location / { try_files $uri @rewrite; } location @rewrite { rewrite ^/([a-z]+)/?([0-9a-zA-Z]*)/?.*$ /index.php?a=$1&q=$2 last; } }

Categories : Apache

url rewrites removing folders .htaccess
The problem should be on the last rule: what you need is a negative look behind ie anything not preceede with articles/artificial The regex should be: ((?<!(articles/artificial)).*) But this probabilly does not work since the .* is variable length (see regex look arrounds) A solution could be replacing the negative look behind with a positive look ahead that allows for variable length. So your rule could be: RewriteRule ^(?!.*?articles/artificial.*?)(.*)$ /articles/artificial/$1

Categories : PHP

Deny access to all folders except a few ones using htaccess
You are getting a 500 error because the <Directory> container cannot be used in an htaccess file (which is essentially all inside a directory container for the directory that it's in). What you need to do is remove the <Directory> container from your htaccess file, and leave the Deny from all bit: htaccess file in your document root: # Refuse direct access to all files Order deny,allow Deny from all Allow from 127.0.0.1 Then create an htaccess file in the uploads/files/, uploads/images/pages/ and uploads/images/store/ (and whatever other directories that you want to allow access to): Allow from all

Categories : Htaccess

nginx and .htaccess are working together, is this possible?
Yea it's possible but there's a trick, the server has both apache and nginx installed, nginx listens to port 80 and apache listens on any other port, nginx would serve the assets directly ( CSS, JS, HTML, etc ) and pass the PHP or whatever app it is to apache, reduces the load on apache a bit, but consumes a little bit more memory because you have 2 servers running.

Categories : Apache

.htaccess not working to hide folders in urls
You can do this using url routing functionality. $route['are-string-beans-all-right-on-the-candida-diet'] = "folder1/folder2/are_string_beans_all_right_on_the_candida_diet.php";

Categories : PHP

What should be nginx configuration while switching from htaccess?
I was wrong. This is a path mistake. I was changing file at different location. I never found clear documentation on internet for this. When I was doing some stuff on nginx server found that nginx does have sites-enabled directory which holds a file named default which holds server level configuration. I changed index.html to index.php and everything works!!!

Categories : Htaccess

Convert apache htaccess to nginx RewriteEngine
Try this: location / { rewrite ^/playlist/(.+).txt$ /video.php?action=playlist&file=$1 last; rewrite ^/([a-z0-9]{32})/([a-zA-Z0-9/+=]+)/([0-9]{1}).(flv|mp4)$ /video.php?url=$2&base64=1&action=play&sec_hash=$1&quality=$3 last; rewrite ^/([a-zA-Z0-9/+=]+)/([0-9]{1}).(flv|mp4)$" /video.php?url=$1&base64=1&action=play&quality=$2 last; rewrite ^/download/([a-z0-9]{32})/([a-zA-Z0-9/+=]+).(flv|mp4)$ /video.php?url=$2&base64=1&action=download&sec_hash=$1 last; rewrite ^/download/([a-zA-Z0-9/+=]+).(flv|mp4)$ /video.php?url=$1&base64=1&action=download last; rewrite ^/([a-zA-Z0-9/+=]+).jpg$ /video.php?url=$1&base64=1&action=thumb last; }

Categories : Nginx

How do I write .htaccess to permanently redirect multiple folders to subdomain with working query string?
Try adding this to the domain.com document root's htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC] RewriteRule ^folder(.*)$ http://folder.domain.com/$1 [L,R=301] And in the htaccess file for folder.domain.com (of if it's the same, just append it): RewriteEngine On RewriteCond %{HTTP_HOST} ^folder.domain.com$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]*)$ /index.php?source=$1 [L]

Categories : Htaccess

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

Batch: Create a list of folders and then copy multiple files/folders into all of them
Try this: @echo off &setlocal cd /d "RootFolder=X:folder omy data" for /d %%a in (*) do xcopy "_TEMPLATE" "%%~fa" /sihrky For xcopy options see xcopy /?, to test the command without writing add option /l.

Categories : List

How to stop threads of following type in Java used for watching folders for files using WatchService for folders by using jToggleButton
There is a Thread.stop() method, but is has been deprecated, because it's unsafe. Instead of using the deprecated method(s), you can modify some variable to indicate that the target thread should stop running.

Categories : Java

Batch file creating folders in all folders of current directory
Total rewrite of answer. This will make a "Outlook Archive" folder in only the DataMy Documents subfolders of wherever the batch file resides. for /f "delims=" %%i in ('dir /ad/s/b') do if EXIST "%%iDataMy Documents" MKDIR "%%iDataMy DocumentsOutlook Archive" pause Credit to here

Categories : Windows

MATLAB: Opening and Editing Files nested in folders in folders
Check out subdir! On the file exchange, its an awesome function that can return all folders and all files in expansive subfolders, and you can filter file names by extension and whatnot. http://www.mathworks.com/matlabcentral/fileexchange/15859-subdir-a-recursive-file-search

Categories : Matlab

JQuery File Upload and Carrierwave to Detect Folders and Sub Folders
I don't think this is possible. See here: http://www.codeproject.com/Questions/573788/HoeplustoplusGetplustheplusOriginalplusfilepluspat It appears that you can't know the context of the uploaded file on the source operating system. Therefore you can't create it's original parent folder structure on your system.

Categories : Jquery

Delete all folders except 2 lastest folders in Windows
for /f "skip=2 delims=" %G in ('dir /B /ad-h /o-d') DO echo going to delete %G For /f to process lines of "output" from single-quoted DIR... Delims= is better. tokens=* will work here, but suppresses leading spaces. /b to suppress header output from dir /o-d for REVERSE-date order. You want to KEEP the two skipped dirs, which occur FIRS in a reverse-date sort. ...good echo safety measure.

Categories : Windows

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass http://127.0.0.1:81; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:81; } In apache you create a virtual host <Virtua

Categories : Apache

WEB API authentication from diffrent platforms
There is nothing available out of box currently, to the best of my knowledge. With OWIN, there are things coming up. You can take a look at Katana source code (Microsoft.Owin.Security). For JSON Web Token, Microsoft has the JSON web token handler. More info here. The JSON Web Token Handler can both create and validate JWT. You can use the same library to issue and validate JWT respectively from the token issuer and your web API. Creating all these infrastructure is not easy. Thinktecture identity server and identity model can make these tasks easier for you. Both are open source and you can take a look at the source code in github. Check out this and this. Another good resource is Dominick's blog.

Categories : Azure

Passing diffrent value to gridview hyperlink
Try this display: none; <asp:HyperLink ID="ShowDetailsHL" runat="server" Text='<%# Eval("Counts") %>' <%# Eval("Counts").ToString() != "0" ? "" :"style='display:none;'"%> NavigateUrl='<%# GetActionLogsDetailScript(Eval("Action").ToString()) %>' />

Categories : C#

Different service parameters in diffrent bundles?
You can use symfony service configurator http://symfony.com/doc/current/components/dependency_injection/configurators.html

Categories : Symfony2

How to synchronise two databases that have used by two diffrent application
Replication is not going to help you out here very much as the table structures are different. An approach I've used before to tie together two systems like this is to write a small api wrapper around the new account, update, login and logoff process. Then when user creates a new user or logs in or logs off or updates application A then you can issue a curl https call via php from server A to your api on Application B and update the state over there. If you can expose the same subdomain on both applications ie, appA.mydomain.com and appB.mydomain.com they can even share cookies which makes single login and logoff easier as your api integration can set the proper logon cookies for both applications at the same time. You'll have to dig in a little bit on how ApplicationB works to buil

Categories : PHP

IE top left corner border diffrent
I don't think either of the browsers is wrong in this case; they've just implemented the same standard slightly differently. The corner of the border in this sort of case is specified to be a diagonal line separating the two colours. Of course when it's only a single pixel wide, a diagonal line is fairly meaningless; the spec doesn't say to prefer the vertical or horizontal line, so there's room for slightly the different interpretations you see here. If you really need to guarantee the colours in this case, I would suggest using :before and :after to create the borders on the sides separately from the main box.

Categories : CSS

Diffrent x values while using multiple y-axis in achartengine
This was a bug. I fixed it for you. You can download a version including this fix here.

Categories : Android

plotting diffrent curves in one plot in matlab
Make some data: x = 1:0.1:100; y = 1:5; for i = y z(i,:) = sin(i*x); end Plot it: figure hold on for i = y plot3(x,i*ones(size(x)),z(i,:)) end Modify the plot aspect and view: daspect([100,2,2]) view(45,60) Does that do roughly what you need?

Categories : Matlab

Get result from two rown in two diffrent tabels mysql
Maybe try this.. I would guess it must be something like this SELECT name, goals, sum(playtogoal) as goals, createdate, logtype FROM bold_players as ps LEFT JOIN bold_playlog as pl ON ps.id=pl.logplayer WHERE pl.logtype = 1 AND pl.createdate > $saesonstart GROUP BY ps.id ORDER BY name ASC I would make a LEFT JOIN since there could be players without a goal and they would be shown too

Categories : Mysql

php sorter script only outputting the same data even though i am asking it to do diffrent
You aren't using the data1 and data2 fields anywhere in your PHP. I think instead of this: list($email, $password) = $mp; you need $email = $mp[$_POST["mail"]]; $password = $mp[$_POST["pwd"]]; It's also worth noting that the values supplied in those two fields will be zero based.

Categories : PHP

PHP - compare two diffrent type variable bug or issue
$b gets typecast to a number so it can be compared to $a, therefore the resulting $b (the number 1000) will be equal to $a. You should use === instead of == if you want to find out if the two variables are identical, not just equal. === doesn't typecast, and only returns true if both variables are of the same type and equal.

Categories : PHP

ZK CTRL Key or Hot Key creating issue with diffrent browsers?
I'm afraid it's not possible to change/disable the browser level keyboard controls from our application (read: from JavaScript); it's a security & usability issue. There are plugins for both Firefox and Chrome (the latter is made by Google) to change these browser-level controls.. but that doesn't help you as you would need all your users to reconfigure their browsers. Using native HTML elements, you get a lot of controls for free. For example: select all in text fields. If your use case can't work within those bounds then I'd suggest you shy away from this approach (or these keyboard commands) as it's a usability conflict.

Categories : Java

Accessing infinispan cache across diffrent network
You probably need a cross-site replication to get that kind of architecture working as expected. The idea is that each network forms its own cluster and then these are linked via a relay.

Categories : Java

Jquery Ui Draggable updating diffrent css attributes
Sure you can $( "#box" ).draggable({ stop: function( event, ui ) { $( "#box" ).css('margin-top',$("#box").offset().top).css('top',0); $( "#box" ).css('margin-left',$("#box").offset().left).css('left',0); } }); http://jsfiddle.net/CnDfF/3/

Categories : PHP

how to display data with ajax in diffrent dom elements?
Use jQuery for this: $.ajax({ type:'GET', url:'url/to/the/file.php', }.done(function( msg ) { $('#id-of-element').html(msg); $('.class-of-other-element').html(msg); // another element $('.class-of-another-element').html(msg); // another element }); Explanation: type: GET // type of http request to the file, could also be POST url: 'url/to/the/file.php' // provide the file and path to file to communicate with .done (function(msg)) { // when ajax request is completed (if), then assign the variable 'msg' with the contents of the return. $('#id-of-element').html(msg); // assign the return data to the html element of your choice. EDIT: If you're expecting 2 variables, in the PHP file return them like this: echo $var1."/".$var2 // where '/' is a symbol you never

Categories : PHP

call same classes name in diffrent package using loop in java
You can use reflection - Class<?> clazz = Class.forName("pkg_" + i + ".operation"); Object obj = clazz.newInstance(); String output = clazz.getMethod("oper").invoke(obj, 5); But... normally you must not do that and it's a sign of bad design. Instead, use an interface and multiple implementations of it, possibly with a factory. Also, you are not following the java naming conventions.

Categories : Java

How to create two diffrent apps from same android source code
You must change the package name in the AndroidManifest.xml of one of the apps; this is the key Android uses to identify an application. While it's possible to modify the manifest of an APK after it's been built, it's not always reliable.

Categories : Android

PHP Mysql select multiple tables diffrent row names
If I understand correctly you want to use UNION ALL SELECT userid, username ,userlevel, ip, password, salt FROM ( SELECT userid, username, userlevel, ip, password, salt, useremail FROM users UNION ALL SELECT admin_pid, uname, admin_type, ip, password, salt, admin_email FROM admins ) q WHERE useremail = ? or SELECT userid, username, userlevel, ip, password, salt FROM users WHERE useremail = ? UNION ALL SELECT admin_pid, uname, admin_type, ip, password, salt FROM admins WHERE admin_email = ? Note: In order for it to work number of columns, their positional order and data types from both SELECTs should be the same. You have no column with name userlevel in admins table, so I was improvising putting admin_type instead. If it's not the case you eth

Categories : PHP

How to use diffrent array values each time ajax is called?
Set your m variable outside the function: m = 0; window.setInterval(function(){ //do more stuff now Then run a check to verify that m is not greater than the array length. if (m < episode.length) { //m is still within the array length, do stuff } else { return; //m is too big, bail }

Categories : Ajax



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.