- Install VirtualBox: https://www.virtualbox.org/
- Install Vagrant: http://vagrantup.com/
Select a Vagrant Box from https://vagrantcloud.com
# Add it to your list of boxes
vagrant box add ubuntu/trusty64
# Create a new folder for your project & init vagrant
vagrant init ubuntu/trusty64
# Run your new machine
vagrant up
# ssh into your new machine
vagrant ssh
Now you are connected to a new machine!
- hit
exit
to disconnect
- open the Vagrantfile and uncomment the private_network line & change to your desired IP
config.vm.network "private_network", ip: "22.22.22.22"
- run
vagrant reload
- make a fake domain for that ip
- run
sudo open /etc/hosts -a Atom
to open your /etc/hosts file in Atom - add this line to the end of the file and save
22.22.22.22 dev.mysite.com
- run
Nice! Now going to mytestsite.com will connect to our machine!
sudo apt-get install apache2
This installs the industry standard Apache web server
sudo apt-get install htop
Gives you access to the htop
command for monitoring of resources and background processes
cd /var/www/html
Change directory (not necessary, but easy to verify files have transferred if you are already in the right directory)
If you're using Vagrant, the username and password are both set to vagrant
by default.
sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rwX /var/www
These commands give permission to use SFTP to connect and transfer files to the server. SFTP is not the fastest or most secure way to transfar files to the web server but it is easy for beginners as you can use an FTP client with a GUI like FileZilla. That is what I use for any type of FTP file transfers personally.