Tjenester/Hjemmesider: Difference between revisions

From Programvareverkstedet
m (leslig -> leselig)
m (Oysteikt moved page Hjemmesider to Tjenester/Hjemmesider: Categorize maintenance and service docs)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[#Homepages|English]]
En hjemmeside er et eller flere dokument som befinner seg på en brukers hjemmekatalog.
En hjemmeside er et eller flere dokument som befinner seg på en brukers hjemmekatalog.
For å lage din egen hjemmeside her på PVV må du gjøre følgende:  
For å lage din egen hjemmeside her på PVV må du gjøre følgende:  
Line 50: Line 52:
= Se også =
= Se også =
[[Drift/Web|Teknisk informasjon om webserver]]
[[Drift/Web|Teknisk informasjon om webserver]]
= Homepages =
A homepage is one or more documents that are located in a users home directory. To make your own homepage here on PVV you have to do the following:
* Read [[Webreglement|The web rules]]
* Make a directory <i><code><nowiki>web-docs</nowiki></code></i> at the root level of your home directory. Run the command: <b><code><nowiki>mkdir ~/web-docs</nowiki></code></b>. Note that this directory DOESN'T have the same name as on the student computer labs.
* Set the correct attributes on your home directory and the web-docs catalog.
** Your home directory must be available ('execute'-access) for <i><code><nowiki>gruppe</nowiki></code></i> and <i><code><nowiki>others</nowiki></code></i>. This can be done with the command: <b><code><nowiki>chmod g+x,o+x ~</nowiki></code></b>
** The web-docs directory must in addition be readable for both of these. Can be done with the command: <b><code><nowiki>chmod g+rx,o+rx ~/web-docs</nowiki></code></b>
** If you then run the command: <b><code><nowiki>ls -ld ~ ~/web-docs</nowiki></code></b> it should (as a minimum) say the following first on the lines: <code><nowiki>drwx--x--x</nowiki></code> and <code><nowiki>drwxr-xr-x</nowiki></code> (it might be that it says <code><nowiki>drwxr-sr-x</nowiki></code> on the last)
* Make one or more of the standard files in the web-docs directory
== Logger ==
If you wish to receive logs on visits to your home page (for an instance to make statistics) you can make the directory nobackup/weblogs in your home area. The log with then be written continuously, in separate files each day.
== Standtad-files in ~/web-docs ==
=== index.html ===
The page that is presented if someone requests http://www.pvv.ntnu.no/~brukernavn/.
=== other-homepage ===
If you have a homepage somewhere else than PVV, but wish to be on the list of users at PVV with their own homepage, you make this file. The first line of the file will then be used as URL to your own homepage.
=== .beskrivelse or .description ===
Description of yourself or your homepage that will be put behind your name in the list of homepages on PVV. The text is limited to 50 characters.
When the list of users at PVV is built (3 times a day), these files are prioritized in this way:
# other-homepage
# meg.html
# index.html
(Note that .beskrivelse or .description always get on the list.)
== CGI-script ==
CGI-script are programs that write headers and HTML. They are often written in Perl, Python or a similar language. To use a cgi-script at PVV it is sufficient to give it the file extension ".cgi". PHP at PVV is not run as cgi but as a separate Apache module, and you can therefore use PHP directly without having to do any additional work.
If you for some reason don't want to name your CGI-scripts something that ends on ".cgi" (for an instance because you use some third party software that you do not want to fiddle too much with) you can make a cgi catalog in this way:
# Make a dedicated CGI-catalog (for an instance cgi-bin) in your web-docs catalog.
# Add the file .htaccess with the content:
<pre>
Options +ExecCGI -Indexes
SetHandler cgi-script
</pre>
# Make the catalog and .htaccess available for others. (Use chmod a+rx catalog and chmod a+r .htaccess.)
# All files that yoy put in this catalog, and in sub-catalogs, will be treated as CGI-script and run instead of getting show directly. A typical URL to such a script then becomes: http://www.pvv.ntnu.no/~bruker/cgi-bin/script
= Your own domain and similar things =
It is not possible to have a virtual server for your own domain at PVV. You can have non-commercial content on PVV, but you must then make your ISP/web-hotel set up a HTTP-forwarding (redirect) to http://www.pvv.ntnu.no/~user/
It is not sufficient to make a DNS-pointer to PVVs web-server, because this requires that PVV sets up a virtual server or a redirect to your pages on the server.
There are several reasons for this, but it is primarily because PVV as a whole is subject to NTNUs IT-rules.
= Also See =
[[Drift/Web|Technical information about webserver]]


__NOTOC__
__NOTOC__

Latest revision as of 08:42, 10 July 2024

English

En hjemmeside er et eller flere dokument som befinner seg på en brukers hjemmekatalog. For å lage din egen hjemmeside her på PVV må du gjøre følgende:

  • Les Webreglement
  • Lag en katalog web-docs i rotnivået av hjemmekatalogen din. Kjør kommandoen: mkdir ~/web-docs. Merk at denne katalogen IKKE har samme navn som på studentsalene.
  • Sett riktige attributter på hjemmekatalogen din og web-docs katalogen.
    • Hjemmekatalogen din må være tilgjengelig ('execute'-tilgang) for gruppe og others. Dette kan gjøres med kommandoen: chmod g+x,o+x ~
    • web-docs katalogen må i tillegg være leselig for begge disse. Kan gjøres med kommandoen: chmod g+rx,o+rx ~/web-docs
    • Hvis du da kjører kommandoen: ls -ld ~ ~/web-docs så bør det først på linjene (minimum) stå henholdsvis: drwx--x--x og drwxr-xr-x (det kan være at det står drwxr-sr-x på den siste
  • Lage en eller flere av standardfilene i web-docs katalogen

Logger

Dersom du ønsker å motta logger for besøk på hjemmesiden din (for eksempel for å lage statistikk) kan du opprette katalogen nobackup/weblogs i hjemmeområdet ditt. Loggen vil da bli skrevet dit fortløpende, i separate filer for hver dag.

Standard-filer i ~/web-docs

index.html

Siden som presenteres dersom noen forespør http://www.pvv.ntnu.no/~brukernavn/.

other-homepage

Dersom du har hjemmeside et annet sted enn PVV, men ønsker å komme med i listen over brukere på PVV med egen hjemmeside, lager du denne filen. Den første linjen av filen vil da bli brukt som URL til din hjemmeside.

.beskrivelse eller .description

Beskrivelse av deg selv eller hjemmesiden din som vil legges bak navnet ditt i listen over hjemmesider på PVV. Teksten begrenses til 50 tegn.

Når listen over brukere på PVV bygges opp (3 ganger i døgnet), prioriteres disse filene slik:

  1. other-homepage
  2. meg.html
  3. index.html

(Merk at .beskrivelse eller .description alltid kommer med i listen.)

CGI-script

CGI-script er programmer som skriver ut headere og HTML. De er ofte skrevet i Perl, Python eller et tilsvarende språk. For å bruke et cgi-script på PVV holder det å gi det endelsen ".cgi". PHP på PVV kjøres ikke som CGI men som en egen Apache-modul, og du kan derfor bruke PHP direkte uten noe om og men.

Om du av en eller annen grunn ikke vil kalle CGI-scriptene dine noe som ender på ".cgi" (for eksempel fordi du bruker noe tredjeparts programvare du ikke vil tukle for mye med) kan du lage en egen cgi-katalog på denne måten:

  1. Opprette en dedikert CGI-katalog (f.eks cgi-bin) i web-docs katalogen din.
  2. Legg inn filen .htaccess med innholdet:
Options +ExecCGI -Indexes
SetHandler cgi-script
  1. Gjøre katalogen og .htaccess tilgjengelig for andre. (Bruk chmod a+rx katalog og chmod a+r .htaccess.)
  2. Alle filer du legger i denne katalogen, og i underkataloger, vil bli behandlet som CGI script og kjørt istedenfor å bli vist direkte. En typisk URL til et slikt script blir da http://www.pvv.ntnu.no/~bruker/cgi-bin/script

Eget domene o.l.

Det er ikke mulig å ha virtuell server for ditt eget domene på PVV. Du kan ha ikke-kommersielt innhold på PVV, men da må du få ISPen/webhotellet ditt til å sette opp en http-videresending (redirect) til http://www.pvv.ntnu.no/~bruker/

Det er ikke tilstrekkelig å lage en DNS-peker til PVVs web-server, da dette forutsetter at PVV setter opp en virtuell server eller en redirect til dine sider på serveren.

Grunnene for hvorfor det er sånn er flere, men primært er det fordi PVV som helhet er underlagt NTNUs IT-reglement.

Se også

Teknisk informasjon om webserver

Homepages

A homepage is one or more documents that are located in a users home directory. To make your own homepage here on PVV you have to do the following:

  • Read The web rules
  • Make a directory web-docs at the root level of your home directory. Run the command: mkdir ~/web-docs. Note that this directory DOESN'T have the same name as on the student computer labs.
  • Set the correct attributes on your home directory and the web-docs catalog.
    • Your home directory must be available ('execute'-access) for gruppe and others. This can be done with the command: chmod g+x,o+x ~
    • The web-docs directory must in addition be readable for both of these. Can be done with the command: chmod g+rx,o+rx ~/web-docs
    • If you then run the command: ls -ld ~ ~/web-docs it should (as a minimum) say the following first on the lines: drwx--x--x and drwxr-xr-x (it might be that it says drwxr-sr-x on the last)
  • Make one or more of the standard files in the web-docs directory

Logger

If you wish to receive logs on visits to your home page (for an instance to make statistics) you can make the directory nobackup/weblogs in your home area. The log with then be written continuously, in separate files each day.

Standtad-files in ~/web-docs

index.html

The page that is presented if someone requests http://www.pvv.ntnu.no/~brukernavn/.

other-homepage

If you have a homepage somewhere else than PVV, but wish to be on the list of users at PVV with their own homepage, you make this file. The first line of the file will then be used as URL to your own homepage.

.beskrivelse or .description

Description of yourself or your homepage that will be put behind your name in the list of homepages on PVV. The text is limited to 50 characters.

When the list of users at PVV is built (3 times a day), these files are prioritized in this way:

  1. other-homepage
  2. meg.html
  3. index.html

(Note that .beskrivelse or .description always get on the list.)

CGI-script

CGI-script are programs that write headers and HTML. They are often written in Perl, Python or a similar language. To use a cgi-script at PVV it is sufficient to give it the file extension ".cgi". PHP at PVV is not run as cgi but as a separate Apache module, and you can therefore use PHP directly without having to do any additional work.

If you for some reason don't want to name your CGI-scripts something that ends on ".cgi" (for an instance because you use some third party software that you do not want to fiddle too much with) you can make a cgi catalog in this way:

  1. Make a dedicated CGI-catalog (for an instance cgi-bin) in your web-docs catalog.
  2. Add the file .htaccess with the content:
Options +ExecCGI -Indexes
SetHandler cgi-script
  1. Make the catalog and .htaccess available for others. (Use chmod a+rx catalog and chmod a+r .htaccess.)
  2. All files that yoy put in this catalog, and in sub-catalogs, will be treated as CGI-script and run instead of getting show directly. A typical URL to such a script then becomes: http://www.pvv.ntnu.no/~bruker/cgi-bin/script

Your own domain and similar things

It is not possible to have a virtual server for your own domain at PVV. You can have non-commercial content on PVV, but you must then make your ISP/web-hotel set up a HTTP-forwarding (redirect) to http://www.pvv.ntnu.no/~user/

It is not sufficient to make a DNS-pointer to PVVs web-server, because this requires that PVV sets up a virtual server or a redirect to your pages on the server.

There are several reasons for this, but it is primarily because PVV as a whole is subject to NTNUs IT-rules.

Also See

Technical information about webserver