w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
When do I need to restart nginx
Probably only when you change its configuration, if you are referring to when your django code changes you have to restart the uwsgi server, usually "touch"ing the wsgi.py file is enough to instruct the uwsgi server. Changes in static files don't require the uwsgi restart (because you usually serve them directly with nginx), and if you don't use cached template loaders, but only the default filesystem loader, you don't require the restart when changing a template either. Note that the cached template loader is usually suggested in production.

Categories : Django

How do i restart nginx only after the config test was successful on ubuntu?
Actually as far as i know, nginx would show an empty message and it won't actually restart if the config is bad, the only way to screw it up is by doing an nginx stop then start again, it would succeed to stop but fail to start.

Categories : Ubuntu

How to disable application restart after deleting a directory In ASP.NET 4?
You can't prevent the Application Pool Recycling, and doing so is the wrong way to achieve things anyway. Instead you should not delete any files or directories within your application directory. For temporary data you should use the temp directory, for persistent data you should store it in a separate location. Also if you care about your sessions and cache to be persisted after a application pool recycle, you should additionally store it in a persistent data storage and reload it.

Categories : Asp Net

fluentd logging nginx realtime
Fluentd's in_tail isn't designed to catch up that amount of log rotation. I recommend you to use nginx Fluentd module instead. https://github.com/fluent/nginx-fluentd-module

Categories : Ruby

Logging a variable set by nginx's Lua module
You need to define the variable $foo before the Lua module can use it. Check the doc for an example defining the variable within the location directive before utilizing it.

Categories : Nginx

Really logging the POST request body (instead of "-") with nginx
Nginx doesn't parse the client request body unless it really needs to, so it usually does not fill the $request_body variable. The exceptions are when: it sends the request to a proxy, or a fastcgi server. So you really need to either add the proxy_pass or fastcgi_pass directives to your block. The easiest way is to send it to Nginx itself as a proxied server, for example with this configuration: location = /c.gif { access_log logs/uaa_access.log client; # add the proper port or IP address if Nginx is not on 127.0.0.1:80 proxy_pass http://127.0.0.1/post_gif; } location = /post_gif { # turn off logging here to avoid double logging access_log off; empty_gif; } If you only expect to receive some key-pair values, it might be a good idea to limit the reques

Categories : Http

How can I disable nginx logging with limit_conn and limit_req?
One solution is to enable error_log just where it is needed. server { error_log /dev/null crit; location ~.php$ { error_log /var/log/nginx_error.log; } }

Categories : Nginx

Nginx + emacs - clearing file results in php errors not logging?
In your FPM Pool Configuration file you can add specific values instead of editing the php.ini file. Here is what I have in my development: php_flag[display_errors] = on php_admin_value[error_log] = /vhosts/example.com/logs/php_error_log php_admin_flag[log_errors] = on You would normally add these to the end of the file. You may already see a few examples pre-packaged there too. Don't forget to restart FPM after making the changes of course.

Categories : Emacs

Django, nginx and uWSGI caching results until uWSGI/MySQL restart
I had the same behavior and found this post https://plus.google.com/u/0/101898908470597791359/posts/AuMJdgEo93k Adding this line on settings.py (only the OPTIONS key) on Django: DATABASES = { 'default': { 'OPTIONS': { "init_command": "SET storage_engine=INNODB, SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED", } } } seems to have resolved the problem.

Categories : Mysql

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

Logging from thread: Thread exits when logging to INFO and higher, runs normally when logging to DEBUG
How is your logger object configured? It is possible to configure different handlers for different log levels and they could be failing. See https://docs.djangoproject.com/en/1.3/topics/logging/#configuring-logging Also look at this note http://docs.python.org/2.7/library/logging.html?highlight=logging#thread-safety. May be the case. Update: You may also try to use catch-all exception handler to see what's going on inside your thread. Some thing like this: def func(): try: logger.info("Some informational message") time.sleep(15) print "And we are done here" except: print "We are interrupted" pprint.pprint(sys.exc_info()) Update2: As seen in http://hg.python.org/cpython/file/af18829a7754/Lib/concurrent/futures/_base.py#l343. done() meth

Categories : Python

How some services start without restart where as some require restart
You shouldn't be directly manipulating the registry to create a service. You should be using the service control manager API's to create and if desired start the service. The registry values are documented but they are still private to the API and only take effect upon reboot. Using the API will take affect immediately and the registry changes are done by the API. If you are using Windows Installer you can let the installer handle all of this for you by using the Windows Installer's ServiceInstall and ServiceControl tables. Some services have dependencies on resources that aren't available until after a reboot. One example might be a locked file that will be overwritten during startup via the Pending Files Rename Operations pattern. Another gotcha is if the service has a dependen

Categories : Sql Server

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

Exporting a logging properties file from Solr logging level editor
The settings are not persistent and just modified dynamically at runtime. So you have to set the log levels accordingly into the log properties and use it. LogLevelSelection class handles change in the log levels and sets the level. Relevant code :- Logger logger; LogManager logManager = LogManager.getLogManager(); if ("root".equals(name)) { logger = logManager.getLogger(""); } else logger = logManager.getLogger(name); if ("unset".equals(value)) { if ((logger != null) && (logger.getLevel() != null)) { logger.setLevel(null); log.info("Unset log level on '" + name + "'."); } } else { Level level = Level.parse(value); if (logger == null) logger = Logger.getLogger(name); if (logger.getLevel() != level) {

Categories : Solr

JPA + Hibernate + java.util.logging (JDK logging): show sql queries with arguments
Alternative way is to use JDBC Driver Proxy logging library like log4jdbc log4jdbc uses the Simple Logging Facade for Java (SLF4J) and supports below logging systems:- Log4j java.util logging in JDK 1.4 logback Jakarta Commons Logging It support showing SQL Queries with parameters ..here is an excerpt from their documentation jdbc.sqlonly :- Logs only SQL. SQL executed within a prepared statement is automatically shown with it's bind arguments replaced with the data bound at that position, for greatly increased readability

Categories : SQL

centralized logging method and logging current line number
You can use the inspect package to find the calling line of code. I use this method to mark a function as deprecated and then track down the callers (in your unit tests of course). You can adjust to your logging needs. Tattletale logging In the file that will log (a.py): import logging # of course you have this import inspect # some lines to set logger log = logging.getLogger('some_loger') log.addHandler(logging.StreamHandler()) class SomeClass: def log_it(self, log_text): log.warn("DEPRECATION WARNING: {0[3]} was called from {1[3]} at line {1[2]} in {1[1]}".format(*inspect.stack()[:2])) In the "child" file (b.py): from a import SomeClass class MyOtherClass(SomeClass): def some_method(self): self.log_it('let me log this text')~ b = MyOtherClass() b.so

Categories : Python

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

Logging different project libraries, with a single logging library
Instead of writing to the file at each logged message (which is the source of your slow down), you could write your log messages to the Logger Library's ScriptDB instance and add a .write() method to your logger that will output the messages in one go. Your logger constructor can take a messageGroup parameter which can serve as a unique identifier for the lines you would like to write. This would also allow you to use different files for logging output. As you build your messages into proper output to write to the file (don't write each line individually, batch operations are your friend), you might want to remove the message from the ScriptDB. However, it might also be a nice place to pull back old logs. Your message object might look something like this: { message: "My message", c

Categories : Google Apps Script

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?
It sounds like you're looking for the Concave Hull of the data set. Unfortunately, I don't know of any pre-canned algorithms, but the link references a paper that another developer was starting from, as well as some sample code, so maybe that'll help you in the right direction.

Categories : C#

Deleting item of listview from database but it is not properly deleting
The arg2 is NOT the ID of your item, take a look at the official documentation to understand what it is ! The arg3 is NOT the ID of your item in the database, but the row ID of the Android ressource (i.e. R.id.xxx), so you can't just use the data given by the parameters of onItemLongClick(). Knowing this, you can figure out that the line helper.deleteName((arg2+1)); is not correct and doesn't mean anything : arg2+1 means absolutely nothing for your database. A solution (not the best I think), should be to include an invisible field in your item view, storing the actual _id field of your database. Then, when a long press is detected, you get back this value and pass it to helper.deleteName().

Categories : Android

Categorizing the logging in enterprise logging c#
I normally use System.Diagnostics.EventLogEntryType for this. It gives you the following enums: EventLogEntryType.Error; EventLogEntryType.FailureAudit; EventLogEntryType.Information; EventLogEntryType.SuccessAudit; EventLogEntryType.Warning;

Categories : C#

Logging to file vs. Logging to Database
so that users connected to the task can know who has done which changes This changes the data in question from system-level logging to application-visible data. As such, it probably belongs in the application's database. This will also make it a lot easier to filter the log data for display. For example, if you want to show all historical events for Item X then you can easily query a database table which has a foreign key relationship to the Items table. Reading in that data from a file and filtering it manually would be unnecessarily difficult. Side note: "audit data" or perhaps "history data" might be a better term, to distinguish it from system logging such as error logs.

Categories : Mysql

Unable to restart varnish using "service varnish restart"
Fixed the problem by removing line breaks from the "/etc/default/varnish" file. DAEMON_OPTS="-a :80 -T localhost:1234 -f /etc/varnish/default.vcl -s malloc,256m" to DAEMON_OPTS="-a :80 -T localhost:1234 -f /etc/varnish/default.vcl -s malloc,256m"

Categories : Caching

The underlying connection was closed: The connection was closed unexpectedly wcf service
The first thing i will do is, instead of returning the full list of candidates i will return an empty list. If that works fine, then it is very clear that the size of the data is a problem. To modify the size play with your binding parameters.

Categories : Wcf

Python: How to distinguish logging of python and a custom package "logging"
First of all, I'm not sure that method of importing is fully supported and is against the PEP8 standard. The correct way (assuming you want to keep the package out of your path) is: import sys sys.path.append('path/to/custom/module/dir') import logging However, to then solve your issue you will want to "rename" the module on import by replacing that last line with: import logging as foo #system logging sys.path.append('path/to/custom/module/dir') import logging as bar #your module The easiest and cleanest solution though, would be to just rename your module.

Categories : Python

"The underlying connection was closed: The connection was closed unexpectedly"
The first request does not utilize a header that indicates the length of the result. It closes the connection when it finishes. The second request utilizes the length header, reads the designated number of bytes, then closes the connection gracefully. (under the client side control instead of server driven disconnection) -or- The url you sent caused an error on the server. Is there an error in the server log or event viewer?

Categories : C#

FINE logging not logging
replace log4j.rootLogger=FINE, stdout with log4j.rootLogger=TRACE, stdout And check here: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html and http://logging.apache.org/log4j/1.2/manual.html The second link says: Loggers may be assigned levels. The set of possible levels, that is: TRACE, DEBUG, INFO, WARN, ERROR and FATAL

Categories : Java

How to use a logging.properties file from disk as a java.util.logging.properties file
You could try this: String yourFilePath = "./yourLogProperties.properties"; LogManager.getLogManager().readConfiguration(new FileInputStream(yourFilePath); Properties will be loaded from a file stored in the same folder which your app is executed. Update: I was searching a little bit how to pass properties thru command line and there's a pretty good explanation here. So, in your case you'll need something like this: java -jar -Djava.util.logging.config.file="./yourLogProperties.properties" YourApp.jar Also you can test if it works making a simple test: public class Tests { public static void main(String[] args) { System.out.println(System.getProperty("java.util.logging.config.file")); } } Running this from command line you should get the answer ./yourLogP

Categories : Java

nginx + passenger + rails: do I need to start the rails server or just start nginx?
Set nginx to forward to my rails server using this https://gist.github.com/jeffrafter/1229497 worker_processes 1; error_log /usr/local/var/log/nginx.error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream dev { server 127.0.0.1:3000; } server { listen 80; # You could put a server_name directive here (or multiple) if # you have not setup wildcard DNS for *.dev domains # See http://jessedearing.com/nodes/9-setting-up-wildcard-subdomains-on-os-x-10-6 # If we choose a root, then we can't switch things around easily # Using /dev/null means that static assets are served through

Categories : Ruby On Rails

how do I run an msi with SEE_MASK_NOZONECHECKS without restart
You got a bit lost on the way SEE_MASK_NOZONECHECKS is used. It is not an environment variable and cannot be tinkered with from the command prompt, it is an option for ShellExecuteEx(). A winapi function that you indeed use to start programs. It isn't very clear what programming tools you have access to, using it in a batch file or VBScript isn't going to work. You'd need at least, say, VB.NET and pinvoke the function. You can get the required declarations from the pinvoke.net web site. Let's talk about what's really going on, you might find a simpler solution. When you download a file from an Internet web site, Windows adds an extra stream to the file that indicates where the file came from. Which basically states "this file did not come from a safe place" and makes the driver ins

Categories : Windows

How to restart a Kinect
Just fiddled around some more, putting the stopping on a separate thread seems to work. stopGameThread = new Thread(new ParameterizedThreadStart(stopGame)); stopGameThread.Start(); that calls this method: void stopGame(object sender) { gScreen.sensor.Stop(); gScreen.sensor.Dispose(); running = false; } gScreen is the game screen contained in this game screen wrapper. If anyone has any better answers feel free to post them.

Categories : C#

PHP 4 won't take PHP.ini changes after Apache restart
--with-config-file-path expects a directory, not a filename. So with your confiuration PHP would look for /etc/php4/php.ini/php.ini. Background: The reason for taking a path is that in fact PHP is looking for different files in order: First a SAPI specific file php-$SAPI.ini and then the generic php.ini. This allows i.e. using a different configuration on CLI where initial startup time matters more and other caching settings (apc etc.) are required.

Categories : PHP

How does Application.Restart work in .NET?
... not being fluent with IL, ... Have you considered using a decompiler (Reflector, dotPeek) or, even better, the reference source code of the .NET framework? Anyway. At a casual look it does the following: In all below cases, the current instance is terminated using Application.ExitInternal(). That is the gist of the public Application.Exit() method, eliding some security checks/asserts. See if it can determine the Assembly.GetEntryAssembly(). If that is null the call the Application.Restart() was most likely done from unmanaged code and the operation throws a NotSupportedException to the caller. See if the current process is ieexec.exe, if so use it to restart the application (for more information about ieexec.exe see here). Actually that is pretty much also a Process.Start() c

Categories : C#

How can I restart DataNucleus within a single JVM run?
Closing and creating a new PMF works for me, since it creates a new StoreManager which creates a connection pool to the datastore (wherever it is). The log would tell you where connections to the datastore are started and ended, and where connection pools are initialised

Categories : Java

Jquery Mobile, How to restart an App
If when you attempt to get or post a request to your server and it fails and gives you a connection error you can just navigate back to your first page and clear out all your stored variables. Create a function like function reset_app(){ $.mobile.changePage('#first_page'); global_vars = default_global_vars; }

Categories : Javascript

Restart iterator when finished
You can use (i-1+list.size()) % list.size() and (i+1) % list.size(). This will also handle lists of length 1. Heavier options: Write a method <T> T get(List<T> list, int i) { i %= list.size(); return list.get(i >= 0 ? i : i + list.size()); } Subclass and override get() Make a wrapper class which wraps around indices

Categories : Java

How to restart an application completely?
try this code, public void onClick(DialogInterface dialog, int which) { sauvegarde(); restart(2); } restart method public void restart(int delay) { Intent launchIntent = new Intent(context, YourStartUpActivity.class); PendingIntent intent = PendingIntent.getActivity(getApplicationContext(), 0, launchIntent , 0); AlarmManager manager = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE); manager.set(AlarmManager.RTC, System.currentTimeMillis() + delay, intent); System.exit(2); }

Categories : Android

Is there any way to restart postgres on Heroku?
No, you cannot restart your Postgres database on Heroku. If you have lingering connections, it's likely an app issue. Try in stalling the pg-extras plugin and looking for IDLE connections: https://github.com/heroku/heroku-pg-extras Also, you can try setting up a custom ActiveRecord connection in your after_fork block and enabling the connection reaper, which should clean up any lingering dead connections it finds: https://devcenter.heroku.com/articles/concurrency-and-database-connections

Categories : Postgresql



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