Sunday, January 8, 2012

Ubuntu Apache Dev Web Server Install


I'm investigating Yii, a PHP web framework, for some friends. We want to do a web project and they know at least some PHP. Since I don't want to do all the programming myself, PHP seems like a good option.

The first step is installing the Apache HTTP Server. While I have that self-same web server already installed on my machine as a service, I decided I wanted a development copy I could mess up and not hose my machine's install.

Going to the Apache download site, I see 2.2 is the latest stable version. I navigate to that page and find the Unix tarball to download. Once downloaded, I extract the file any old place.

Step 1 -  run 'configure' with your final install directory for Apache.
./configure --prefix=[Apache Install Dir] --enable-so
Lots of output follows. I recommend giving a full path vs. a relative path to the install directory. You can probably use either but you never know.

Step 2 - Now it's time to run 'make'.
make
Lots more output follows.

Now run 'make install'. This actually creates the server instance software in you install directory you picked in step 1.
make install
Now navigate to your Apache install directory. Since this is a development web server, we're going to change the default listing port to 8080. I do this so it won't interfere with an installed web server running on the default port of 80.
cd [Apache Install Dir]/Apache2.2/conf
Use your favorite editor, and open httpd.conf. Find the line 
Listen 80
Change it to
Listen 8080
You can substitute 8080 with any other open port. If you need to see if a port is open you can run
netstat -a
and look through the results to make sure your port isn't in use.

Now change directory to the Apache bin directory and run apachectl start. This starts your web server.

cd [Apache Install Dir]/Apache2.2/bin
./apachectl start
Now open a web browser and try
http://localhost:8080/
You should bet a message that says
It Works
If you get this pat yourself on the back and go get a cup of coffee smiling that you've successfully geeked for the day. If not, do what we professionals do, consult the all knowing Google search.

Coming up next, configuring Apache to run PHP.


Saturday, January 7, 2012

Expanding A Disk in Oracle's VirtualBox

I run Ubuntu Linux at home. I love Linux. It's fast, has a smaller footprint than other O/Ss, and it's free. The rest of the world, however, lives on MicroSoft Windows or Apple OSX. I don't mind this. I like being different and enjoy the time I don't spend on virus issues and the money I save on hardware.

Still, ever so often you need a Windows operating system. Normally I can do these small tasks using other resources, but recently I've been hit over and over again with the need to have Windows at home.

If you run Linux you have a few options. You can use Wine to run windows applications within your Linux O/S or you can use a Virtual Machine server to host a Windows O/S within your Linux system. I decided to go this route.

I was once a VMWare fan. I guess I still am but Oracle has a free product called VirtualBox that was recommended by my next door neighbor, the Linux Kernel Commando. The primary advantage to VirtualBox is its ability to access the USB port. VMWare doesn't do that, at least the free version doesn't.

VirtualBox is easy to download, install, and setup as was the Extension Pack which added the USB 2.0 support. Everything was wonderful once I had Google Chrome installed in my new Windows 7 instance. I used it rarely, but it was always there when I needed it. The only issue was when it cranked up, Windows would download the latest MicroSoft patches. I think the VM spent more time patching than running.

Then came my decision to purchase MicroSoft Office 2010. I had 20 GB allocated to my Window's VM and needed more. VirtualBox doesn't have a nice little switch to extend a disk from their console (hint: THEY SHOULD). You have to go to the command prompt and do it. The pig that is Microsoft Office needs over 40 GB to install. After futzing around, making new drives, and generally getting frustrated, I found the magic command to extend a virtual disk.

Before running this, make sure you have a good snapshot of your current VM image. I did a full clone as well just in case.  Here's a screen print of my current VirtualBox console (after the expansion). Note the happy little Snapshots(1) button in the upper right. That's where you go to make the snapshot.


The command to expand the disk to 80 GB is

VBoxManage modifyhd [virtual disk filename] --resize [size in MB]

You find the path to the file from the Storage link on the console above. You can find this and other VirtualBox commands in the Manual.

I was then able to go in and install MicroSoft Office with no problems although I wonder how much more time my little VM will spend patching itself.



Friday, January 6, 2012

Microsoft Office

I write as a hobby. What's more I also do some small office programming. I'm finally ready to throw in the towel and purchase Microsoft Office. Sadly, I have no choice.

I've use Open Office for years and I love it. It does almost everything I need for word processing, spread sheets, and presentations. But there is a last 1% that I need that I can't get from Open Office, precise formatting of Microsoft Office exports.

I consider this a sad day but I will save time and money in the end by paying the giant from Redmond his due.