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.
- A Linux-based virtual machine (VM) like an Ubuntu server.
- A public IP address for accessing the hosted website.
- Git installed on the server.
-
Update the Machine
sudo apt update -y
-
Install Git
sudo apt install git -y
-
Install Mini-HTTPD (Web Server)
sudo apt install mini-httpd -y
-
Start and Enable Mini-HTTPD
sudo systemctl start mini-httpd sudo systemctl enable mini-httpd
-
Navigate to the Web Root Directory
cd /var/www/html
-
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
-
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
-
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/
This project is licensed under the MIT License. See the LICENSE file for more details.
Let me know if you need any additional changes!