You are on page 1of 10

Robert Bromfield: Information Technology Professional

How to configure VMWare Workstation/Server, install Ubuntu, install VMWare

tools, install apache2, create a self signed certificate, test the web server, and

create/check MD5s.

What you need:

VMWare Server or Workstation

Ubuntu 6.06 LTS Iso

Assumptions:

You have VMWare Workstation or Server installed

You have downloaded the Ubuntu 6.06 LTS Iso

Configuring VMWare Workstation/Server:

In this tutorial I will be using VMWare Workstation, however it is very similar to

Server.
Installing VMWare tools:

The VMWare tools gives:

1. Improved mouse movement and the ability to move the mouse from the virtual

machine to the host machine without press Ctrl+Alt.

2. Improved network support.

3. Improved sound.

4. Shared folders.
5. On a Windows based host and guest machines; shared copy and past

clipboards and drag and drop of files from host to guest and vice versa.

How to:

In Ubuntu bring up the terminal by clicking “Applications” -> “Accessories” ->

“Terminal.”

In the Terminal you will be typing commands:

1. sudo apt-get install gcc-4.0 make linux-headers-$(uname -r)

2. The computer will download a few things.

3. sudo ln -s /usr/bin/gcc-4.0 /usr/bin/gcc

4. From the VMWare Workstation/Server menu, choose VM->Install

VMware Tools. You should see a mounted CD image show up on the

desktop.

5. Extract and install the tools.

6. cd /tmp

7. “For Workstation”: tar xvfz /cdrom/VMwareTools-5.5.2-

29772.tar.gz

8. “Or Server”: tar xvfz /cdrom/VMwareTools-1.0.1-

29996.tar.gz

9. cd vmware-tools-distrib

10. sudo ./vmware-install.pl

11. Accept the default locations for the prompts.

12. At the screen resolution option, choose the appropriate resolution for your

screen.
13. Now you can either turn off or restart the system. You can also remove the

Iso file from the setup options and set it to a regular CD/DVD drive.

Creating a Snapshot:

The purpose of the creating a snapshot is to capture/save the current state of the

virtual machine. This can be done while it is running or while it is off. It is a lot

faster when it is off.

1. In the VMWare tool bar click, the button that says, “Take snapshot of

Virtual Machine.” In Workstation you have a snapshot manager so you can

take multiple snapshots, however in Server you can only save one snapshot per

virtual machine.

2. I suggest that you take a snapshot now since you will be doing a lot of changes

and you could mess something up. This way you can always return to a clean

state.

Installing Apache2

Apache2 is a free web server that can be installed in Ubuntu.


1. Open a terminal window.

2. sudo apt-get install apache2

3. Accept, then download and install the required components.

How to create a self signed certificate, have Apache2 listen to port 443, and get

SSL running on your server.

1. sudo su

2. cd /etc/apache2/sites-available

3. cp /etc/apache2/sites-available/default default.default

4. Run the SSL generating script:

5. This script creates a certificate which is valid for 1 year:

6. /usr/sbin/apache2-ssl-certificate -days 365

7. You will be then asked a few questions about your location. Go ahead and

fill those in; when it asks for the server name put in localhost which is

127.0.0.1, since we will be running this server for testing purposes. If you

have a domain name, then you could put that it in if it corresponds and is

set up for your server. For email address put in webmaster@localhost.

8. Continue by typing in the following:

9. apache2-ssl-certificate

10. a2enmod ssl


11. cp /etc/apache2/sites-available/default /etc/apache2/sites-

available/ssl

12. ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-

enabled/ssl

13. cd /var/www

14. mkdir html

15. cd /var

16. mkdir www-ssl

17. cd www-ssl

18. mkdir html

19. Now you will have to edit a file.

20. Press Alt+F2 for the “Run Application” window, then type in

21. gksudo nautilus

22. This gives you root privileges in the current file browser window.

23. Navigate to /etc/apache2/sites-available/ and open the file called

“default” earlier you backed up the file just in case.

24. Now modify the file at the top to look like this:

25. NameVirtualHost *:80

<VirtualHost *:80>

ServerName localhost

DocumentRoot /var/www/html

Do not include this but read it: (Note: Use your assigned IP or DNS name with

":80" if you have one for ServerName).


26. Save and close the file after you have made the modifications.

27. Now navigate to /etc/apache2/sites-available/ and open the file called

“ssl”

28. Now modify the file at the top to look like this:

29. NameVirtualHost *:443

<VirtualHost *:443>

ServerName localhost

DocumentRoot /var/www-ssl/html

Do not include this but read it: (Note: Again, use your assigned IP or a

DNS name with ":443" if you have one for ServerName.)

30. Save and close the file after you have made the modifications.

31. Go to this file /etc/apache2/ports.conf and add the following to it.

32. Listen 443

33. Save and close the file.

34. In the middle of /etc/apache2/sites-available/ssl file, after the

commented area which says "# Possible values include: debug, info,

notice, warn, error, crit..." add the following:

35. SSLEngine On

SSLCertificateFile /etc/apache2/ssl/apache.pem

36. Save and close the file.

37. Now we are going to restart apache by typing in the terminal:

38. cd /etc/init.d
39. ./apache2 restart

40. You are now finished.

Testing the apache server for http and https connectivity:

We will create a html document in a text editor to make sure that the server is

functioning correctly.

Sample html page:

<html>

<head>

<title>Test Page</title>

</head>

<body>

You have accessed this page through http or https.

</body>

</html>

Now save the file as index.html. Now navigate to /var/www/html and place a

copy of index.html there. Then navigate to /var/www-ssl/html and place

another copy of the file there. If you closed the root privileged file brower

window, then press Alt+F2 for the “Run Application” window, then type in

gksudo nautilus. This gives you root privileges in the current file browser
window. Open a web browser in Ubuntu and type in http://localhost in the

URL address bar. This should bring up a page that says, “You have accessed

this page through http or https.” This proves that http works. To check for

https, type in https://localhost, you should get a request to accept the

certificate. After accepting the certificate you should see the page “You have

accessed this page through http or https.” There now everything is

working perfectly. If you want someone to connect to you from the outside, you

have a few ways to do this in Ubuntu. You can go to www.whatismyip.com to find

out your real IP address or go to “System” -> “Administration” -> “Network

Tools.” At the “Network Tools” windows under “Network Device” change it from

“Loopback Interface” to “Eth0” to see your IP address. If you are on a router you

will see your Internal IP Address, also make sure to forward port 80 for the

Ubuntu machine on your router or make it the DMZ.

How to check a MD5 checksum:

I will show you how to create a md5 checksum of a file in your home folder.

Type in the Terminal

Md5sum the_name_of_the_file.extension >

the_name_of_the_file.extension.md5

This will create a checksum in the same directory.

To verify:

Type in the Terminal


md5sum –c the_name_of_the_file.extension.md5

You might also like