# Web hosting

  • You need some web hosting (with PHP support) for this course (and the follow-up courses as well)
  • Using your own webhosting is allowed, but:
    • No free hosting that displays ads
    • No free hosting that puts pages in a frame
    • No account shared with other students
    • Hosting needs to be online 24/7
  • We recommend the web hosting that is supported by students from our school at https://sinners.be/ (only € 5/year)

# Web hosting at sinners.be

WARNING

  • Use only lower case letters for your username
  • Don't use spaces or special characters (underscore, é, ï, ...) in your username
  • Preferably, but not mandatory: concatenate your first name and your surname
    E.g.: if your real name is John Doe, use johndoe as your username
  • The URL of your homepage then is: https://johndoe.sinners.be

Register at sinners.be

  • When your hosting is active, you see the following default homepage

Default homepage

# FTP program

  • FTP (File Transfer Protocol) is a standard network protocol to transfer files between your computer and a web server
  • Download a (free) FTP program of your choice
    • We recommend FileZilla because it can be used for both Windows and Mac

# Install FileZilla

WARNING

  • Don't click on the green button to download the software
    • Read the description: This installer may include bundled offers, which really means: This installer includes MALWARE!
  • Only download using the link Show additional download options

Download FileZilla

  • Download the appropriate file for your platform and your operating system

Download FileZilla

  • Follow the default settings when you install the software

# Change some default settings

  • Open FileZilla
  • Go to menu item Bewerken > Instellingen
  • Click, on the left side, on Taal and change the language to English (en_US)

Change language

  • Restart FileZilla
  • Go to menu item Server and check Force show hidden files

Show hidden files

# Save the FTP credentials for your sinners hosting

  • Open the Site Manager by clicking on the first icon in the toolbar (not on the arrow next to the icon)

Open File Manager

  • Click on New site and choose a name for it, e.g. username@sinners
  • Fill in the General tab
    • Protocol: select SFTP - SSH File Transfer Protocol
    • Host: sinners.be
    • User: your sinners username
    • Password: your sinners password

SFTP for sinners

  • Click on Connect to connect to your web hosting
    • The left pane (Local site) shows (the file system on) your computer
    • The right pane (Remote site) shows (the file system on) the web server
      • The remote site contains multiple, nested folders

IMPORTANT

ALWAYS upload your files to the public_html folder! This is the starting point for your website!

SFTP for sinners

  • Update your settings so that public_html is the default folder that opens when you connect to your hosting
    • Open the Site Manager again by clicking on the first icon in the toolbar
    • Select your entry
    • Click on the Advanced tab and set the Default remote directory to /johndoe/public_html (replace johndoe with your username)
    • Click on Connect to reestablish the connection

SFTP default path

# Upload your website

  • Connect to your hosting
  • Browse in the left pane (Local site) to the folder on your computer with the local version of your site, e.g. ...\myFirstPage
    • As an example, we assume that this folder ...\myFirstPage contains a HTML file index.html with the following content
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>My First Homepage</title>
    </head>
    <body>
        <h1>John Doe's homepage</h1>
    </body>
    </html>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
  • Upload index.html by dragging the file from the left pane (Local site) to the right pane (Remote site)

Upload homepage

  • Overwrite the existing page

Overwrite the existing page

  • Open your page in a browser

New homepage

CONGRATULATIONS

You have just published your first webpage on the World Wide Web 😃!

REMARKS

  • Likewise, you can download files from your webserver to your computer by dragging them from the right pane (Remote site) to the left pane (Local site)
    • If you apply git-based version control on your projects you always have an up-to-date copy of your projects on GitHub and you normally don't have to do this
  • Obviously, you can select multiple files and/or folders and drag (upload or download) them at once
Last Updated: 10/2/2020, 2:31:56 PM