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
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).
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:
chmod g-w <file>
).chmod o-w <file>
).chmod g-w <dir>
).chmod o-w <dir>
).To protect the contents of your public_html with a username and password, there are two configuration steps you must complete:
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.
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