Create your Home Page

Please read the following instructions to activate your personal web page:

  • The main HTML file should be named index.html, index.htm or index.php and must be placed in the subdirectory public_html of your home directory at eden.dei.uc.pt or student.dei.uc.pt. Just use the command "cd" to go to your home directory.

  • It is necessary to activate read and execute permissions on the “public_html” directory and execute permissions on your home directory. You can do this using the following commands:

    $ chmod 711 ~
    $ mkdir ~/public_html
    $ chmod -R 755 ~/public_html

  • Please note that the first command will allow other users to access your files. In order to protect your directory, transfer all your personal files from your home directory to other subdirectories. After that, use “chmod 700” on those directories to prevent access from other users.

You can access your web page using http://eden.dei.uc.pt/~{user} or http://student.dei.uc.pt/~{user} ("{user}" should be your DEI network login).

Available Languages with Apache (Students area only)

Apache at student.dei.uc.pt supports Python and PHP. When creating PHP scripts, users should pay attention to the files and directories permissions. The server will refuse to run the script if any of the following conditions is true:

  • File with writing group permission (fix using chmod g-w <file>).
  • File with write permission for other users (fix using chmod o-w <file>).
  • Writing group permission on the directory (fix using chmod g-w <dir>).
  • Writing permission for other users on the directory (fix using chmod o-w <dir>).

Protecting content with basic authentication

To protect the contents of your public_html with a username and password, there are two configuration steps you must complete:

  • Create a password file
  • Set the configuration to use this password file

Create a password file

To check if a username/password is valid, Apache compares them to a password file. You need to create this file on the server and populate it with valid users and their passwords.

To create a password file, go to your home folder (cd ~user) and type the following command:

$ htpasswd -c password_file username
$ New password: mypassword
$ Re-type new password: mypassword
$ Adding password for user username

In the example above, a password file is being created in your home folder for a user called username. Replace both the username and password as desired.

Set the configuration to use this password file

To enable password protection, create a file named .htaccess inside the directory you want to protect under public_html, with the following contents:

AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /home/user/password_file
Require valid-user