1

This question already has an answer here:

I am currently working out of a book, "Mastering Ubuntu Server, (LaCroix 2018)."

I have not been through the entire book but I am having doubts so far.

I have a website URL that I want to host from a home server.

...

I got as far as getting my home server to host my IP Address. Now, I have not been able to set up ../../50-xxxx-.yaml to make this web URL become hosted by my home server w/ my own web page.

I wrote a simple, HTML file for hosting the web address and web page on this home server.

Do not get me wrong, I know what I have read online, via this book, and while attempting various, different methods on IP Addresses, home servers, and websites.

...

How can I use Ubuntu Server to set up my home server for promoting web pages instead of hosting IP Addresses?

Seth

P.S. In the meantime, I will keep searching my book, online, and via this "askubuntu.com/questions/ask" page online.

...

For instance, this is my .yaml software to host it so far.

#blah
network:
  version: 2
  renderer:networkd
  ethernets:
  enpOs3:
    dhcp4: yes

I also tried:

#blah
network:2
renderer: networkd
ethernets:
  enpOs3:
    dhcp4:no
    addresses:[192.168.x.xx/24]
    gateway4:192.168.1.1
    nameservers:
      addresses:[192.168.1.1,8.8.8.8]

Anyway...if you have more expertise, which you do, than I, please contact me regarding this situation I have come across.

marked as duplicate by pa4080, Fabby, Eric Carvalho, Elder Geek, Pablo A Apr 13 at 2:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

There are several pieces that are needed to tie together a domain name or URL to a home IP address. As I am not certain about the specific environment in question, the following steps are somewhat generic.

1. Determine your public IP address

This can be acquired in many different ways, but I have found that the easiest is to visit a website from your home network that will do this for you. For example, cmyip.com will show this information (note that it is important to do this from the home network).

2. Link the public IP address and the domain name/URL

This step is heavily dependent on the company that the domain name was purchased from, but there should be instructions on site for doing this. At a high level, there should be a section referring to DNS settings where the IP address found in the previous step can be placed. This entry is called an "A record", which is a term that might be used on the site in this section.

3. Home Router Configurations

Now, the home router needs to be informed that incoming requests (someone else trying to access the website) need to be directed toward the server that has been setup. These steps are specific to the router; however, the general section that these settings will be under is typically referred to as "Port Forwarding". First access the router (it looks like its IP address is 192.168.1.1 from the config above). Then, there should be something called "destination" in the Port Forwarding section. The local IP address of the server should be put in this field. From the YAML config file above, this should probably be the 192.168.x.xx.

As a side note, I would definitely recommend the second configuration from above as that will prevent the server from changing this local IP address.

#blah
network:2
renderer: networkd
ethernets:
  enp0s3:
    dhcp4:no
    addresses:[192.168.x.xx/24]
    gateway4:192.168.1.1
    nameservers:
      addresses:[192.168.1.1,8.8.8.8]

Then, there should be a section for a port. Starting out, port 80 for an HTTP site (no security [aka SSL]) should be sufficient.

4. Getting the webpage up

In order to actually serve (display) a webpage from the ubuntu server, a web server is required. The question is tagged with both apache2 and nginx, both sufficient web servers for the task. There are many others, but those are the ones tagged in the question.

1. Install the web server

This step is relatively simple on ubuntu and only necessary if one is not already installed.

Nginx: apt-get install nginx

Apache: apt-get install apache2

2. Place website file in appropriate directory

The appropriate directory for nginx is /var/www/html, which is the same for apache2. Name the file index.html. Provided that everything is hooked up, the webpage should be displayed if the domain name is visited on a browser.

Summary

The steps above are relatively generic, but hopefully provide some general guidance. Specifics on each of the steps can be found through Google or other web searches. I wish you the best.

  • Hello Tim...Seth here. I appreciate your ideas and this is what I have been trying endlessly. I will keep on it. I appreciate your fast response. Now, w/ the ideas marked in numerical order, I might have a fighting chance. – De Funct Apr 11 at 22:24
  • 1
    Okay...so? I think I have it figured out. The .yaml file is for setting a static IP on my system (Ubuntu Server). I was going backwards and in the wrong direction. Thank you. – De Funct Apr 11 at 22:27
  • No problem! if you provide some more information on your setup, I might be able to point you in the right direction. – Informagician Apr 11 at 22:29
  • Okay...I will delve deeper into my set up and then reply. Thank you for allowing me to know this info. so far. – De Funct Apr 12 at 1:07
  • 1
    Hello...I changed my .yaml file and got going finally. Hellish journey...yes. Worth it...double yes! – De Funct Apr 12 at 3:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.