Since so far all my jobs have required me (read: they assigned me) Windows machines, I find more comfortable working with Ubuntu that makes setting up/installing/using various software far more easily.
I use Oracle VM VirtualBox which is free and fairly easy to use (don't forget to install the Extension Pack) and Ubuntu.
Settings for the Ubuntu VM:
- System
- Motherboard
- Boot order:
- CD/DVD-ROM
- Hard Disk
- Floppy (disabled)
- Base Memory: something more than 1024MB, depending on your machine (with a Windows7 host with 4GB, I set it to the end of the green bar - 1654MB)
- Boot order:
- Motherboard
- Network
- Adapter 1: NAT; Port Forwarding:
- name - protocol - host ip - host port - guest ip - guest port
- name - tcp - 127.0.0.2 - 80 - 10.0.2.15 - 80
- name - tcp - 127.0.0.2 - 443 - 10.0.2.15 - 443
- name - tcp - 127.0.0.2 - 1234 - 10.0.2.15 - 80 (for http in case host has already a server)
- name - tcp - 127.0.0.2 - 1235 - 10.0.2.15 - 443 (for https in case host has already a server)
- Adapter 1: NAT; Port Forwarding:
- Shared folders
- Folder Path: C:\giulia\www; Folder Name: giulia_www; Auto-mount; Make Permanent
To mount the shared folder on Ubuntu, create the folder giulia_www
in home
and run the command
sudo mount -t vboxsf -o uid=1000,gid=1000 giulia_www ~/giulia_www
where the first giulia_www
refers to the folder name I gave in the VM settings, while ~/giulia_www
is the path of the folder I want to mount to (giulia_ww
is the folder for an eventual Ubuntu based server folder). If you want automounting, see the ubuntu_rc.local
file.
The host is Windows 7. Domain name assigned: giulia and giulia.dev
The guest is Ubuntu 12.04. Domain name assigned: giulia.nix
From the host, the IP address to access the guest is 127.0.0.2, made it possible through port forwarding on VirtualBox. From the guest, the IP address to access the host is 10.0.2.2.
On both the machines Apache is installed. On Windows through xampp, on Ubuntu following this guide:
sudo apt-get install tasksel
sudo tasksel install lamp-server
If taskel returns with error tasksel aptitude failed (100)
run
sudo apt-get update
sudo tasksel
On Ubuntu I've also installed SSL
sudo apt-get install ssl-cert
cd /etc/apache2/
sudo mkdir ssl
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem
sudo a2enmod ssl
sudo /etc/init.d/apache2 force-reload
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
gksudo gedit /etc/apache2/sites-available/ssl
sudo a2ensite ssl
Here's a quick summary:
- install xampp on win
- configure xampp
- install virtualbox on win
- install ubuntu as vm
- configure ubuntu vm
- install lamp on ubuntu
- install ssl on ubuntu
- configure apache and ssl on ubuntu
- configure hosts file
And the configuration files