--- tags: chapman, website --- # Creating a Webpage at Chapman University ## Basics Save as a file `index.html` the following. ``` <!DOCTYPE html> <html> <head> <title>Hello, World!</title> </head> <body> <h1>Hello, World!</h1> </body> </html> ``` Copy `index.html` to the server (students replace `www1` by `students`): ``` scp index.html username@www1.chapman.edu:~ ``` Login to the server and move `index.html` to the folder `public_html`: ``` ssh username@wwww1.chapman.edu mkdir public_html mv index.html public_html ```` Visit webpage at `https://wwww1.chapman.edu/~username` . ## Public Key Authentication (partly written by Sage AI) To avoid reentering your password with each `ssh` and `scp` you may do the following. 1. If you do not already have a folder `~/.ssh` with files `id_rsa` and `id_rsa.pub` generate a public/private key pair on your local machine using the `ssh-keygen` command. This command will create a public key (`id_rsa.pub`) and a private key (`id_rsa`) in your `~/.ssh/` directory. 2. Copy your public key to the remote server using the `ssh-copy-id` command. This command will copy your public key to the remote server's `~/.ssh/authorized_keys` file, which will allow you to log in without typing your password. ``` ssh-copy-id username@webserver ``` 3. Test the connection by logging in to the remote server using `ssh`. You should now be able to log in without typing your password. ``` ssh username@webserver ``` Note that you only need to set up public key authentication once for each remote server you want to connect to from your local machine.