To: Friends@cmi, Set Up Your Homepage
That's true. It doesn't matter if you haven't published yet. You need to have a website.
Inspired from Kira Goldner's blog on Every Academic Needs a Website, this is a customized "how to" article for CMI students. I’m not going to spend time convincing you why you need a website - if you’re still on the fence, go read the linked article above.
This article will walk you through everything you need to do to get your website up and running on: www.cmi.ac.in/~yourname
Step 1: Building Your Homepage Locally
Before uploading your website to the server, you’ll first create and test your homepage on your own computer. I’ve already built a minimal homepage for you to get started. You can download and use it as a template (credit is embedded).
Customizing Your Homepage
- Once downloaded, extract the files into a folder where you’ll keep all your website files.
- Open the
index.html
file in any text editor (e.g., VS Code, Sublime Text, Notepad++). - Replace the dummy content with your own text, links, and information.
- Add a profile picture of yourself: Save your photo in the
assets/img/
folder; Name the file asprofile_pic.jpeg
.
Previewing Your Homepage
To see how your website looks, simply open the index.html
file you just edited in any web browser.
This will give you a live preview of your homepage.
Step 2: Hosting
Once you're satisfied with your website, copy the entire folder (containing index.html
and the assets
folder) to a pen drive and head to the computer lab. Yes, you will need to visit the lab at least once. In the lab, you'll do two things: 1) Copy your website to the correct directory on the server and 2) Set up SSH so you can easily update the website from your personal computer in the future.
- Login to your accont on any one of the computers at the lab
- Next, copy and paste your website files (
index.html
and theassets
folder) into the directory~/.www/
. After that, set the correct permissions for the files to ensure they are accessible:
- Your Homepage should be live now. Try opening it by visiting
www.cmi.ac.in/~username
Step 3: Maintaining 🔧
Unless you want to visit the lab every time you need to make changes to your website, you’ll need a way to remotely access the CMI server. To do this, you’ll need something called an SSH key. SSH keys are secure access credentials, and generating one is easy. Follow these steps to create your SSH key:
- Open your terminal (on your personal computer)
- Run the following command (replace your_email@example.com with your actual email):
ssh-keygen -t ed25519 -C "your_email@example.com"
This command creates a new SSH key pair and labels it with your email.
- When prompted with "Enter a file in which to save the key", press Enter to use the default file location.
- At the next prompt, type a secure passphrase.
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]
After completing these steps, you should have two files inside the directory ~/.ssh/
: 1. ~/.ssh/id_ed25519.pub
(your public key) and 2. ~/.ssh/id_ed25519
(your private key).
- Copy the public key to a pen drive and transfer it to the lab computer. Save it somewhere easily accessible, such as the Desktop.
- Run the following commands (on the lab computer) to add it to the SSH agent
From now on, you should be able to use SSH to connect to the server from your computer. Test the connection by running the following command (on your computer):
This will give you command-line access to your home directory on the CMI server. From there, you can navigate to the ~/.www
directory and make minor edits to your site using any command-line editor, such as: nano ~/.www/index.html
. For major changes, it’s better to update your website locally on your computer and then transfer the updated files to the CMI server using the following command:
After transferring the files, don’t forget to SSH into the server again and set the permissions to ensure your website is accessible. Run the following command:
ssh username@access2.cmi.ac.in
chmod -R 755 ~/.www
Congratulations! You’ve got a website! Now, share it with your friends, add it to your resume, and show it off. And if your friends still don’t have a website, bug them until they get one. Everyone deserves their own corner of the internet!