Original Url: http://wunger.spaces.live.com/Blog/cns!9E6927A42561030E!1205.entry
One of the new capabilities of Windows 7 Embedded is to boot from a VHD file. This is a great possibility which can help a lot in case of deploying updates, running different version, or deploying the system in general as it’s again a simple file copy&pasty procedure on NTFS.
You can even install Windows 7 Embedded directly into a VHD so you don’t need to transfer it to a VHD manually – also you don’t need BCDEDIT as the setup will take care of this.
Before you start you need an formatted NTFS volume where the VHD will be located.
Installation
- Boot the target device from the Runtime DVD
- When the setup screen appears pres Shift+F10 – this will open a command prompt
- Run diskpart.exe
- Run the following commands to create a 5GB VHD
create vdisk file=c:Win7Emb.vhd maximum=5120
select vdisk file=c:Win7Emb.vhd
attach vdisk
exit
- close the command prompt and run through your Windows 7 Embedded installation
- select the VHD harddisk at the target drive selection
- IMPORTANT: VHD Boot needs the following component
System Services
- File System
- – Advanced File System
Original Url: http://goxia.maytide.net/read.php/1146.htm
Step by Step VHD with Native Boot
mod_wsgi is an Apache module for serving WSGI-based Python web applications from the Apache HTTP server. Django, along with almost every other Python web framework today, comes bundled with a backend for acting like a WSGI application.
A couple of months ago I decided to try it out in spite of mod_python. Discovering and trying out mod_wsgi really suprised me. It can take a massive beating, and outperforms mod_python in every practical aspect.
The setup
You will need a short Python “bootstrap” script to create a WSGI-handler for your Django project. Here is an example (call it wsgi_handler.py and place it in the root directory of your Django project – the one with manage.py and settings.py):
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
os.environ['DJANGO_SETTINGS_MODULE'] = 'projectname.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Finally set up your Apache virtualhost to use mod_wsgi:
*>
ServerName www.projectname.org
ServerAlias *projectname.org
Alias /admin_media /usr/lib/python2.4/site-packages/django/contrib/admin/media
/admin_media>
Order allow,deny
Allow from all
Alias /media /home/user/projectname/media
/media>
Order allow,deny
Allow from all
WSGIScriptAlias / /home/user/projectname/wsgi_handler.py
WSGIDaemonProcess projectname user=user group=user processes=1 threads=10
WSGIProcessGroup projectname
In the WSGIDaemonProcess line, you can easily manage the amount of system resources (measured in processes and threads) mod_wsgi should use. In my experience a single process with 10 threads will cover most small and medium loaded websites.
Why?
This is some of the reasons why you should ditch mod_python for mod_wsgi when hosting Django projects:
-
Faster
The load times of the websites now served with mod_wsgi really surprised me. Normally a page would be served within 150-300 ms. This was reduced to load times in the range of 40-80 ms.
I also discovered that running mod_wsgi in embedded mode (as opposed to daemon mode) was not worth the effort. I didn’t really see any difference between load times when using Django.
-
Less memory usage
Everyone hosting more than a couple of Django projects on a single Apache instance knows that Django projects squanders a bit with memory usage, and every single Apache child process will easily end up using 50 MB RAM.
mod_wsgi dedicates a process (or multiple processes) to a single interpreter for a single Django project, and keeps the memory usage low in the “normal” Apache child processes. On a server with 8 small Django projects, I went from using ~1500 MB RAM on Apache child processes to using 150 MB.
-
Secure
When using mod_python your Python interpreter will be running as the user running the Apache webserver itself (on Debian systems, the user is called www-data). Typically this will allow you to peek around in places where you do not want your users peeking. This is due to the fact that www-data must have read access to every file you use in your application (including settings/configuration/media files).
mod_wsgi addresses this problem by changing to a user id specified in the configuration file, and run your Python interpreter as another user than www-data, allowing you to lock down every project on your server to seperate user accounts.