Creating a website

You can host a website out of your CSE home directory.

You can also use PHP or CGI Scripts if you need them.

Where to put the files

All the files and scripts for your site go in your ~/public_html directory.

For security, the webserver cannot access any files outside of this directory.

The default page should be named index.html (or index.php for PHP powered sites).

The URL of your site

You can access your website at one of two URLS:

  • https://www.cse.unsw.edu.au/~username/
  • https://username.web.cse.unsw.edu.au/

File Permissions

The webserver runs as a user (w3serv, for the interested) and therefore is treated as just-another-user by the filesystem when it tries to access your public_html.

This means you have to set world file access permissions:

  • world-execute on all directories including your homedir
  • world-read on all files, unless they are scripts
  • world-execute on all scripts

A quick example

  • Create a file in your public_html folder, and name it index.html.
  • Edit it to contain: <html> <body> <h1>Hello, world</h1> </body> </html>
  • Run chmod 644 ~public_html/index.html
  • You should now be able to access the page at http://www.cse.unsw.edu.au/~YourzID, substituting your zID for YourzID.

See also:

Last edited by simong 20/06/2024

Tags for this page:

html, web, url