Linux Hardware Compatibility: W311MI

This is just to let others know what piece of hardware worked during my linux experiments:

 

 

dmesg output

<5>[    0.000000] Linux version 2.6.31.6_SMP_820 (bdietrich@brad-ux) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #96 SMP Tue                Feb 8 12:08:54 PST 2011
<4>[    0.000000] CPU: ARMv6-compatible processor [410fb025] revision 5 (ARMv7), cr=00c5387f
<4>[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
<4>[    0.000000] Machine: Oxsemi NAS
<5>[    0.000000] 1 memory region
<4>[    0.000000] Ignoring unrecognised tag 0x00000000
<4>[    0.000000] Memory policy: ECC disabled, Data cache writealloc
<7>[    0.000000] On node 0 totalpages: 32768
<7>[    0.000000] free_area_init_node: node 0, pgdat c0401080, node_mem_map c0424000
<7>[    0.000000]   Normal zone: 256 pages used for memmap
<7>[    0.000000]   Normal zone: 0 pages reserved
<7>[    0.000000]   Normal zone: 32512 pages, LIFO batch:7
<4>[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
<5>[    0.000000] Kernel command line: root=ubi0:rootfs ubi.mtd=2,512 rootfstype=ubifs console=ttyS0,115200 elevator=cfq mac_adr=0x0               0,0×30,0xe0,0x00,0x00,0x01 mem=128M poweroutage=yes
<4>[    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
<6>[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
<6>[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
<6>[    0.000000] Memory: 128MB = 128MB total
<5>[    0.000000] Memory: 125496KB available (3712K code, 275K data, 120K init, 0K highmem)
<6>[    0.000000] Hierarchical RCU implementation.
<6>[    0.000000] NR_IRQS:96
<4>[    0.000000] OX820_RPS_init_irq: interrupts 64 to 96
<4>[    0.010000] Console: colour dummy device 80×30
<6>[    0.010000] console [ttyS0] enabled
<6>[    0.020000] Calibrating delay loop… 279.34 BogoMIPS (lpj=1396736)
<6>[    0.260000] Security Framework initialized
<4>[    0.260000] Mount-cache hash table entries: 512
<6>[    0.270000] CPU: Testing write buffer coherency: ok
<6>[    0.270000] Calibrating local timer… 350.00MHz.
<4>[    0.340000] CPU1: Booted secondary processor
<6>[    0.440000] Calibrating delay loop… 279.34 BogoMIPS (lpj=1396736)
<6>[    0.670000] Brought up 2 CPUs
<6>[    0.680000] SMP: Total of 2 processors activated (558.69 BogoMIPS).
<6>[    0.690000] NET: Registered protocol family 16
<6>[    0.690000] Number of DMA channels = 4, version = 4
<6>[    0.700000] Reserving a DMA channel for DirectRAID
<6>[    0.700000] Allocating 389 SRAM generic DMA descriptors
<4>[    0.720000] bio: create slab <bio-0> at 0
<5>[    0.730000] SCSI subsystem initialized
<7>[    0.730000] libata version 3.00 loaded.
<6>[    0.750000] NET: Registered protocol family 2
<6>[    0.750000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
<6>[    0.760000] Switched to NOHz mode on CPU #0
<6>[    0.760000] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
<6>[    0.760000] Switched to NOHz mode on CPU #1
<6>[    0.770000] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
<6>[    0.780000] TCP: Hash tables configured (established 4096 bind 4096)
<6>[    0.780000] TCP reno registered
<6>[    0.790000] NET: Registered protocol family 1
<4>[    0.790000] Create fragment cache
<6>[    0.800000] fuse init (API version 7.12)
<6>[    0.800000] msgmni has been set to 245
<6>[    0.810000] alg: No test for stdrng (krng)
<6>[    0.810000] io scheduler noop registered
<6>[    0.820000] io scheduler anticipatory registered
<6>[    0.820000] io scheduler deadline registered
<6>[    0.830000] io scheduler cfq registered (default)
<6>[    0.850000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
<6>[    0.860000] serial8250: ttyS0 at MMIO 0x44200000 (irq = 55) is a 16550A
<6>[    0.880000] brd: module loaded
<6>[    0.890000] loop: module loaded
<6>[    0.890000] ox820sata: OX820 sata core.
<6>[    0.890000] scsi0 : oxnassata
<6>[    0.900000] scsi1 : oxnassata
<6>[    0.900000] ata1: SATA max UDMA/133 irq 50
<6>[    0.910000] ata2: SATA max UDMA/133 irq 50
<3>[    0.910000] ox820sata: reseting SATA core
<6>[    1.270000] ata1: SATA link down (SStatus 0 SControl 300)
<3>[    1.270000] ox820sata: reseting SATA core
<6>[    1.630000] ata2: SATA link down (SStatus 0 SControl 300)
<6>[    1.630000] tun: Universal TUN/TAP device driver, 1.6
<6>[    1.640000] tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
<4>[    1.640000] NAND: Page read time 40ms
<6>[    1.650000] NAND device: Manufacturer ID: 0xad, Chip ID: 0xf1 (Hynix NAND 128MiB 3,3V 8-bit)
<6>[    1.660000] Scanning device for bad blocks
<4>[    1.670000] Bad eraseblock 225 at 0x000001c20000
<4>[    1.680000] Bad eraseblock 273 at 0x000002220000
<5>[    1.740000] Creating 2 MTD partitions on "NAND 128MiB 3,3V 8-bit":
<5>[    1.750000] 0x000000000000-0x000000e00000 : "boot"
<5>[    1.750000] 0x000000e00000-0x000008000000 : "rootfs"
<5>[    1.760000] UBI: attaching mtd2 to ubi0
<5>[    1.760000] UBI: physical eraseblock size:   131072 bytes (128 KiB)
<5>[    1.770000] UBI: logical eraseblock size:    129024 bytes
<5>[    1.770000] UBI: smallest flash I/O unit:    2048
<5>[    1.780000] UBI: sub-page size:              512
<5>[    1.780000] UBI: VID header offset:          512 (aligned 512)
<5>[    1.790000] UBI: data offset:                2048
<5>[    2.200000] UBI: attached mtd2 to ubi0
<5>[    2.200000] UBI: MTD device name:            "rootfs"
<5>[    2.210000] UBI: MTD device size:            114 MiB
<5>[    2.210000] UBI: number of good PEBs:        910
<5>[    2.220000] UBI: number of bad PEBs:         2
<5>[    2.220000] UBI: max. allowed volumes:       128
<5>[    2.220000] UBI: wear-leveling threshold:    4096
<5>[    2.230000] UBI: number of internal volumes: 1
<5>[    2.230000] UBI: number of user volumes:     1
<5>[    2.240000] UBI: available PEBs:             0
<5>[    2.240000] UBI: total number of reserved PEBs: 910
<5>[    2.250000] UBI: number of PEBs reserved for bad PEB handling: 9
<5>[    2.250000] UBI: max/mean erase counter: 2/0
<5>[    2.260000] UBI: image sequence number: 0
<5>[    2.260000] UBI: background thread "ubi_bgt0d" started, PID 275
<6>[    2.270000] mice: PS/2 mouse device common for all mice
<6>[    2.270000] TCP cubic registered
<6>[    2.280000] NET: Registered protocol family 10
<6>[    2.280000] NET: Registered protocol family 17
<6>[    2.290000] RPC: Registered udp transport module.
<6>[    2.290000] RPC: Registered tcp transport module.
<5>[    2.520000] UBIFS: mounted UBI device 0, volume 0, name "rootfs"
<5>[    2.530000] UBIFS: file system size:   114315264 bytes (111636 KiB, 109 MiB, 886 LEBs)
<5>[    2.540000] UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
<5>[    2.540000] UBIFS: media format:       w4/r0 (latest is w4/r0)
<5>[    2.550000] UBIFS: default compressor: zlib
<5>[    2.550000] UBIFS: reserved for root:  0 bytes (0 KiB)
<4>[    2.560000] VFS: Mounted root (ubifs filesystem) on device 0:10.
<6>[    2.570000] Freeing init memory: 120K
<5>[    3.440000] Probing for Synopsis GMAC, unit 0
<6>[    3.450000] eth0: Tuning GMAC 0 RGMII timings
<6>[    3.450000] eth0: PHY is Realtek RTL8211D, type 0x001cc914
<5>[    3.460000] eth0: GMAC ver = 53, vendor ver = 18 at 0xed400000, IRQ 40
<5>[    3.470000] eth0: Found PHY at address 3, type 0x001cc914 -> 10/100/1000
<5>[    3.480000] eth0: Ethernet addr: 00:30:e0:00:00:00
<6>[    3.500000] eth0: PHY is Realtek RTL8211D, type 0x001cc914
<6>[    3.500000] Offload is not active on eth0
<6>[    3.510000] Alloc'ing ARM descs 10240 bytes
<6>[    3.510000] eth0: Resetting GMAC
<6>[    3.520000] eth0: GMAC reset complete
<6>[    3.520000] eth0: Setting Rx flow control thresholds for LAN port
<6>[    4.080000] eth0: PHY is Realtek RTL8211D, type 0x001cc914
<6>[    4.580000] eth0: link down
<6>[    6.540000] ADDRCONF(NETDEV_UP): eth0: link is not ready
<6>[    8.080000] eth0: link up, 1000Mbps, full-duplex, using pause, lpa 0xCDE1
<6>[    8.080000] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
<6>[   10.690000] usbcore: registered new interface driver usbfs
<6>[   10.700000] usbcore: registered new interface driver hub
<6>[   10.710000] usbcore: registered new device driver usb
<6>[   10.760000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
<6>[   10.770000] oxnas-ehci oxnas-ehci.0: OXNAS EHCI Host Controller
<6>[   10.780000] oxnas-ehci oxnas-ehci.0: new USB bus registered, assigned bus number 1
<6>[   10.810000] oxnas-ehci oxnas-ehci.0: irq 39, io mem 0x00000000
<6>[   10.830000] oxnas-ehci oxnas-ehci.0: USB 0.0 started, EHCI 1.00
<6>[   10.840000] usb usb1: configuration #1 chosen from 1 choice
<6>[   10.840000] hub 1-0:1.0: USB hub found
<6>[   10.850000] hub 1-0:1.0: 2 ports detected
<6>[   10.940000] Initializing USB Mass Storage driver…
<6>[   10.940000] usbcore: registered new interface driver usb-storage
<6>[   10.950000] USB Mass Storage support registered.
<6>[   11.170000] usb 1-1: new high speed USB device using oxnas-ehci and address 2
<4>[   11.330000] ufsd: module license 'Commercial product' taints kernel.
<4>[   11.340000] Disabling lock debugging due to kernel taint
<6>[   11.470000] usb 1-1: configuration #1 chosen from 1 choice
<6>[   11.560000] hub 1-1:1.0: USB hub found
<6>[   11.570000] hub 1-1:1.0: 4 ports detected
<5>[   11.610000] ufsd: driver 8.3 (008_A) with acl LBD=ON with ioctl loaded at bf078000
<5>[   11.610000] NTFS read/write support included
<5>[   11.610000] Hfs+/HfsX read/write support included
<6>[   11.870000] usb 1-1.2: new high speed USB device using oxnas-ehci and address 3
<4>[   11.960000] rtusb init rt2870 —>
<6>[   11.970000] usbcore: registered new interface driver rt2870
<4>[   12.000000] Cloud Engines XCE Init [Version: 2.5.9.1]
<6>[   12.010000] XCE: CPU MEMORY MAP:
<6>[   12.010000] XCE:   — 0x00001000 – 0xbeffffff (3055 MB)  User Space Mappings
<6>[   12.020000] XCE:   — 0xbf000000 – 0xbfffffff (  16 MB)  Kernel module space
<6>[   12.020000] XCE:   — 0xc0000000 – 0xc7ffffff ( 128 MB)  Kernel direct-mapped ram
<6>[   12.030000] XCE:   — 0xc8800000 – 0xecffffff ( 584 MB)  Kernel vmalloc space
<6>[   12.040000] XCE:   — 0xed000000 – 0xfeffffff ( 287 MB)  Kernel platform space
<6>[   12.040000] XCE: CPU FEATURES:
<6>[   12.050000] XCE:   — I Cache:         enabled
<6>[   12.050000] XCE:   — D Cache:         enabled
<6>[   12.060000] XCE:   — Branch Predict:  disabled
<6>[   12.060000] XCE:   — MMU:             enabled
<6>[   12.070000] XCE:   — Alignment Abort: disabled
<6>[   12.070000] XCE: BLPARAMS: Locating parameter block…
<6>[   12.080000] XCE: BLPARAMS: reading 2048 bytes @ a0000
<6>[   12.080000] XCE: Loaded Property Size: 2048
<6>[   12.090000] XCE:    – 'cesvcid' -> '7BR8RPYW6XVXK3F2PKS978HRTN'
<6>[   12.090000] XCE:    – 'ceboardver' -> 'PPV3'
<4>[   12.100000] XCE: No board spec found matching boardid 'PPV3' — Using 'PPRO1'
<6>[   12.100000] XCE: Current GPIO State:
<6>[   12.110000] XCE:  GPIO A input:        0xf679fff7
<6>[   12.110000] XCE:  GPIO A OE status:    0x00000000
<6>[   12.120000] XCE:  GPIO A IRQ enable:   0x00000000
<6>[   12.120000] XCE:  GPIO A IRQ event:    0x00000000
<6>[   12.130000] XCE:  GPIO A output state: 0x00000000
<6>[   12.130000] XCE:  GPIO B input:        0x0003ffff
<6>[   12.140000] XCE:  GPIO B OE status:    0x00030000
<6>[   12.140000] XCE:  GPIO B IRQ enable:   0x00000000
<6>[   12.150000] XCE:  GPIO B IRQ event:    0x00000000
<6>[   12.150000] XCE:  GPIO B output state: 0x00030000
<6>[   12.290000] XCE: BLPARAMS: Locating parameter block…
<6>[   12.290000] XCE: BLPARAMS: reading 2048 bytes @ a0000
<6>[   12.300000] XCE: BLPARAMS: reading 2048 bytes @ a0800
<6>[   12.310000] XCE: BLPARAMS: reading 2048 bytes @ a1000
<6>[   12.310000] XCE: BLPARAMS: reading 2048 bytes @ a1800
<6>[   13.990000] usb 1-1.2: configuration #1 chosen from 1 choice
<6>[   14.010000] scsi2 : SCSI emulation for USB Mass Storage devices
<7>[   14.020000] usb-storage: device found at 3
<7>[   14.020000] usb-storage: waiting for device to settle before scanning
<6>[   17.800000] XCE: XCE: LED -> CONNECTED
<7>[   18.200000] eth0: no IPv6 routers present
<5>[   19.020000] scsi 2:0:0:0: Direct-Access        Mass  Storage Device        PQ: 0 ANSI: 0
<5>[   19.050000] sd 2:0:0:0: [sda] 625142446 512-byte logical blocks: (320 GB/298 GiB)
<7>[   19.050000] usb-storage: device scan complete
<5>[   19.050000] sd 2:0:0:0: [sda] Write Protect is off
<7>[   19.060000] sd 2:0:0:0: [sda] Mode Sense: 03 00 00 00
<3>[   19.060000] sd 2:0:0:0: [sda] Assuming drive cache: write through
<3>[   19.070000] sd 2:0:0:0: [sda] Assuming drive cache: write through
<6>[   19.070000]  sda: sda1
<3>[   19.220000] sd 2:0:0:0: [sda] Assuming drive cache: write through
<5>[   19.220000] sd 2:0:0:0: [sda] Attached SCSI disk
<5>[   19.930000] ufsd: use builtin utf8 instead of kernel utf8
<5>[   20.130000] ufsd: sda1 without journal
<6>[  517.820000] XCE: BLPARAMS: Locating parameter block…
<6>[  517.830000] XCE: BLPARAMS: reading 2048 bytes @ a0000
<6>[  517.840000] XCE: BLPARAMS: reading 2048 bytes @ a0800
<6>[  517.840000] XCE: BLPARAMS: reading 2048 bytes @ a1000
<6>[  517.850000] XCE: BLPARAMS: reading 2048 bytes @ a1800
 

 

.

 

Change Default Country on Google Apps (even free edition)

Change Default Country In Google Apps
 
 
Once your default country is selected in your Google Apps account you cannot change it. Sometime it becomes necessary to change the default country for eg: when you change your country.
 
To force the change follow the steps below:
Login to your Google Apps as an administrator.
In your dashboard you'll see "Try Google Apps for Business Free".
Click that link.
After that you'll get option to change the country.
Select your desire country and click 'Begin Trial'. Don't worry, we don't have to pay any buck.
After this you'll reach to Google Checkout Page. At this moment close your browser. Yes close it.
 
Verify if your change has been saved by going to Domain Setting — Account Information — Default Country
 

Facebook: Creating your first APP in PHP

So you finally decided you want to create a Facebook app to make your million dollar idea pay off a million dollars! Great!

 

Cutting to the chase:

 

1. Install the Developers App so you can get started creating apps on Facebook.

https://developers.facebook.com/

and click Allow

2. Create and Configure your App

Click on Apps and then "Create New App"

Configure your App

 

3. Download the SDK

Get the PHP SDK here

https://developers.facebook.com/docs/reference/php/

Extract the contents to a /facebook/ folder in your public html folder on your server

 

 

4. Create your minimum App (Who needs a Hello World?)

TO-DO

5. Enhance your App

TO-DO

6. Make it work outside Facebook

TO-DO

7. Make a mobile version

TO-DO

8. Make millions

TO-DO

9. Send me stuff 🙂

 

 

Brighter LAMP: phpmyadmin installation

Install mcrypy for phpmyadmin dependencies:

 

# apt-get install php5-mcrypt

 

Now you need to restart apache for the changes to take effect

 

# /etc/init.d/apache2 restart

 

Now, on to the installation:

# apt-get install phpmyadmin

 

Choose Apache2 when you're prompted

 

 

Answer yes to Configure database for phpmyadmin with dbconfig-common?

 

 

after that,

 

Configure phpmyadmin

 

su – httpd

cd domains/

cd ~domains/debian.portnumber53.local/html

(Create the directory if it doesn't exist)

$ ln -s /usr/share/phpmyadmin .phpMyAdmin

 

 

 

nano /etc/phpmyadmin/config.inc.php

$cfg[‘blowfish_secret’] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

 

 

 

# nano /etc/php5/conf.d/suhosin.ini

Edit the following, keeping in mind that suhosin values may cause issues with some operations

suhosin.request.max_vars 2048
suhosin.request.max_value_length 1000000
suhosin.request.max_array_index_length 256
suhosin.request.max_totalname_length 8192
suhosin.post.max_vars 2048
suhosin.post.max_array_index_length 256
suhosin.post.max_totalname_length 8192
suhosin.post.max_value_length 1000000
suhosin.sql.bailout_on_error Off
suhosin.log.file 0
suhosin.log.phpscript 0
suhosin.log.phpscript.is_safe Off
suhosin.log.sapi 0
suhosin.log.script 0
suhosin.log.use-x-forwarded-for Off

 

 

Disable the warning

 

# nano /etc/phpmyadmin/config.inc.php

$cfg[‘SuhosinDisableWarning’] = true;

 

Setting up a Debian box for development: making a LAMP: php5

Now P for PHP 5:

 

# apt-get install php5 php-pear php5-suhosin

 

# nano /etc/php5/apache2/php.ini

 

max_execution_time = 30
memory_limit = 64M
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
log_errors = On
error_log = /var/log/php.log
register_globals = Off

 

Add mysql support.

# apt-get install php5-mysql

 

 

 

Setting up a Debian box for development: making a LAMP: mysql

Let's make a lamp

 

First M for Mysql:

# apt-get install mysql-server

The script will ask you to define the password for the root mysql user:

Secure your mysql installation:

# mysql_secure_installation

 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 … skipping.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 … Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 … Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 – Dropping test database…
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 … Failed!  Not critical, keep moving…
 – Removing privileges on test database…
 … Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 … Success!

Cleaning up…

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!
 

 

Setting up a Debian box for development: making a LAMP: apache2

Add a user for the web stuff

# adduser httpd

Choose a simple (but secure) password.

# apt-get install apache2
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
  apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,155 kB of archives.
After this operation, 7,266 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.us.debian.org/debian/ squeeze/main libapr1 amd64 1.4.2-6+squeeze3 [94.2 kB]
Get:2 http://ftp.us.debian.org/debian/ squeeze/main libaprutil1 amd64 1.3.9+dfsg-5 [92.3 kB]
Get:3 http://ftp.us.debian.org/debian/ squeeze/main libaprutil1-dbd-sqlite3 amd64 1.3.9+dfsg-5 [28.1 kB]
Get:4 http://ftp.us.debian.org/debian/ squeeze/main libaprutil1-ldap amd64 1.3.9+dfsg-5 [25.7 kB]
Get:5 http://ftp.us.debian.org/debian/ squeeze/main apache2.2-bin amd64 2.2.16-6+squeeze4 [1,439 kB]
Get:6 http://ftp.us.debian.org/debian/ squeeze/main apache2-utils amd64 2.2.16-6+squeeze4 [164 kB]
Get:7 http://ftp.us.debian.org/debian/ squeeze/main apache2.2-common amd64 2.2.16-6+squeeze4 [308 kB]
Get:8 http://ftp.us.debian.org/debian/ squeeze/main apache2-mpm-worker amd64 2.2.16-6+squeeze4 [2,240 B]
Get:9 http://ftp.us.debian.org/debian/ squeeze/main apache2 amd64 2.2.16-6+squeeze4 [1,396 B]
Fetched 2,155 kB in 5s (423 kB/s)
Selecting previously deselected package libapr1.
(Reading database … 32742 files and directories currently installed.)
Unpacking libapr1 (from …/libapr1_1.4.2-6+squeeze3_amd64.deb) …
Selecting previously deselected package libaprutil1.
Unpacking libaprutil1 (from …/libaprutil1_1.3.9+dfsg-5_amd64.deb) …
Selecting previously deselected package libaprutil1-dbd-sqlite3.
Unpacking libaprutil1-dbd-sqlite3 (from …/libaprutil1-dbd-sqlite3_1.3.9+dfsg-5_amd64.deb) …
Selecting previously deselected package libaprutil1-ldap.
Unpacking libaprutil1-ldap (from …/libaprutil1-ldap_1.3.9+dfsg-5_amd64.deb) …
Selecting previously deselected package apache2.2-bin.
Unpacking apache2.2-bin (from …/apache2.2-bin_2.2.16-6+squeeze4_amd64.deb) …
Selecting previously deselected package apache2-utils.
Unpacking apache2-utils (from …/apache2-utils_2.2.16-6+squeeze4_amd64.deb) …
Selecting previously deselected package apache2.2-common.
Unpacking apache2.2-common (from …/apache2.2-common_2.2.16-6+squeeze4_amd64.deb) …
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from …/apache2-mpm-worker_2.2.16-6+squeeze4_amd64.deb) …
Selecting previously deselected package apache2.
Unpacking apache2 (from …/apache2_2.2.16-6+squeeze4_amd64.deb) …
Processing triggers for man-db …
Setting up libapr1 (1.4.2-6+squeeze3) …
Setting up libaprutil1 (1.3.9+dfsg-5) …
Setting up libaprutil1-dbd-sqlite3 (1.3.9+dfsg-5) …
Setting up libaprutil1-ldap (1.3.9+dfsg-5) …
Setting up apache2.2-bin (2.2.16-6+squeeze4) …
Setting up apache2-utils (2.2.16-6+squeeze4) …
Setting up apache2.2-common (2.2.16-6+squeeze4) …
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.
Enabling module reqtimeout.
Setting up apache2-mpm-worker (2.2.16-6+squeeze4) …
Starting web server: apache2.
Setting up apache2 (2.2.16-6+squeeze4) …

# a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!

# nano /etc/apache2/envvars

export APACHE_RUN_USER=httpd
export APACHE_RUN_GROUP=httpd

We will activate the Mass Hosting module for Apache so we can develop a bunch of projects at the same time

We need a file to correct the value of DOCUMENT_ROOT when using such module:

<?php

// Let's fix the document root because of a bug in Apache's mod_vhost_alias not
// setting up the correct $_SERVER[‘DOCUMENT_ROOT’] env variable.
$__mod_vhost_alias_fix_doc_root = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'domains' . DIRECTORY_SEPARATOR . $_SERVER[‘HTTP_HOST’] . DIRECTORY_SEPARATOR . 'html';

if (is_dir($__mod_vhost_alias_fix_doc_root)) {
$_SERVER[‘__MOD_VHOST_FIX_OLD_DOCUMENT_ROOT’] = $_SERVER[‘DOCUMENT_ROOT’];
    $_SERVER[‘DOCUMENT_ROOT’] = $__mod_vhost_alias_fix_doc_root;
}

?>

We create a configuration file for virtual hosts:

nano /etc/apache2/sites-available/vhosts
# get the server name from the Host: header
UseCanonicalName Off

# splittable logs
LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
CustomLog ${APACHE_LOG_DIR}/access_log vcommon

<Directory /home/httpd/domains/portnumber53.local/html>
# ExecCGI is needed here because we can't force
# CGI execution in the way that ScriptAlias does
Options FollowSymLinks ExecCGI
</Directory>

# now for the hard bit

RewriteEngine On

# a ServerName derived from a Host: header may be any case at all
RewriteMap lowercase int:tolower

## deal with normal documents first:
# allow Alias /icons/ to work – repeat for other aliases
RewriteCond %{REQUEST_URI} !^/icons/
# allow CGIs to work
RewriteCond %{REQUEST_URI} !^/cgi-bin/
# do the magic
RewriteRule ^/(.*)$ /home/httpd/domains/${lowercase:%{SERVER_NAME}}/html/$1

## and now deal with CGIs – we have to force a MIME type
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/(.*)$ /home/httpd/domains/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [T=application/x-httpd-cgi]

# that's it!
a2ensite vhosts
a2dissite default
///////////////
mkdir -p /home/httpd/domains/portnumber53.local/html
echo "PortNumber53.local<?php phpinfo(); ?>" > /home/httpd/domains/portnumber53.local/html/index.php

mkdir -p /home/httpd/domains/example.local/html
echo "Example.local<?php phpinfo(); ?>" > /home/httpd/domains/example.local/html/index.php

Let's restart Apache:
service apache2 restart

As long as your windows box solves portnumber53.local and example.local to the IP of your debian web box, try opening these domains in your browser.