top of page
Search

EC2 User Data 3

#!/bin/bash


yum update -y

yum install -y httpd


systemctl enable httpd

systemctl start httpd


cat > /var/www/html/index.html <<'EOF'


<!DOCTYPE html>


<html lang="en">


<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Raveendra Coffee Shop</title>


<style>


*{

margin:0;

padding:0;

box-sizing:border-box;

scroll-behavior:smooth;

}


body{

font-family:Arial, sans-serif;

background:#f5f5f5;

}


.navbar{

background:#2b1d0e;

color:white;

display:flex;

justify-content:space-between;

align-items:center;

padding:20px 50px;

position:sticky;

top:0;

z-index:1000;

}


.navbar h1{

font-size:32px;

}


.navbar ul{

list-style:none;

display:flex;

gap:25px;

}


.navbar a{

color:white;

text-decoration:none;

font-size:18px;

}


.navbar a:hover{

color:#c49b63;

}


.hero{

height:90vh;

background-image:url('https://images.unsplash.com/photo-1495474472287-4d71bcdd2085');

background-size:cover;

background-position:center;

display:flex;

justify-content:center;

align-items:center;

text-align:center;

color:white;

}


.hero-content{

background:rgba(0,0,0,0.6);

padding:40px;

border-radius:10px;

}


.hero h2{

font-size:60px;

margin-bottom:20px;

}


.hero p{

font-size:24px;

margin-bottom:20px;

}


.btn{

padding:15px 30px;

border:none;

background:#c49b63;

color:white;

font-size:18px;

border-radius:5px;

cursor:pointer;

}


.btn:hover{

background:#a87d45;

}


.section-title{

text-align:center;

font-size:40px;

margin:50px 0 30px;

color:#2b1d0e;

}


.menu-container{

display:flex;

justify-content:center;

flex-wrap:wrap;

gap:30px;

padding:20px;

}


.card{

width:300px;

background:white;

border-radius:10px;

overflow:hidden;

box-shadow:0 0 10px rgba(0,0,0,0.2);

}


.card img{

width:100%;

height:250px;

object-fit:cover;

}


.card-content{

padding:20px;

text-align:center;

}


.card-content h3{

margin-bottom:10px;

}


.price{

color:#2b1d0e;

font-size:20px;

margin-bottom:15px;

}


.gallery{

display:grid;

grid-template-columns:repeat(auto-fit,minmax(300px,1fr));

gap:20px;

padding:40px;

}


.gallery img{

width:100%;

height:300px;

object-fit:cover;

border-radius:10px;

}


.order-section{

background:white;

margin:40px auto;

width:80%;

padding:40px;

border-radius:10px;

box-shadow:0 0 10px rgba(0,0,0,0.2);

}


.order-section form{

display:flex;

flex-direction:column;

gap:20px;

}


input, select, textarea{

padding:15px;

font-size:16px;

border:1px solid gray;

border-radius:5px;

}


.footer{

background:#2b1d0e;

color:white;

text-align:center;

padding:20px;

margin-top:40px;

}


</style>


</head>


<body>


<div class="navbar">


<h1>Raveendra Coffee</h1>


<ul>

<li><a href="#home">Home</a></li>

<li><a href="#menu">Menu</a></li>

<li><a href="#gallery">Gallery</a></li>

<li><a href="#order">Order</a></li>

</ul>


</div>


<section class="hero" id="home">


<div class="hero-content">

<h2>Fresh Coffee Everyday</h2>

<p>Premium Coffee Beans & Cozy Environment</p>


<a href="#order">

<button class="btn">Order Now</button>

</a>

</div>


</section>


<section id="menu">


<h2 class="section-title">Popular Coffee</h2>


<div class="menu-container">


<div class="card">


<img src="https://images.unsplash.com/photo-1509042239860-f550ce710b93">


<div class="card-content">

<h3>Cappuccino</h3>

<p class="price">₹150</p>


<a href="#order">

<button class="btn">Order</button>

</a>

</div>


</div>


<div class="card">


<img src="https://images.unsplash.com/photo-1511920170033-f8396924c348">


<div class="card-content">

<h3>Espresso</h3>

<p class="price">₹120</p>


<a href="#order">

<button class="btn">Order</button>

</a>

</div>


</div>


<div class="card">


<img src="https://images.unsplash.com/photo-1494314671902-399b18174975">


<div class="card-content">

<h3>Cold Coffee</h3>

<p class="price">₹180</p>


<a href="#order">

<button class="btn">Order</button>

</a>

</div>


</div>


</div>


</section>


<section id="gallery">


<h2 class="section-title">Coffee Gallery</h2>


<div class="gallery">


<img src="https://images.unsplash.com/photo-1498804103079-a6351b050096">


<img src="https://images.unsplash.com/photo-1517705008128-361805f42e86">


<img src="https://images.unsplash.com/photo-1521017432531-fbd92d768814">


<img src="https://images.unsplash.com/photo-1509785307050-d4066910ec1e">


</div>


</section>


<section id="order">


<h2 class="section-title">Place Your Order</h2>


<div class="order-section">


<form onsubmit="submitOrder(event)">


<input type="text" placeholder="Enter Your Name" required>


<input type="tel" placeholder="Enter Mobile Number" required>


<select required>

<option value="">Select Coffee</option>

<option>Cappuccino</option>

<option>Espresso</option>

<option>Cold Coffee</option>

</select>


<input type="number" placeholder="Quantity" required>


<textarea rows="5" placeholder="Delivery Address"></textarea>


<button type="submit" class="btn">Confirm Order</button>


</form>


</div>


</section>


<div class="footer">

<p>© 2026 Raveendra Coffee Shop | All Rights Reserved</p>

</div>


<script>


function submitOrder(event){


event.preventDefault();


alert("Order Placed Successfully ☕");

}


</script>


</body>


</html>


EOF


echo "User Data executed successfully" > /var/log/user-data.log


systemctl restart httpd


exit 0

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page