makandra Operations

If you want to perform a failover on another haproxy backend server this is the way you should do it: Gather information Via hatop Note: Please mind that the names...

...of frontends / backends / servers are only examples. Mind this when you want to use the shown CLI commands. The path to the haproxy socket may also vary. Example: We have...

This is a way to run multiple redis server on one ubuntu server. These steps you have to do only once: Adjust init script Change some Variables. From this:

...ARGS=/etc/redis/redis.conf NAME=redis-server DESC=redis-server PIDFILE=/var/run/redis.pid to this: NAME=`basename ${0}` DAEMON_ARGS=/etc/redis/${NAME}.conf DESC=${NAME} PIDFILE=/var/run/${NAME}.pid Move redis configuration ^

makandra dev

...heise.de mail is handled by 10 relay.heise.de. nslookup query Internet domain name servers. Nslookup has two modes: interactive and non-interactive. >nslookup heise.de Server: 146.254.160.30 Address: 146.254.160.30#53 Non-authoritative...

...have to type in domain names and press enter to get the infos. The Server in the first line is your DNS resolver. To use a specific one, you can...

...sure the Vary: Accept header is set. Proxy caching is a good feature to serve your publicly visible application content faster and reduce load on your servers. It is e.g...

...server SHOULD include a Vary header field with any cacheable response that is subject to server-driven negotiation. Doing so allows a cache to properly interpret future requests on that...

...is from a real project: In a long form, a automatically validates against the server when changed. One test changed the , then immediately scrolled down many pages and submitted the...

...JavaScript periodically requests updates from a server to keep a in sync with the latest server-site data. Sometimes the test ended right after a polling request was sent, but...

...quite annoying when you have multiple deployment targets with different hostnames, e.g. a staging server and a production server. Using the hack below you don't need to configure default...

...request.protocol ActionMailer::Base.default_url_options[:host] = request.host_with_port end end If your application server talks only HTTP and relies on the web server for SSL, and if the web...

...Eventually you will want want the same detection logic to be available on both server and client side. This card shows how to get a Ruby method touch_device? for...

...malicious users can upload executables (like an .exe or .scr file) and use your server to distribute it. However, modern operating systems usually warn before executing files that were downloaded...

...be spoofed. When the user later accesses a file upload via an URL, the server will choose a Content-Type header based on the file's extension, regardless of what...

If your Rails application is using Webpack you need to serve assets on the same host as you application runs, otherwise you will see the following errors in your browser...

So if you are using awesome.vcap.me:3000 you need to start the webpack-dev-server with a different host than localhost (0.0.0.0): bin/webpack-dev-server --host awesome.vcap.me

...applications can be used by multiple users at the same time. A typical application server like Passenger has multiple worker processes for a single app. In a distributed deployment setup...

...like we use at makandra you will even have multiple application servers, each with their own worker pool. This means that your code needs to deal with concurrent data access...

If you are a makandra employee and are running your app on makandra servers, you can skip this step. All servers and developer machines at makandra are already configured...

...is not gitignored, or your changes are only valid for your machine, not any servers. Inside a Docker environment, this file might be ignored. How to fix. Globally:

...HTTP request for every asset and block other assets from being loaded until the server responds with 304 not modified. This will slow down your page loading considerably, and cause...

...unnecessary load on your servers. This card describes how you can setup your application in a way that browsers can properly cache your assets. The caching conundrum A caching solution...

...Saving files to a directory that is not shared between deploys or servers If you save your uploads to a made up directory like "RAILS_ROOT/uploads", this directory goes away...

...every release gets a new). Also this directory is not shared between multiple application servers, so your uploads are randomly saved to one local filesystem or another. Fixing this afterwards...

When an AJAX request raises an exception on the server, Rails will show a minimal error page with only basic information. Because all Unpoly updates work using AJAX requests, you...

...need to update the isDevelopmentError() function so it returns true when your particular development server shows an error. Warning Unpoly cannot repeat form submissions that include file inputs. If it...

We generally use multiple application servers (at least two) and you have to search on all of them if you don't know which one handled the request you are...

Rails application logs usually live in /var/www/ /shared/log. Web server logs usually live in /var/www/ /log. Searching through single logs with grep / zgrep You can use grep in...

This is an attempt to list some of those things: On the server Always optimize: Don't do stupid things with the database. Avoid "n + 1" queries. Don...

...complicated table, or crazy visualization in a separate AJAX call? Move work from the server to the client. On the client The biggest issue on the client are loading times...

makandra dev

...yourself. Do not manipulate package.json yourself. Yarn will do this for you. The dev server If might have noticed that adding webpack made you development server pretty slow. To increase...

...performance, open a separate terminal, and run bin/webpack-dev-server. The dev server will watch all your changes and compile everything automatically in the background. It will also auto-reload your code...

...and we want user names to be unique) The requests are accepted on the server by two worker processes who will now process them in parallel Both requests scan the...

...and we want user names to be unique) The requests are accepted on the server by two worker processes who will now process them in parallel Both requests scan the...

...response includes caching headers like Expires or Cache-Control, their validity depends on the server's Date header if present. Otherwise, the browser uses its local time. This can lead...

...its own local system time. This subtle behavior ensures that cookies remain consistent with server time, even if the client’s clock is incorrect. However, this can lead to unexpected...

...old to match the format created by pg_dump. The version of the PostgreSQL server doesn't matter here. For example, the official Ubuntu 20.04 sources include only PostgreSQL...

...workaround below. Background Creating and restoring a database dump has four components: the source server, pg_dump, the target server, and pg_restore. pg_dump will create a dump, and...

github.com

The maintenance mode is enabled on all application server as soon as the file /public/system/maintenance.html is present. Installation Add this line to your application's Gemfile: gem 'capistrano...

...application's web interface by writing a #{maintenance_basename}.html file to each web server. The servers must be configured to detect the presence of this file, and if it...

...used to redirects always resulting in a GET request. # Browser sends PATCH /foo HTTP/1.1 # Server responds HTTP/1.1 302 Found Location: /bar # Browser follows redirect PATCH /bar # Server responds

...is neither GET or POST. Some workarounds for this issue below. Fix on the server: Redirect with a modern status code If your redirecting action redirects with a HTTP status...

makandra dev
unpoly.com

...sponsor makandra funded this release ❤️ Please take a minute to check out makandra's services for web development, DevOps or UI/UX. Professional support options We're introducing optional commercial support...

...form's [action] attribute, setting an additional X-Up-Validate header to allow the server distinguish a validation request from a regular form submission. Unpoly can now validate forms against...

Your development server is usually running on an insecure HTTP connection which is perfectly fine for development. If you need your local dev server to be accessible via HTTPS for...

...to do this again in a month or a year. Next, start your application server for HTTPS. For a Rails application with Puma: bin/rails server -b 'ssl://0.0.0.0:3000?key...