Not to long ago I took a class in HTML5, while the teacher encouraged everyone to just work off their own machine and just open the web pages they design with a browser. Being a bit of a nerd, I couldn’t bring myself to do it this way. To me I was making a web site so I wanted a web server, after all if I was ever to do this in the wild I want to know how its going to work. For the class I actually ended up running a full Linux desktop with Apache and I thought it worked great (Linux Mint, woo hoo!), but when I built a website outside of class for the first time I ended up using Ubuntu Server with Apache running on it, and thats the version illustrated below.
If you are just messing around with code and want a nice one stop shop I highly recommend the following configuration and to answer the question before you ask it, its all FREE.
Ubuntu Linux (server edition of course)
Apache
Brackets
(if messing with databases)
MySQL
MySQL Workbench
Now is not the time to do anything with that though so lets get on to making our web server. Only 2 pieces of software you need for this process, only 1 if you are going to install on a piece of hardware rather than a VM but I will be using a VM. The Virtual software of choice today will be Virtualbox from Oracle, and of course you will need to grab a copy of Ubuntu server here. I recommend grabbing the LTS (Long Term Support) version just because the regular versions (for lack of a better word) get replaced with another version fairly often.
Virtualbox – https://www.virtualbox.org/wiki/Downloads
Ubuntu Server – http://www.ubuntu.com/download/server
A lot of Windows Admins, I have found, are either dead set against ever using an OS other than Windows or they think Linux is kinda neat but have never tried it (genarally I think its the command line interface that does it). Really though, its not that bad. Im sure there is a lot more that it does than what I do with it but even still it has turned out to be a great tool for a lot of things, especially when I can find older machines to give away Linux will normally run great on that hardware.
Once you have a copy of Ubuntu Server its time to make a new VirtualBox, really for this the defaults will be just fine too. I believe the defaults for Ubuntu Server are 512gb RAM and 8gb of storage, sounds small but remember there isnt a heavy desktop to run and the OS will take up less than 1gb total. Once you step through the defaults mount the ISO that you downloaded and start it up.
There isn’t going to be a slick graphical install like there is for Windows but Ubuntu does a great job of walking you through everything you are going to need. Starting right off the bat verifying your language and then the pretty self explanitory “Install Ubuntu Server” prompt.
![Ubuntu 02](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20280'%3E%3C/svg%3E)
There will be several screens relating to your language and keyboard, more than are probably necessary but you know by the end you will have the exact right choices.
The user account prompts will appear after you have your language information squared away and of course its as simple as entering a username and setting a password for it…don’t forget to confirm the password. This is a test machine, for the next few screens you will be faced with encryption options and disk partioning and blah blah, defaults my friend. Would I suggest that for something in production, nope, but this ain’t production.
The Software Selection screen, yup, its that easy. Use the arrow keys to move between options and the space bar to select and you can install just about anything you might need right from this prompt. Since we are making a web server, you can select it right there. If you don’t want to select it there, one more step and its there. Even if you don’t install anything else here, SSH Server is always a good bet, it will allow you administer from a PuTTY session and even sFTP files to the box. From here run through the rest of the defaults and let Ubuntu install.
Once installed bring up the server and login with that username you created while installing the OS. You’ll notice that its still a black screen with white text, nothing fancy about it but it will work well for what you need. From here the installs are via command, and for a web server that command is as follows: sudo apt-get install apache2. Just let it run its magic, when its done, I personally like to give the box a restart but not usually necessary. Now that the web server is installed another command, ifconfig, will give you the IP so that you can connect from your browser. ![Ubuntu 13](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20242%2029'%3E%3C/svg%3E)
From there, once apache is installed you will have to do a quick edit on the web directory to add permissions. For this example keep in mind that we are making this to tinker with so we are just going to take over ownership of the directory, if this were a live box of course we would take our time and apply correct permissions. The following command will give your user account ownership and allow you to be able to “work” in that directory.
![permissions command](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20333%2020'%3E%3C/svg%3E)
From here you are left to your own devices, MySQL was mentioned at the top as an “if” but that is something that will extend this article way past the point that anyone would want to keep reading so perhaps that may make it to a separate entry. Another thing mentioned above is “Brackets”, that is a free web editor that can run on your Windows machine (or Mac or if you did this build out as a Linux desktop, there too). From there you can develop and upload your code to your dev box and run it.