Personal home pages could be created in any web server to which one has a user account. In practice students have user accounts of Tuomi server and the staff have user accounts of Koivu server. Both of the servers are Apache web servers and the users have a home directory (5 GB) there. You can create personal web pages in your own home directory, home pages are base service for users, in other words it is free of charge.
The external web pages of the researchers and units (for example faculties, service units and research units), projects and events of the University are created using the Drupal web content management system. The guides which are related to this, are available for the staff in Patio intranet.
Notice, that there are a set of rules that you are expected to obey when publishing content on your home pages. For example the commercial and political operation is forbidden. Do not either use pictures under a copyright or other material even if you found them in the Internet. Read more information about the copyrights on the Finnish pages KOPIRAITTILA.
The contents of this instruction:
- Web address of home page
- Creation of home page and setting of user rights
- How do I prevent search robots from indexing my pages?
- Limiting the access to pages
- FormMail
- Counter
- Guestbook
- Search
1. Web address of home page
Create your home page in a subdirectory public_html in your home directory. You need to give access rights for the subdirectory to make pages visible in internet. When using internet browser, the address of your public_html subdirectory (=home pages) is written in form:
- student’s home page:
www.student.oulu.fi/~account/
where account = student’s user account
- staff member’s home page:
cc.oulu.fi/~account/
where account = staff/researcher’s user account
2. Creation of home page and setting of user rights
You can create home pages in Unix system:
- Open ssh-connection to server Tuomi (students) or Koivu (staff)
- In addition, the Lehmus cluster (https://lehmus.oulu.fi) login node lehmus-login1.oulu.fi is available for both staff and students.
- Create the subdirectory public_html and set user rights: cd ~
mkdir public_html
chmod a+x . public_html - After that, use pico editor to create a file index.html which wll be your home page:
cd ~/public_html
nano index.html - Give reading rights for everyone (other) to your web files in subdirectory:
cd ~/public_html
chmod a+r * - If you create more subdirectories in public_html, then give execution rights for everyone (other) to new subdirectories and reading rights to all files in those directories.
- You can update your home pages using samba (drive K:) in Windows workstation.
3. How do I prevent search robots from indexing my pages?
You can easily get your page protected from search robots by adding a hide in the head section of the pages you want:
META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW”
However, not all search robots follow this universal standard and they index the pages anyway, however, some of them may respect your privacy with this definition.
4. Limiting the access to pages
You can set a username and password for individual pages, or restrict the views of pages to everybody.
- The restriction on using web pages is based on a .htaccess file that can be made into every html directory. The .htaccess file only affects the directory it is in.
- An example:
AuthName TomiTesti
AuthType Basic
AuthUserFile /home/otol/tomilepp/.htpasswd
AuthGroupFile /dev/null
require valid-user - The .htpasswd file has each user’s password cryptated. Most easily, it is done with htpasswd program. The password file must not be put in public_html, or any other directory accessible with the web browser.
- An example how to create .htpasswd file:
htpasswd -c /home/otol/tomilepp/.htpasswd tunnus - Both files .htaccess and .htpasswd must include the read rights for all:
chmod a+r .htaccess .htpasswd - The limiting according to ip addresses is successful with the following .htaccess file:
order deny,allow
deny from all
allow from .oulu.fi
5. FormMail
The www server has a universal script with which information from the web form on your website can be sent as an email to one or more recipients.
Way 1: The email address of the recipient is not visible on the web page:
- Use email address to create a FormMail account on: https://www.oulu.fi/perl/formmail/hallinta.pl
Example:
In this example, two accounts have been created, the first for one recipient and the second for two recipients.
- Use the “encrypted” account without the email address.
Example:
<html>
<head>
<title>Testilomake</title>
</head>
<body>
<form method="post" action="http://www.oulu.fi/cgi-bin/FormMail.pl">
<input type="hidden" name="recipient" value="66f159c9e73e4246d128d8e1652336fcxx">
Nimi: <input type="text" name="Nimi"><br>
Puhelin: <input type="text" name="Puh"><br>
<input type="submit" value="Lähetä">
</form>
</body>
</html>
Way 2: The email address is visible on the web page
You can access the form when you indicate the reception address keskitetyt (at) oulu.fi to add your address to the whitelist. This is not the preferred method, since “späm robots” find your address and use it to spam.
Example:
<html>
<head>
<title>Testilomake</title>
</head>
<body>
<form method="post" action="http://www.oulu.fi/cgi-bin/FormMail.pl">
<input type=hidden name="recipient" value="etunimi.sukunimi@oulu.fi">
Nimi: <input type="text" name="Nimi"><br>
Puhelin: <input type="text" name="Puh"><br>
<input type="submit" value="Lähetä">
</form>
</body>
</html>
Sending the information as encrypted
If you want to send data encrypted from the web browser to the server, you can use the ACTION line:
<form method=”post” action=”/th/perl/formmail/FormMail.pl”>
6. Counter
You can use a visitor counter on the page using a tag:
<img src=”/cgi-bin/Count.cgi?df=omatunnus.dat”>
- In the code, omatunnus is your user account. In this way your counter won’t go messed up with other counters.
- More information on: http://www.muquit.com/muquit/software/Count/Count.html
7. Guestbook
First create the guestbook and then create the page for the guestbook.
a) guestbook on student’s homepage ( ‘tunnus‘ is your user account):
ssh nfstu
cd /netservices/www/guestbooks
touch tunnus
chmod a+rw tunnus
cp tomilepp.html tunnus.html
chmod a+r tunnus.html
b) guestbook on staff’s homepage( ‘tunnus‘ is your user account):
cd /netservices/www/guestbooks touch tunnus chmod a+rw tunnus cp tomilepp.html tunnus.html chmod a+r tunnus.html
- Next you can edit the file tunnus.html: pico tunnus.html
- After that, create the page for the guestbook, for example guestbook.html could be like this:
<html>
<head>
<title>users’s guestbok</title>
</head>
<body>
<p>
You can just view guestbook, or you can add your entry to it.</p>
<form action=”/cgi-bin/guestbook/guestbook.cgi” method=post>
<input type=”hidden” name=”file” value=”tunnus”>
<input type=”submit” value=”View guestbook”>
</form>
<hr>
<form action=”/cgi-bin/guestbook/guestbook.cgi” method=post>
<input type=”hidden” name=”file” value=”tunnus”>
<input type=”hidden” name=”mode” value=”add”>
Name:<br>
<input type=text name=”name-required”><br>
Email:<br>
<input type=text name=”email”><br>
Homepage:<br>
<input type=text name=”homepage URL”><br>
Comments:
<br><textarea rows=6 cols=60 name=”comments-multi”></textarea><br>
<input type=”submit” value=”Add entry”>
</form>
<hr>
</body>
</html>
8. Search
The search feature can be added to the pages in the following way:
<form method=”post” action=”http://www.oulu.fi/cgi-bin/htsearch“>
<input type=hidden name=config value=htdig>
<input type=hidden name=restrict value=”oman_sivusi_osoite”>
Search for: <input type=”text” size=”30″ name=”words”>
<input type=”submit” value=”Search”> </form>
- Change to the point of restrict the url in which you want to limit the search.
- Htdig search engine index the pages once a week (during the night between Sunday and Monday), so the new pages don’t appear in the search at once.
- The search looks like this.