1

I tried asking this before but although I took all of the advised steps, nothing happened. Basically, I want to create a website like www.example.com. I can open HTML files in my browser using the LocalHost server, but I want this webpage to be visible to other users on other devices in other locations using the internet.

Here is a link to the question I asked previously

I was able to take all of the suggested steps. First, I created the file /var/www/html/index.html. Then, I created the file /etc/apache2/sites-available/index.conf with this information:

Screenshot

<VirtualHost *:80>
        ServerName test.com
        ServerAdmin info@test.com
        ServerAlias www.test.com
        DocumentRoot /var/www/html

        <Directory /var/www/html>
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Then I ran this command: sudo a2ensite index.conf

And then I ran this command: sudo systemctl restart apache2

However, nothing happened after that. I have tried this many times. Does anyone have any ideas on what to do?

vidarlo
  • 22,691
  • Include the content of the configs you made in your question. Also, you say nothing happened after that. What did you expect to happen? – vidarlo Jan 27 '19 at 18:31
  • I wanted to be able to access the domain from a WWW address rather than http://27.0.0.1

    And as you can see, the information from the config isn't pasting correctly. I'll take a screenshot of it instead.

    – Ruairí Másún Jan 27 '19 at 18:36
  • 2
    Do not take a screenshot. Paste as code instead. Do you have any functioning DNS set up? Do you have a domain name? Have you configured port forwarding from your router do your computer running Apache? – vidarlo Jan 27 '19 at 18:38
  • No, I haven't done any of that. How do I configure port forwarding from my router to my computer? I don't have admin permissions for my router. – Ruairí Másún Jan 27 '19 at 18:40
  • 2
    Unless you have administrative privileges of the router, you probably can't. Please read the manual of the device. – vidarlo Jan 27 '19 at 18:48
  • It sounds like you're trying to allow public access to your local network. You may be better served to take advantage of something like AWS and spin up a Ubuntu server instance. It is pretty easy and there are lots of tutorials. You can skip the domain name and just access the site via the ip address until you feel ready to do the rest. https://aws.amazon.com/getting-started/tutorials/launch-a-virtual-machine/ – lidja007 Jan 27 '19 at 19:46
  • 3

1 Answers1

2
  1. You need to setup Apache properly and the server should be visible over local lan IP address, setup apache, allow incomming connection on server firewall for ports 80 and 443

  2. You will need a public IP address from your internet service provider (ask your ISP about the costs)

  3. You will need an unlimited data plan from your ISP (again ask your ISP about price)

  4. After this you will need to buy and setup a domain name - there are various providers - in the setup you will define your IP address from step 2.

  5. You will need to forward ports 80 (http) and 443 (https) to your internal web server on your router.

5.1 In order to setup https - port 443 you will need to obtain a certificate and install it on Apache.

  1. Optional step: you will need to setup local DNS for resolving the local web server requests from the lan to your local server IP address

Steps 1-5 make your website to work for outside world, step 6 makes it possible for the internal lan where the server is.

kukulo
  • 2,015
  • Of course. The https seems to be standard nowadays, so step 5.1 would be acquiring a certificate - in this you can use a free service Letsencrypt. – kukulo Jan 27 '19 at 20:05