Skip to main content

Posts

Showing posts from 2018

Serving a Django 1.11 Application Through Apache and mod_wsgi

Create a django project "mysite" In "mysite" project we're going to change it a bit and add an apache directory which contain three files: In "mysite" add apache folder structure mysite/ manage.py mysite/ __init__.py settings.py urls.py apache/ __init__.py override.py wsgi.py myapp/ models.py views.py The empty __init__.py file tells Python to treat the directory as a package. Add following content in override.py # override.py from mysite.settings import * DEBUG = True ALLOWED_HOSTS = ['www.mydomain.com', 'mydomain.com'] Add following content in wsgi.py #wsgi.py import os, sys # Calculate the path based on the location of the WSGI script. apache_configuration= os.path.dirname(__file__) project = os.path.dirname(apache_configuration) workspace = os.path.dirname(project) sys.path.append(workspace) sys.path.append(project) os.environ[...

Tools/Commands for monitoring linux

Following are the tools for monitoring a linux system System commands like top, free -m, vmstat, iostat, iotop, sar, netstat etc. Nothing comes near these linux utility when you are debugging a problem. These command give you a clear picture that is going inside your server SeaLion : Agent executes all the commands mentioned in #1 (also user defined) and outputs of these commands can be accessed in a beautiful web interface. This tool comes handy when you are debugging across hundreds of servers as installation is clear simple. And its FREE Nagios : It is the mother of all monitoring/alerting tools. It is very much customization but very much difficult to setup for beginners. There are sets of tools called nagios plugins that covers pretty much all important Linux metrics Munin Server density: A cloudbased paid service that collects important Linux metrics and gives users ability to write own plugins. New Relic: Another wel...