|
make a "hello world" web page
last modified:
12:51 PM MST, Sun 05 Feb 2006
In this first part of the tutorial you will
make a very simple html document to show at your personal website.
Most of the directions are specific for making and installing the
website on the Linux computer: gentry.metr.ou.edu.
To log onto gentry, you must use secure shell.
Connection via ssh should allow "forwarding of X-window traffic".
For example, ssh
will allow you to run a GUI text editor, e.g. gedit or nedit,
on the monitor of your local computer.
Gentry is configured to access users web pages
in the directory public_html.
If you do not have that directory yet,
make it with:
mkdir public_html
All users have a unique
group, containing the user and the webserver,
in this case apache. The name of this unique group
is also the name of the user.
Gentry is rather paranoid about security, and wants
minimal permissions granted to files and directories that
will be displayed on the web.
All html files should be readable
by the group, but not writable.
There is no point of having any of your files or directories
readable, writable or executable by others.
If order for you public_html directory to be navigable
by apache, it should be exectuable by your group. Therefore:
chmod 710 public_html
Similarly, in order for apache to navigate to your public_html directory,
your top directory in /home should be executable by your group.
For example, if your
login is jstudent, you can set this by
chmod 710 /home/jstudent
(On some accounts issued after Sept 4, 2005, the above
step may have been done for you.)
By the way (for those of you who need or want to know),
in /etc/bashrc, the following is now set: umask=0027.
This means your default permissions for files is 640 and for directories is
750. In other words, no permissions are allowed for "others", by default.
See
Configuring the bash shell and
Understanding file permissions Tutorial.
Go into your public_html directory with
cd public_html
If the Unix commands mkdir, chmod and cd
are unknown to you, you may want to become familiar with them
at
linuxcommand.org. Here is a site that explains
chmod.
But beware that the examples at the bottom of that page are for a server without
apache in the user's group, in which case apache would be "other".
On Gentry,
we only need to open up permissions for
your personal group (containing you and apache) for the
web site to be functional.
now create bland.html
If you do not have a file bland.html within the
/home/joestudent/public_html directory,
use an editor (gedit is recommended for newbies) to create one:
gedit bland.html
or, to keep your command line functional, run gedit as a "background process":
gedit bland.html &
Type in the text hello world or other bland nonsense
and save it. You may want to set minimal permissions for this file:
chmod 640 bland.html
Then in a browser, on any computer connected to the
internet, go to http://gentry.metr.ou.edu/~joestudent/bland.html,
and you should see your nifty webpage.
|