Being able to share results with collaborators, colleagues, and clients is a hugely important skill for a bioinformatics programmer to know.
One of the main tools bioinformatics programmers use to share results of their work is via Web sites.
In this exercise, you'll learn how to set up and configure an Apache Web server, which is the first step toward using the Web to share results.
Apachectl is an apache control script that starts, stops, and restarts the Apache Web server, which is installed by default on most UNIX systems. The apache program file on UNIX is named httpd, which stands for "httpd daemon." On most UNIX systems, you'll find that httpd resides in /usr/sbin, a directory that contains programs run by the super-user. The apachectl is a shell script "wrapper" for the httpd program.
However, most systems won't launch the Apache web server unless configured to do so. Thus it is likely that the base image but won't start serving Web pages until you launch the server using the apachectl script.
That's apachectl with an el character, not a one.
You may need to execute the find command as root (using sudo) because many files and directories on a Unix system are owned by user "root" and are not readable by ordinary users. The apachectl script may be one of them. To find it, use find.
$ sudo find / -name apachectl
Question: What is the absolute path to your copy of apachectl?
To find out what commands apachectl supports, try this:
$ sudo PATH/apachectl
where PATH is the absolute path to the script on your VM.
Start the server using apachectl. If PATH is the absolute path to apachectl, then start the Web server like so:
$ sudo PATH/apachectl start
The document root is the directory on your server's file system where Web pages are stored; its location is specified in file httpd.conf, the configuration file that configures how the server will run. Probably your document root will be located in /var/www/html.
To confirm the document root location, find httpd.conf and then search through the file for the text DocumentRoot.
To create your Web page, log into your VM and cd in to the DocumentRoot. Use sudo to launch an editor, such as nano, which is probably installed. Create a file called index.html and save it in your DocumentRoot. If users don't specify a file in the URL, the Web server will send them a file called index.html, if it exists. Here's an example index.html file, written HTML (hypertext markup language), the language of the Web.
<!DOCTYPE html> <html> <body> <h1>Hello! Welcome to my Web site</h1> <p> Here is a very simple example. </p> </body> </html>
To find out more about how to create and edit Web pages, do this tutorial on HTML - http://www.w3schools.com/html/default.asp.
To receive full credit, post a link to the Web page you created to the class newsgroup.
Apache is one of the most robust, well-documented, and versatile software programs in existence. It is an essential tool in bioinformatics programming because much of what we do involves creating and sharing results with collaborators, the public, and so on. Learning how to configure and manage Apache servers and Web sites is well worth the investment of your time and energy. If you'd like to dig a little deeper (and have time!) check out some of the following links: