w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
nginx + php-fpm+wordpress not working multisite
For starters, make sure that /var/run/php5-fpm.sock exits. For now just comment out chdir support until you have a working setup and then if you still want chroot support then go back and play with those settings. If I missed anything below that might help you, let me know and I'll update this. Here is a working copy of my Nginx server that is running Wordpress without any troubles: server { listen x.x.x.x:80; server_name example.com; # Character Set charset utf-8; # Logs access_log /vhosts/example.com/logs/access_log main; error_log /vhosts/example.com/logs/error_log; # Directory Indexes index index.html index.phtml index.shtml index.php; # Document Root root /vhosts/example.com/public; # Location location / { try_fi

Categories : Wordpress

Wordpress nginx preview post is 404 not found, but old posts are working
I've tried to reproduce your issue on Ubuntu 12.04+nginx+php-fpm but without effect. It means that previewing works as expected. The only difference is I've uncommented line fast_cgi_pass 127.0.0.1:9000 and commented out the other one. As I see you've put 'varnish' in tags, so maybe it's problem with varnish as suggested here -> http://wordpress.org/support/topic/nginx-cant-preview-posts-404-error

Categories : Wordpress

Plesk 11.5 php-fpm.sock failed - resource temporarily unavailable & 502 Bad Gateway NGINX errors
Just to try localize the issue: Switch pm = ondemand to pm = dynamic increase pm.start_servers and pm.min_spare_servers to 4 add pm.max_requests = 500 add pm.status_path - read docs what is it and how it can be used. restart php-fpm service and observe for a while. This changes can be overwritten by plesk, so be aware.

Categories : Nginx

Socket.io connection failing when passing through Nginx
There's a special configuration for websockets described on nginx website. You may want to try either of them to see which one works best for you (if works at all). But as noted in Socket.IO wiki, it's best to use HAProxy or Varnish.

Categories : Node Js

Node.js Socket.io WebSocket Nginx Configuration?
Try to use the proxy_set_header: server { listen 80; server_name app.local; root /home/app/public; passenger_enabled on; rails_env development; location /any_location { proxy_pass http://localhost:3001/realtime_page; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } http://blog.joshsoftware.com/2013/05/28/websocket-over-nginx/ What is the server responding (header) ? How does the request header looks like?

Categories : Node Js

Can socket objects be shared with Python's multiprocessing? socket.close() does not seem to be working
The problem is that the socket is not closed in the parent process. Therefore it remains open, and causes the symptom you are observing. Immediately after forking off the child process to handle the connection, you should close the parent process' copy of the socket, like so: while True: print "accepting" c, _ = s.accept() p = Process(target=process, args=(c,)) p.start() print "started process" c.close()

Categories : Python

Nginx proxy_pass to another port with Wordpress
why create only 1 server with if's in it, separate the servers server { listen 80; server_name bugs.example.com; proxy_pass http://example.com:88; } server { listen 80; server_name mail.example.com; proxy_pass http://example.com:1234; } server { listen 80; # the rest of your main server # }

Categories : Wordpress

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

Heroku Deployment : Discourse Assets precompile
@ http://shcatula.wordpress.com/2013/07/08/deploying-discourse-to-heroku/ you have a detailed description of deployment of Discourse to Heroku. It also links to a gist with a shell script that does the entire job of pre-compiling and preparing your deploy. The shell script pretty much explains all the steps needed. Hope it helps!

Categories : Ruby On Rails

Nginx times out when sending email with php (in wordpress), but the mail still sends
well you can try increasing those variables, i don't know the actual default value, usually around 30 or 60 seconds. client_header_timeout N; client_body_timeout N; send_timeout N; fastcgi_read_timeout N; you can set them in the location that sends the email for example so you don't set this as a default value for all locations. Of course you should replace N with a time period, like 30s for 30 seconds or 2m for 2 minutes.

Categories : PHP

what parts are necessary for a custom omniauth oauth2 strategy for integrating with discourse
Going the OAuth2 route seems pretty reasonable. An alternative would be to use the Omniauth Identity Strategy. [1] With the Omniauth Identity Strategy you could authenticate against your database by having read-only access. It's also possible to authenticate against an JSON API. [2] [1] https://github.com/intridea/omniauth-identity [2] https://github.com/intridea/omniauth-identity#custom-auth-model

Categories : Ruby On Rails

nginx add_header not working
What does your nginx error log say? Do you know which add_header lines are breaking the configuration? If not, comment them all out then enable them 1 by 1, reloading nginx to see which one(s) is/are the problem. I would begin by commenting out the block: add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; add_header PS 1 The problem could be that you're setting headers not supported by the core httpHeaders module. Installing the NginxHttpHeadersMoreModule may be helpful. Also, try replacing the two add_header lines int the location ~*

Categories : PHP

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

NodeJS working behind Nginx
You might want to try to set up the proxy_pass directive without a trailing URI part '/', like this: proxy_pass http://backend; If you specify the URI, it'll be used in the request sent to your backend node.js app. Instead of a request for /room/create, node.js will get a request for / as defined by your proxy_pass setting. For more information, please see the nginx proxy_pass documentation: http://wiki.nginx.org/HttpProxyModule#proxy_pass

Categories : Javascript

Will select (or epoll) mark a socket as readable if there is data on the socket prior to adding the socket to the list of monitored file descriptor
will select now immediately let me know that the socket is readable? Yes. What, if in step 5, the peer does not send me any data but say, since a FIN. Will select still tell me that the socket is readable Yes. in summary, the question is if select(or any of its variants such as epoll) indicate that a socket is readable if there has been any activity on the socket prior to including the socket in the list of monitored file descriptors and assuming that the application has read no data from the socket Yes.

Categories : Sockets

Why is SSL redirect not working with force_ssl and Nginx?
First guess... the port 80 server block does not pass the host through, maybe that's it? proxy_set_header Host $http_host; The SSL block does, but if you start at the non-SSL side and Rails picks it up, it might not have the full header there?

Categories : Ruby On Rails

nginx rewrite module not working?
You seem to have mixed different bits from different how-to's, without understanding them. Observe: rewrite ^(.*)$ index.php?/$1 last; #question mark, typo? location ~ .php$ # matches end of request_uri fastcgi_split_path_info ^(.+.php)(/.+)$; # matches .php followed by a slash For the third statement to match, .php is never at end of request_uri, so this statement will never match in this location. Remove the question mark from the first statement, remove the dollar sign from the location. Then add: fastcgi_param SCRIPT_FILENAME $document_root$ fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_split_pathinfo; to the location block. Try to understand from the documentation and try to further restrict the location block.

Categories : Nginx

nginx location index directive not working
If you explicitly request /index.html, is it served? If not, you might want to add an explicit root /path/to/root; to your server {} block. Also verify that index.html has the correct permissions. This will help with troubleshooting: It will force a 404 if the root index.html is not found. If that happens, at least you can check the logs to see were it was looking: location = / { index index.html; } Also, be sure to do nginx -s reload when changing the config.

Categories : Nginx

redmine installation not working through nginx and thin
The error is because your firewall "iptables" blocked the port. Rollback your iptables config, then issue the follow command: iptables -I INPUT -i lo -p tcp --dport 3123 -j ACCEPT Remember to save the setting by: service iptables save More information about iptables: https://help.ubuntu.com/community/IptablesHowTo p.s. sudo may be needed for the above commands.

Categories : Nginx

Text2wave festival not working via nginx php exec
My guess would be that you've got shell execution disabled in the php.ini configuration file used by your web server. Try opening /etc/php5/fpm/php.ini file, finding the disable_functions directive, and making sure that none of the following functions are present in the value of the directive: shell_exec,exec,passthru,system

Categories : PHP

Nginx rewrite some matching rules are not working
Actually i don't like neither of the methods, it might be working but it's not really the best way to write it, so lets try something different. location *~ ^/(contact|privacy|terms|faq)/?$ { try_files $uri $uri/ /index.php?v=$1; } location *~ ^/(twitter|facebook|login)/?$ { try_files $uri $uri/ /index.php?v2=$1; } location / { try_files $uri $uri/ /index.php; } o and I never heard of a last; break; it's probably working only because nginx is ignoring the last part of it, it's either a last or a break,

Categories : PHP

CodeIgniter, NGINX inside folder not working
Try the following, works a dream for me. Don't forget to change the fastcgi_pass, and backup your current config before you try it. server { listen Server IP:80; server_name domain.name; access_log /var/log/nginx/access.log; root /path/to/www; index index.php index.html index.htm; # enforce www (exclude certain subdomains) # if ($host !~* ^(www|subdomain)) # { # rewrite ^/(.*)$ $scheme://www.$host/$1 permanent; # } # enforce NO www if ($host ~* ^www.(.*)) { set $host_without_www $1; rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent; } # canonicalize codeigniter url end points # if your default controller is something other than "welcome" you should change the following if ($request_uri ~* ^(/wel

Categories : PHP

nginx gzip not working on browser but curl works
Your curl command works because it sends a HEAD request, instead of a GET request. Try curl with verbose mode: curl -Iv -H "Accept-Encoding: gzip,deflate" http://www.ihezhu.com/ You will get the same result as in browser with curl -i -H "Accept-Encoding: gzip,deflate" http://www.ihezhu.com/ "text/html" is always compressed. So it has nothing to do with gzip_types directive. This happened to me before when my upstream server was using http 1.0 instead of http 1.1. Have you tried the following? gzip_http_version 1.0; [update] Your nginx compile option seems normal. It's hard to understand how url length directly affects nginx on gzip. Checked the nginx source code. nothing on url is used to determine gzip. Based on the source code, there are 2 possible causes: Your php code ret

Categories : Nginx

nginx reverse_proxy with axis camera - default rewrite not working
Try replacing your proxy_redirect with this line proxy_redirect http://192.168.0.205:80/; http://192.168.0.205:80/camera/; I don't know what your Location header says exactly, but you should get the idea, replace the IP with a hostname or whatever the redirect is trying to take you, you're simply telling nginx to append /camera to whatever redirect the website asks you to do

Categories : Nginx

Munin dynamic graph zoom (dynazoom) not working (CentOS6,nginx,php-fpm)
This is a bug related to SELinx in RHEL according to https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1000736. Description of problem: zooming doesn't work when selinux is in enforcing mode Version-Release number of selected component (if applicable): munin-2.0.17-1.el6.noarch selinux-policy-3.7.19-195.el6_4.12.noarch selinux-policy-targeted-3.7.19-195.el6_4.12.noarch Steps to Reproduce: 1. click on munin graph to zoom in Actual results: no graph image Expected results: graph image Additional info: it works with selinux in permissive mode If you disable SELinux it work fine: sudo setenforce 0 According to the last comment in the bug report this should be fixed in RHEL 6.5 (Centos should pick it up).

Categories : Linux

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

Simple if statement not working in wordpress echo is working
Do a var_dump($_map); and see what returns it might be a case issue or is doesn't return map. oh and if you want to refactor it to be a little better use === then it won't type cast it but meh it is a string so not much difference.

Categories : PHP

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

Socket.io broadcast to not working
Not really sure but I think you can send a broadcast only on connection. You can try this: var room = "1"; var chat = io.connect("localhost:3700/"); self.chat = chat; chat.on("connection", function(socket){ socket.emit("room", room); socket.on('message', function (data) { self.receiveMessage(data); }); chat.broadcast.to(room).emit('send',"HEllo"); }); Of course you can also send the broadcast in a separate handler, i.e.: var room = "1"; var chat = io.connect("localhost:3700/"); self.chat = chat; chat.on("connection", function(socket){ socket.emit("room", room); socket.on('message', function (data) { self.receiveMessage(data); }); socket.on('foo event', function(data) {

Categories : Node Js

Socket.io and Redis Pub/Sub not working
I didn't see you set redis as store in socket.io server. Some example I did for your reference: // start up express server along with socket.io var express = require('express'); var server = express(); var socket = require('socket.io'); var io = socket.listen(server); // socket.io io.set('store', new socket.RedisStore); // set-up connections... io.sockets.on('connection', function(socket) { io.emit('an event sent to all connected clients'); socket.on('some-event', function(rooms) { ... }); }); You can read document links below: Configuring Socket.IO socket.io github site

Categories : Javascript

Why is socket not working when multithreaded?
This is too long for a comment. The code as posted would not work at all, due to declaring: struct sockaddr_in* from; and then using from like this: r=recvfrom(Socket,message,_max_message_,0,(struct sockaddr *)&from,&SenderAddrSize); You are paasing the address of the address of struct sockaddr_in instead of only its address. Is shall be: r=recvfrom(Socket,message,_max_message_,0,(struct sockaddr *)from,&SenderAddrSize); However if doing so you are missing to allocate memory to from. So propably struct sockaddr_in* from; is a typo and should have read: struct sockaddr_in from = {0}; ?

Categories : C

Socket Timeout is not working in Servlet
SO_TIMEOUT (which is set by socket.setSoTimeout) only affects socket.getInputStream().read(). To specify connect timeout, specify a second parameter to socket.connect: socket.connect(new InetSocketAddress(ip, Constant.PORT), 1000);

Categories : Java

Socket.io connection via IP address not working
Make sure that your port (for socket.io) is forwarded by your router. And you are using public IP (static). As well you should remember that most browsers will not allow to connect via WebSockets to another address/port from the page. For security reasons, your IP/Domain and Port should be the same as your IP/Domain and Port you server html and js from.

Categories : Node Js

Socket writing not working properly c#
You might need to flush the stream before your start reading using _serverStream.Flush(). Another problem might be that in your question you say you need to connect to port 21000, but in your code you connect to 2100, which might be a typo in either place, but should be fixed ;-) In addition to flushing the stream, your server might also be waiting for an "end of message" indicator?

Categories : C#

Express Socket.io example server not working
The problem is you are creating app after you are creating io. So this line , io = require('socket.io').listen(app); is effectively the same as , io = require('socket.io').listen(undefined); remove this line var app = express(); And somewhere between the first line and io = require('socket.io') add , app = express()

Categories : Node Js

Socket programming in python counter not working
server.py accept a client, then receive only once, and accept another client.... You need loop to continuous receive data from client. Try following code: import socket s = socket.socket() host = socket.gethostname() port = 12340 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() pressed = 0 while True: print 'Got connection from', addr data = c.recv(1024) if not data: break pressed = pressed + 1 print data, 'pressed count', pressed NOTE Your code and this code does handle one client at a time. To handle multiple client, you need multiprocess / multithreading / select / ...

Categories : Python

Socket.IO not working in Chrome and Firefox on Windows
I just found out that it was due to the anti virus of the person who was having issues in Chrome and Firefox. Apparently it blocks websockets and even polling on those browsers. I also change the port from 8080 to 8079.

Categories : Node Js

TCP Socket programming not working between desktop and android tablet
It must be the firewall that blocks the connections. You can disable it and try again. Should any more issues, please use wireshark to capture some packets to check where the problem is. You can try "netstat -n" on both Linux or Windows to see if your server socket is binding and listening there.

Categories : Java

Socket.io auto disconnect after 2 hours of inactivity not working
I guess it has to be with the closures... Where are you declaring forcedc? and where are those 2 pieces of code in your whole code? Apparently the forcedc variables doesn't update as they should, which could mean one of them is a local copy

Categories : Node Js

Streaming socket service with EventMachine in Ruby not working
Both your server and client work fine. Try and connect with the client to google.com:80 for example and you will see it works. For the server just do telnet localhost 10000 and you will see here too that the server starts printing out test data. But the problem is your server is not compatible with your client. Your client expects a HTTP server, but the server you're running is a simple EM::Connection that does not serve HTTP clients. So when the client connects it expects a standard HTTP response, but all it gets is test data. So the stream part of the code will never get called. You need to either run a HTTP server, or change the client to use EM::Connection instead of HttpRequest. I.e. both client and server need to talk the same protocol.

Categories : Ruby



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