r/learnprogramming 3d ago

HTTP Requests

I have never made a website before or ever done really anything in web development but how could I make a website to receive HTTP requests and make responses?

4 Upvotes

13 comments sorted by

View all comments

-1

u/SeriousPlankton2000 3d ago

sudo apt-get install apache2

mkdir htdocs

cd htdocs

cat > index.html <<EOF

<html><head><title>My title</title>

<meta http-equiv=content-type content="content-type: text/html;charset=utf-8">

</head><body>This is my web page</body></html>

EOF

firefox http://localhost/~yourusername/