This is the very basic Vagrant configuration to create a VM with LAMP stack on it accessible from the host machine. By the end of the installation you will get:
- VM running Ubuntu 13.04 (Raring Ringtail) 64-bit
- Apache, PHP and MySQL
Database configuration for your project:
- Database host: 192.168.33.10
- Port: 3306
(Be sure that ports 80, 2222 and 3306 are not being used on host machine. If they are, you need to change VagrantFile)
-
Download and install VirtualBox -- tested with 4.2.18 on Windows 8
-
Download and install Vagrant -- tested with 1.3.1 on Windows 8
-
Download source of this repository and place contents to the root of your project
-
Navigate to the project root using terminal
-
Run: > vagrant up (it will take a few minutes at least for first time)
-
Run: > vagrant ssh (OR use a ssh client, like putty to connect to: [email protected] -p2222 OR [email protected]) User: vagrant Password: vagrant (check if you can connect to the machine)
-
Install apache2, mysql and php(one time only):
sudo su - (as root user) apt-get update apt-get install apache2 php5 php5-cli libapache2-mod-php5 php5-dev php5-mcrypt libapache2-mod-perl2 apt-get install php5-cgi php5-cli php5-common php5-curl php5-dbg php5-dev php5-gd php5-gmp php5-ldap php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-adodb php5-imap unzip php5-mhash php5-odbc curl libwww-perl imagemagick apt-get install mysql-server mysql-client libapache2-mod-auth-mysql php5-mysql update-rc.d apache2 defaults update-rc.d mysql defaults service mysql restart service apache2 restart Go for the rest of this guide to configure php and mysql: http://www.ubuntugeek.com/install-sugarcrm-community-edition-in-ubuntu-810-server.html (further fine tunning might be needed)
-
Add new line to your /etc/hosts file or c:\windows\system32\drivers\etc\hosts
192.168.33.10 dev.local
-
Open dev.local in your browser
-
Check you can connect to the database on port 3306 on localhost