ssh username@hessian.ma.ic.ac.uk mkdir public_html
where your username is your college loginname.
drwx------
drwx--x--x
ls -ld $HOME
jbloggs@hessian:~ $ ls -ld $HOME drwx--x--x 70 jbloggs ammp 8192 Mar 25 12:12 /home/ma/j/jbloggs
jbloggs@hessian:~ $ chmod 711 $HOME
jbloggs@hessian:~ $ ls -ld $HOME drwx--x--x 70 jbloggs ammp 8192 Mar 25 12:12 /home/ma/j/jbloggs
jbloggs@hessian:~ $ chmod 711 $HOME/public_html
jbloggs@hessian:~ $ ls -ld public_html drwx--x--x 70 jbloggs ammp 8192 Mar 25 12:12 public_html/
jbloggs@hessian:~ $ ls -l public_html -rw-r--r-- 1 jbloggs ammp 26402 Sep 4 11:45 index.html
If you upload content into your public_html from your own computer using scp, sftp or by mapping a network drive in Windows to your public_html folder, the permissions of your uploaded content will usually match those of your files on your own computer allowing read-only access to all, including the webserver. But if you have set unusual permissions for your files on your own system, or if you are using a Windows, a Mac or a third-party Linux sftp or scp program that allows permissions to be changed during the upload so that read access by the webserver is denied, your pages won't display!
So in addition to making sure your ICNFS home directory and public_html folder permissions are correct, you must make sure that the content's permissions are correct too. Pages, images, scripts and any other files you want to be able to display to visitors to your home pages should be set to:
rw-r--r--
and any subdirectories or folders within your public_html folder should have the permissions:
drwx--x--x
If your file and/or folder permissions are wrong, you can reset these permissions remotely using most graphical scp or sftp programs for Windows, Mac, Linux, Andoid or iPhone and if you have mapped a Windows network drive to your public_html folder, you can change the permissions from Windows. Alternatively, a quick way of doing this is to log into a Maths Linux system and fix this yourself; if you have a simple set of pages with no subdirectories inside your public_html folder, you can use this remote ssh command:
ssh username@hessian.ma.ic.ac.uk chmod 644 public_html/*
to set the correct permissions for your content files. However, if you have subdirectories within your public_html folder, this simple command will make these subfolders inaccessible! In this case the best way to get the permissions right is to first log into a Maths Linux system, say, hessian.ma, and then use the Linux 'find' command to separately find all the files and folders and set their permissions correctly:
ssh username@hessian.ma.ic.ac.uk find ~/public_html -type d -exec chmod 711 {} \; find ~/public_html -type f -exec chmod 644 {} \; exit
andy@anahata:~ $ sftp hessian Connecting to hessian... andy@hessian's password: sftp>
andy@anahata:~ $ scp gprs-network-info.html andy@hessian.ma.ic.ac.uk:public_html/mobile_networks andy@hessian.ma.ic.ac.uk's password: gprs-network-info.ht 100% |*****************************| 76075 00:00
mkdir /home/ma
icnfs-ma.cc.ic.ac.uk:/home/ma /home/ma nfs rw,bg,intr,soft,nosuid,nodev,rsize=8192,wsize=8192 0 0
If you already have NFS mounts listed in your /etc/fstab, the existing entries may look quite different to the one above. This is because anything after the 'nfs' in the line shown above is optional and your existing entries may not have these, or they may have different options. Omitting all the options entirely will still work and allow you to mount the exported home page directories - the options shown prevent your system hanging at boot time if there is a network or server failure and the home pages can't be mounted; they also speed up NFS read/write performance and stop your computer wasting time at boot-up trying to check the remote filesystem :-).
mount -a
to mount in one go all the filesystems listed in /etc/fstab including the newly added home page filesystem exported from penguin68. Of course, if you prefer you can do things the hard way by mounting this individually on its own - you might have to do this anyway if you have deliberately unmounted a device listed in your /etc/fstab and you don't want it remounted now: the command syntax to do this varies from one UNIX flavour to another but this one will work with sensible defaults with any Linux:
mount -t nfs icnfs-ma.cc.ic.ac.uk:/home/ma /home/ma
display
// Emulate register_globals on if ( ! ini_get('register_globals')) { $superglobals = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET); if (isset($_SESSION)) { array_unshift($superglobals, $_SESSION); } foreach ($superglobals as $superglobal) { extract($superglobal, EXTR_SKIP); } }
Research Computing Manager, Department of Mathematics
last updated: 16.11.16