Skip to content

A step-by-step guide to host a static website using Git and Mini-httpd on a Linux server.

License

Notifications You must be signed in to change notification settings

atulkamble/azurevm-website-hosting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic - Project: Website Code | GitHub | Web Server - Hosting

This repository contains a step-by-step guide to set up and host a static website using Git and Mini-httpd on a Linux server. The process demonstrates how to clone your website code from GitHub and serve it through a simple HTTP server.

Prerequisites

  • A Linux-based virtual machine (VM) like an Ubuntu server.
  • A public IP address for accessing the hosted website.
  • Git installed on the server.

Steps to Set Up the Server

  1. Update the Machine

    sudo apt update -y
  2. Install Git

    sudo apt install git -y
  3. Install Mini-HTTPD (Web Server)

    sudo apt install mini-httpd -y
  4. Start and Enable Mini-HTTPD

    sudo systemctl start mini-httpd
    sudo systemctl enable mini-httpd
  5. Navigate to the Web Root Directory

    cd /var/www/html
  6. Clone the Website Repository Clone your website code from GitHub:

    git clone https://github.com/atulkamble/testwebsite.git

    Alternatively, clone with sudo for permission issues:

    sudo git clone https://github.com/atulkamble/testwebsite.git
  7. Move Website Files to the Web Directory

    sudo cp testwebsite/* .
    sudo mv testwebsite/css /var/www/html
    sudo mv testwebsite/js /var/www/html
    sudo mv testwebsite/images /var/www/html
  8. Access the Website Replace the public IP with your Azure VM's public IP and visit the website in your browser:

    http://<your-public-ip>/
    

    Example:

    http://98.70.89.130/
    

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Let me know if you need any additional changes!

About

A step-by-step guide to host a static website using Git and Mini-httpd on a Linux server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published