Accueil > Carnet > Lion, VirtualBox and Ubuntu Server

Après plus de 14 années de présence sur le web, je continue encore aujourd'hui cette incroyable aventure qu'est la découverte du virtuel. Lampe torche, sac à dos, planche de surf et bien sûr ce calepin indispensable pour mémoire.

#497 Lion, VirtualBox and Ubuntu Server - 14 Septembre 2011

Web Programmation

In construction

Installing Apache, Mysql and Php directly on a Mac isn't a good idea: when you want to do a fresh reinstall, you need to format your personal computer. So let's use VirtualBox (free virtualization software) to run a Ubuntu Server.

The process is actually very straightforward so I am going to be very brief about it. At the end you will have a server with Apache / Mysql / Php and ssh access.

  • Download VirtualBox and the Ubuntu Server ISO file.
  • Install and open VirtualBox (you don't need to mount the Ubuntu iso).
  • Create a new virtual machine (Memory 512Mo / Hard drive: 8Gb).
  • Run it, it will ask you the Ubuntu ISO file.
  • Follow the install procedure.
  • When you have the screen to install services, select the ones you will need luckily need: SSH, Apache etc.
  • Once the installation is finished, stop completely the virtual machine.
  • Open a Mac terminal and enter (replace machine-name by the name of your machine in VirtualBox):
    • VBoxManage modifyvm "machine-name" --natpf1 "guestssh,tcp,,2222,,22" # SSH
    • VBoxManage modifyvm "machine-name" --natpf1 "apache,tcp,,8888,,80" # Apache
  • Launch your virtual machine.
  • Open Safari: http://localhost:8888/, if you see "It works!", it means apache is working properly.
  • Open a terminal: ssh username@localhost -p 2222.

Commentaires

Christophe Maximin 14 Septembre 2011

Or.... you can just use XAMPP for mac, which is well contained in one single folder, and works pretty well for most apache/php/mysql usages :)

Reply

xethorn 15 Septembre 2011

@ Christophe Maximin: I want to do some crazy things like installing an HBase etc. XAMP can be very limited when you want to have a full control.

Reply

thoas 27 Septembre 2011

Agreed on VM.

You can also use vagrant (http://vagrantup.com/) which simplifies setup step for your VM and installation with puppet or chef ;)

What are you building with HBase?

Reply

xethorn 02 Octobre 2011

@ thoas: Since I am not administrating servers/databases for high scale traffic, I never really get a change to look into Puppet.

I just wanted to set up a coding environment under my mac, something simple.

For HBase, I just want to try it out, nothing really defined.

Reply

Ajouter un commentaire