Jump to content

Website hosting

SirPirate

Hey guys, Im looking for a good guide on basic web hosting.I need to host 2-3 static websites with very low amounts of traffic and I see that as a great learning experience.I already have an idea of how to make the website itself but practically no clue how to host it on a local machine and attatch it to a dns.Any advice is welcome, Im a complete newb in this field.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, SirPirate said:

Hey guys, Im looking for a good guide on basic web hosting.I need to host 2-3 static websites with very low amounts of traffic and I see that as a great learning experience.I already have an idea of how to make the website itself but practically no clue how to host it on a local machine and attatch it to a dns.Any advice is welcome, Im a complete newb in this field.

Self hosting websites is normally done with a LAMP stack, open port 80 in your firewall and add it as an A record to your domain DNS settings.

It's easier to just pay a webhost 10$ a month and you can add as many extra domains as you want. Hosting it from home without having special needs (Like you don't) is pointless.

Link to comment
Share on other sites

Link to post
Share on other sites

@AbsoluteFool Thank you, that was in line with what I was planning and what I cobbled together from various guides.I do realise it would be a million times easier to just pay the 10$ a month but as I said, I want the learning experience as Ive never done this before.

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, SirPirate said:

@AbsoluteFool Thank you, that was in line with what I was planning and what I cobbled together from various guides.I do realise it would be a million times easier to just pay the 10$ a month but as I said, I want the learning experience as Ive never done this before.

Fair enough. Good luck :)

Link to comment
Share on other sites

Link to post
Share on other sites

@SirPirate hit me up if you want, I have a server on which you can dick around if you want

75% of what I say is sarcastic

 

So is the rest probably

Link to comment
Share on other sites

Link to post
Share on other sites

You never told us what system you are on but this is for Ubuntu (desktop version).

 

Install a web server. The most commonly used ones are apache and nginx. 

sudo apt-get install apache2

or

sudo apt-get install nginx

Start the web server

sudo service apache2 start

or

sudo service nginx start

 

Go to http://127.0.0.1 and you will see the web server test page. This file is named index.html and its location is /var/www/html/index.html. Now you can add folders and files to your liking. So lets say you create a folder 'cars' with a file 'volvo.html' (that is: /var/www/html/cars/volvo.html), you will be able to view it in the browser from the adress http://127.0.0.1/cars/volvo.html. Now you have an up and running web server on your local machine.

 

This is only a start obviously, but now you can start working on your site locally. When you want to show the world your work you just open port 80 and, unless you have a static ip, you can use a dyndns service like duckdns.org (it's great and it's free). 

 

The simplest and cheapest way of hosting 2-3 websites would be to setup a duckdns domain and then simply use yourname.duckdns.org/website1/, yourname.duckdns.org/website2 and so on. If you want to point your own domains to different sites, hosted on the same machine, like www.domain1.com -> website1, www.domain2.com -> website2 etc, you will have to configure the web server.

Starting point for apache: https://httpd.apache.org/docs/2.4/vhosts/examples.html

Starting point for nginx: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

 

I do this and I use nginx as a reverse proxy with several node web servers running on different ports. 

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, Umberto said:

You never told us what system you are on but this is for Ubuntu (desktop version).

 

Install a web server. The most commonly used ones are apache and nginx. 


sudo apt-get install apache2

or


sudo apt-get install nginx

Start the web server


sudo service apache2 start

or


sudo service nginx start

 

Go to http://127.0.0.1 and you will see the web server test page. This file is named index.html and its location is /var/www/html/index.html. Now you can add folders and files to your liking. So lets say you create a folder 'cars' with a file 'volvo.html' (that is: /var/www/html/cars/volvo.html), you will be able to view it in the browser from the adress http://127.0.0.1/cars/volvo.html. Now you have an up and running web server on your local machine.

 

This is only a start obviously, but now you can start working on your site locally. When you want to show the world your work you just open port 80 and, unless you have a static ip, you can use a dyndns service like duckdns.org (it's great and it's free). 

 

The simplest and cheapest way of hosting 2-3 websites would be to setup a duckdns domain and then simply use yourname.duckdns.org/website1/, yourname.duckdns.org/website2 and so on. If you want to point your own domains to different sites, hosted on the same machine, like www.domain1.com -> website1, www.domain2.com -> website2 etc, you will have to configure the web server.

Starting point for apache: https://httpd.apache.org/docs/2.4/vhosts/examples.html

Starting point for nginx: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

 

I do this and I use nginx as a reverse proxy with several node web servers running on different ports. 

Ubuntu uses systemctl do they not? Or did it change to systemd with 18.04? Anyways the command should be "systemctl start/stop or reload apache2.service" very alike with systemd.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, AbsoluteFool said:

Ubuntu uses systemctl do they not? Or did it change to systemd with 18.04? Anyways the command should be "systemctl start/stop or reload apache2.service" very alike with systemd.

They do, both work actually as service is a wrapper script and in this situation it calls systemctl 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 month later...

If you want the best of both worlds (solid web hosting and the learning experience) go pick up a really cheap VPS for less than $20 a year. I learned everything I know starting with a VPS back in high school, it has been an invaluable experience for me.

-KuJoe

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×