public_html and PHP

11.09.2018 - 12:54

Every LabraNet user has public_html folder under his/her home folder.

To publish websites, first you have to modify some rights of your homefolder.
[userid@student userid]$ chmod 701 /home/userid

This command gives only the execute permission to others.
[userid@student userid]$ chmod 705 /home/userid/public_html

With the above command you allow others to read and execute your public_html folder.
touch /home/userid/public_html/index.html

Now you should see an empty page @

For PHP functionality check instructions in .htaccess -file under public_html. More information can be found in instructions-directory in your home folder.

500 Internal Server Error

1. Check that your scripts syntax is right. Run “php -l my_script.php” on command line.

2. Check that your public_html folder has correct permissions (see above).

3. Restore the SELinux context by issuing command:

chcon -R -v -t httpd_user_content_t ~/public_html/*