[I have already installed and set up Apache2; this is not a duplicate question, please see below]
I have uploaded a HTML file to the Apache2 localhost web server, using the default :8000 port. I want this file to be accessible via a web browser on another device in another location, by entering a WWW domain into a search engine. In other words, I want to create a fully accessible website while keeping the HTML files for my website on the Apache web server.
I would appreciate any help I can get.
http://domain.tld/
to go directrly to the site you need to use port 80. Your friend who does "CS" is not familiar with IT networking, but they're probably trying to shield you from typical HTTP based attack vectors and port scanners, but that's just security through obscurity and is useless in the long run. (FYI: I'm an IT Security professional so I'm speaking from some levels of experience here.) – Thomas Ward Jan 05 '19 at 19:35root
or doesn't get served directly by Apache, then yes you would use port 8000. But that's not the case when Apache itself is serving the files. – Thomas Ward Jan 05 '19 at 19:36etc/apache2/sites-available
and typesudo nano index.conf
. Once you have added contents in the file pressCtrl+O
to save it. – thirteen4054 Jan 05 '19 at 20:56First, I created the index.conf file in the /etc/apache2/sites-available directory by opening the Terminal there and going "touch index.conf" (I had already put my index.html file in the /var/www/html/ directory).
Then, I opened the Terminal again in the same place and ran this command: sudo a2ensite index.conf
– Ruairí Másún Jan 06 '19 at 03:23<VirtualHost *:80> ServerName test.com ServerAdmin info@test.com ServerAlias www.test.com DocumentRoot /var/www/html
And finally, I ran this command:
sudo systemctl restart apache2
– Ruairí Másún Jan 06 '19 at 03:26<VirtualHost *80>...</VirtualHost>
I did not said that. this snippet needs to be in index.conf file. After that runsudo a2ensite index.conf
in same directory. – thirteen4054 Jan 07 '19 at 18:12sites-available
and and typesudo nano index.conf
– thirteen4054 Jan 08 '19 at 00:26