w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Configure Nginx to use cherrypy framework
You can use uwsgi for serve the cherry application. check this link: http://nileshgr.com/2012/08/27/getting-cherrypy-working-with-uwsgi

Categories : Nginx

How to configure nginx with multiple server
This should be a good lead for you towards the solution: upstream tornado { server 127.0.0.1:8000; server 127.0.0.1:8001; } upstream geoserver{ server 127.0.0.1:8080; server 127.0.0.1:8081; } server { server_name _; listen 80; location = /tornado { proxy_pass http://tornado; } location = /geoserver { proxy_pass http://geoserver; } } Hope it helps!

Categories : Nginx

How to configure PhpMyAdmin on NGINX (Windows)
server { listen 80; server_name localhost; location / { root C:MHServerwww; index index.php index.html index.htm; } location = / { root C:MHServerwww; index index.php index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root C:MHServerwww; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { root C:MHServerwww; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; in

Categories : C#

How to correctly configure Nginx for PHP (Yii framework and Zurmo)
I don't think you need the if() statement in your *.php block. In my nginx setups that's all i ever needed: # Process PHP files location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; # Include the standard fastcgi_params file included with nginx include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; }

Categories : PHP

How to configure proxy servers with puppet nginx?
Use nginx::resource::vhost The source of the repo you are using gives a breakdown of the commands you will need to use: https://github.com/puppetlabs/puppetlabs-nginx/blob/master/manifests/resource/vhost.pp

Categories : Nginx

How to configure Phalcon in the Nginx config file
This is the link to the official phalcon nginx configurations. http://docs.phalconphp.com/en/latest/reference/nginx.html

Categories : PHP

How to configure nginx + Unicorn to avoid timeout errors?
Is there a way to handle this kind of problems? Do the job in background. You should have a separate process that gets jobs from queue one by one and processes them. And since it doesn't work with user requests, it can do its job as long as needed. You don't need unicorn for this, just a separate daemon.

Categories : Ruby On Rails

How to configure nginx to try_files first, if not exists follow the request_uri
I never tried this my self before but this is how I would write it location / { # or whatever location you see fit to your requirements try_files $uri.html $uri; # I don't know if the `.` needs to be escaped `$uri.html`, you can try both }

Categories : Nginx

Configure Nginx to serve "/" from a directory already inside root
server{ root /var/www; location = / { root /var/www/home; } location / { } } Reference: http://nginx.org/r/root http://nginx.org/r/location How nginx processes a request Understanding the Nginx Configuration Inheritance Model

Categories : Nginx

How to configure nginx rules so that if one failed it serve the request using another
http://wiki.nginx.org/HttpCoreModule#try_files try_files is your friend, here you can do the order you want to try files and finaly have the proxypass upstream.

Categories : Nginx

Nginx - configure location regex for all static file in sub alias
try to add rewrite directive in sub location. Just like this: location /site1 { location ~* .(jpg|jpeg|gif|png|css|js|ico|xml|rss|txt)$ { rewrite "^/site1/(.*)$" /$1 break; root /path/to/anothersite1; } proxy_pass apache:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; }

Categories : File

configure nginx to get js and css directly from public folder of node.js express site
A 403 forbidden response may be related to the nginx process don't having permission to read the files. Check that the folder public is recursively readable by the user running nginx and change the permissions if needed: sudo chmod -R 744 /root/pathToNodeJsExpressSiteFolder/public

Categories : Node Js

How can I configure nginx and fcgi to call separate executables depending on request-uri
You can do it with nginx and fcgi. The simplest way to do this is, by using spawn-fcgi - First you will need to setup your nginx.conf. Add the following inside the server {} block - location /index { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } location /contact { fastcgi_pass 127.0.0.1:9001; include fastcgi_params; } location /view_post { fastcgi_pass 127.0.0.1:9002; include fastcgi_params; } Restart nginx and then run your apps listening same ports as declared in the nginx.conf. Assuming your programs are in ~/bin/ folder - ~ $ cd bin ~/bin $ spawn-fcgi -p 9000 ./index ~/bin $ spawn-fcgi -p 9001 ./contact ~/bin $ spawn-fcgi -p 9002 ./view_post Now the requests to localhost/index will forward to your index program and its output will go back to ngi

Categories : Nginx

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

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

TFS 2012 Configure Features Error - Unable to configure Planning Tools
Try this: Rename your User Story to "Product Backlog Item". Set the Initial State of you "Bug" to "Active". Try the Upgrade Rename your User Story Type back to "User Story". Remove the "Active" Initial State. Export your Common Process Config and add in your "Proposed" State into the Bug Configuration (see below). Import your Common Process Config. Example BugWorkItems <BugWorkItems category="Microsoft.BugCategory"> <States> <State type="Proposed" value="Proposed" /> <!-- more --> </States> </BugWorkItems>

Categories : Tfs

Any way configure to configure visual studio mvc build views release mode
Are you specifically setting something to compile the views like the Razor Generator? (http://razorgenerator.codeplex.com/) If not views in MVC are not compiled.

Categories : Asp Net Mvc

Two hosts in jdbc url
This is really about failover/clustering. jdbc:mysql://192.168.29.20:3306,192.168.29.20:6306/mysql should do it. see http://lists.mysql.com/cluster/249

Categories : Java

Switch between different API hosts
I'd like to tell you to simply use the same URL internally and externally (via DNS) but that's not what you want. I think you're asking how to conditionally call the other url. You want someAPIMethodCall to be asynchronous... so you don't want to block on the call to checking for the correct api to call. Aside from caching the results so you don't have to do this every time, you simply want to call another block based method of your own that has a completion block which passes IN a parameter of the URL to call for your real query. - (void)someAPIMethodCall:(NSDictionary *)parameters completionBlock:(void (^)(void))succesBlock failure((^)(void)):failureBlock { [self callBlockWithMyApiUrl:^(NSString *apiUrl){ AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:apiUrl];

Categories : IOS

php application on two hosts
Are you running on a load balancer? If so, $_SESSION data is being saved to disk on one of the machines on the load balancer. Then, when the load balancer switches you to the other machine, the $_SESSION data no longer exists, since the session file on disk doesn't exist on that machine.

Categories : PHP

Get the hosts for an hadoop job
Since you want to get the hostname where a mapper/reducer is currently running, you could write a few additional java lines inside the mapper/reducer to itself to find it. Perhaps : String hostname = java.net.InetAddress.getLocalHost().getHostName(); IDK if this is exactly what you need.

Categories : Hadoop

SSH Works For Some Hosts, Not For Others
First check the /etc/hosts.deny file of your work computer. That may contain lines which might suggests that certain IP may be blocked. Then check /etc/hosts.allow file. You can add your home-computers outgoing IP to your work computers /etc/hosts.allow. NOTE: This question should belong to superusers or serverfault. stackoverflow is for questions that involves coding...

Categories : Linux

Hosts disappear from MongoDB MMS
I opened a ticket with Mongo Inc. and was able to get all of my servers reporting into MMS. Not sure which events were the triggers for success, but I'll post all of the details here: After James added one of the servers back in (see previous comments) it was listed in MMS, but not reporting data. I restarted the MMS agent and the server began reporting into MMS. I also had two other servers - each a member of a different replica set that didn't show up in MMS. Mongo Inc suggested I add the servers manually to MMS using the "+ Add Host" option. Sure enough- they were identified and after about 10 minutes began reporting data. In summary- it looks like a combination of adding hosts manually and restarting my local MMS agent were necessary keys in resolving this issue.

Categories : Misc

What does 127.0.0.1. 127.0.0.1 represent in /etc/hosts ubuntu?
Go through this page. It explains beautifully that why does HBase care about /etc/hosts. As far as IPv6 is concerned, Hadoop is not currently supported on IPv6 networks. It has only been tested and developed on IPv4 stacks. Hadoop needs IPv4 to work, and only IPv4 clients can talk to the cluster.If your organisation moves to IPv6 only, you will encounter problems. See this for more details. HTH

Categories : Ubuntu

ettercap not scanning all hosts
I wrote an article about Ettercap & SSLstrip a while ago.(http://bidabe.zapto.org/?p=17) You are not doing anything wrong, if you run again and again the same command-line you will notice that "Group 2" appears erratically. Using the interactive mode with autoadd, you can see all the hosts (for this subnet) that are being cache poisoned in real-time. I believe this is a glitch.

Categories : Ubuntu

diferent name-based hosts on the same ip
you can look at ports.conf in /etc/apache2 you can add some lines there: NameVirtualhost 176.111.104.95:80 Listen 176.111.104.95:80 or better yet (if you areonly using one ip) you can change your current virtualhost from <VirtualHost 176.111.104.95:80> to

Categories : Apache

How to use the vSphere SDK for Perl with IPV6 hosts
You have two issues here. IPv6 literal addresses in a URL need to be in brackets. Your link-local address is missing an interface identifier. Specify the link-local address in brackets with the correct interface identifier. For example: https://[fe80::b6b5:2fff:fe5a:c5d8%eth0]:443/sdk

Categories : Perl

How To Prevent Cookies From Being Created Under Different Hosts
For (obvious) security reasons you can only read cookies that are set by the same domain the user requests. It doesn't matter if it is just a difference like in your example, or an entirely different domainname. What you could do in this situation (it should improve your SEO as well), is redirect (301) all traffic from the site without www to the site with www. If you're using IIS 7 or higher, you can find an example on how to do that with URL Rewrite here: http://weblogs.asp.net/owscott/archive/2009/11/27/iis-url-rewrite-rewriting-non-www-to-www.aspx

Categories : Asp Net

Update hosts within fabric script
You should set a host for the run command by using execute: from fabric.api import env, run from fabric.tasks import execute def serv_foo(): return ['bla@example.com'] def serv_bar(): return ['bla@example2.com'] def get_all_servers(): return {(k, v) for k, v in globals().items() if k.startswith("serv_")} def get_hostname(): return run("hostname") def get_hostnames(): for serv_name, serv_fptr in get_all_servers(): print(env.hosts) hostname = execute(get_hostname, hosts=serv_fptr()) print(hostname) or settings context manager: from fabric.api import run from fabric.context_managers import settings def serv_foo(): return 'bla@example.com' def serv_bar(): return 'bla@example2.com' def get_all_servers(): return {(k, v)

Categories : Python

Set chrome to ignore hosts file
No, I don't think you can, since the hosts file is an operating system wide setting. It would be easier and better to manage if you change the domain of the test server to www.example.local, so www.example.com will go to the live server. Edit: Another simple solution would be to use a browser in a virtual machine. It could be worth the effort if you need to do a full testing

Categories : Google Chrome

Esper publisher and subscriber at different hosts
EsperIO [1] would be what you are looking for [1] http://esper.codehaus.org/esperio-4.9.0/doc/reference/en-US/html_single/index.html

Categories : Misc

Windows hosts file not working
Try ping localhost. if it works, then something wrong with ip or your entry. If it does not, hosts file is bad. Pay attention where it goes. It might try ipv6. That still means that hosts file is broken. Remove everything from it and leave only your entry or localhost. Single line only, nothing else at all! Not even line breaks. Just stash it aside somewhere until problem is resolved. If it works, then there's an entry that breaks things. Try converting line endings to windows format, might help. Usually it's white space that messes with things because it's hard to notice.

Categories : Windows

Failed to add the host to the list of know hosts
Shouldn't known_hosts be a flat file, not a directory? If that's not the problem, then this page on Github might be of some help. Try using SSH with the -v or -vv flag to see verbose error messages. It might give you a better idea of what's failing.

Categories : Github

regular expression get all hosts from html
Assuming that your regex: /^(https?://)?([da-z.-]+).([a-z.]{2,6})([/w .-]*)*/?$/ Actually does parse the Urls (I haven't checked it), you could easily use a capture group to get the host: /^(https?://)?(?<host>([da-z.-]+).([a-z.]{2,6}))([/w .-]*)*/?$/ When you get the Match result, you can examine Groups["host"] to get the host name. But you're much better off, in my opinion, just using Uri.TryCreate, although you'll need a little logic to get around the possible lack of a scheme. That is: if (!Regex.IsMatch(line, "https?://")) line = "http://" + line; Uri uri; if (Uri.TryCreate(line, UriKind.Absolute, out uri)) { // it's a valid url. host = uri.Host; } Parsing Urls is a pretty tricky business. For example, no individual dotted segment can exceed 63 characters,

Categories : C#

User specific hosts in Linux
Don't create an alias. This is exactly what ssh config is for. You can add a host alias in your ssh config in ~/.ssh/config. Example: Host foo HostName 172.16.254.1 Now when you type ssh foo it will execute ssh 172.16.254.1. You can also add a user to the config. Example: Host foo HostName 172.16.254.1 User bar

Categories : Linux

can the different hosts (not ip) forwarding to the same port externally?
I don't have much experience in that, but I think you will need a third server/firewall/proxy listening for the incoming host and route it accordingly. Again, I don't have much experience in that, so I'm not sure if the firewall is able to do that.

Categories : Sockets

Calculating the number of hosts in a netmask using TSQL
Here is the SQLFiddel Demo Below is the sample Query : select (256-T.I1)*(256-T.I2)*(256-T.I3)*(256-T.I4) from ( select dbo.fnParseString(-1, '.', IP) 'I1', dbo.fnParseString(-2, '.', IP) 'I2', dbo.fnParseString(-3, '.', IP) 'I3', dbo.fnParseString(-4, '.', IP) 'I4' from (select '255.255.255.252' as IP union select '255.255.254.0') T1 ) as T Below is the Function : CREATE FUNCTION dbo.fnParseString ( @Section SMALLINT, @Delimiter CHAR, @Text varchar(100) ) RETURNS VARCHAR(8000) AS BEGIN DECLARE @NextPos SMALLINT, @LastPos SMALLINT, @Found SMALLINT IF @Section > 0 SELECT @Text = REVERSE(@Text) SELECT @NextPos = CHARINDEX(@Delimiter, @Text, 1), @LastPos = 0, @Found = 1 WHILE @NextPos

Categories : SQL

Unable to connect to any of the specified MySQL hosts in C# using SSH.Net Tunnel
I've just solved exactly this problem myself. Simply change your ForwardedPortLocal to: var local = new ForwardedPortLocal("127.0.0.1", 3306, "127.0.0.1", 3306); In your original, you were giving the source port as 22. However, your MySql connection would have been connecting to port 3306 on your local machine (which you would then tunnel across to port 3306 on the destination), so you need to ensure that the forwarded port is listening locally on 3306 to start with. In addition, I've changed localhost to 127.0.0.1. A secondary issue I tripped over was that localhost on my machine was actually resolving to ::1, an IPv6 address, and the destination server didn't 'speak' IPv6. By switching this to the 127.0.0.1 (IPv4's version of localhost), it ensures that IPv4 is used by default.

Categories : Mysql

Why is IE not resolving host names in /etc/hosts but all other browsers does
You can try follwoing steps taking a note of fact that * Resetting will reset IE to factory settings. You'll lose your existing configuration and any settings or data in IE. Judging by your love for this browser, I'm assuming there isn't any data in there that you care about. ;) However, be sure you're okay with this before following these steps * Steps : Open Tools -> Internet Options Click on the "Advanced" tab. Click "Reset" Click the checkbox for "Delete personal settings" In the Reset Internet Explorer Settings dialog box, click "Reset". When changes are done, click "Close" and then restart the browser.

Categories : PHP



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