So I've already set everything as for port forwarding in my router settings, I've set a static IP address for the RRi 4, and have already managed to get 1 page visible through my Pi web server.
The problem began when I went to set up the "Virtual Host" files in Apache2 to point to each domain that I plan on hosting on the RPi 4. Now no page shows, and the message I keep seeing says the following:
"404 Not Found The requested URL was not found on this server. Apache/2.4.38 (Raspbian) Server at MY-PUBLIC-IP-ADDRESS-HERE Port 80" As shown in the image below (404 message):
I have website1.com inside of "/var/www/website1.com/public_html/index.php" and I have website2.com inside of "/var/www/website2.com/public_html/index.php"
My Apache2 folder inside of directory "/etc/apache2/" looks like this:
And here is how I've set up my Virtual Host file (for website1.com) inside the directory "/etc/apache2/sites-available/Website1.com.conf":
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName Website1.com
ServerAlias www.Website1.com
DocumentRoot /var/www/Website1/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
AND the other file is a duplicate for website2.com inside of directory "/etc/apache2/sites-available/Website1.com.conf":
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName Website2.com
ServerAlias www.Website2.com
DocumentRoot /var/www/Website2/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I haven't set my DNS records for my real website domains yet, but as far as I remember, I should have been able to test on my localhost or check through my public IP address that is forwarding to my RPi 4 IP address to preview these 2 separate domains/websites.
Does it look like I've structured the Apache Virtual Hosts properly? Thanks.
Website1
orWebsite2
if the request is for127.0.0.1/index.html
?/var/log/apache2/error.log
?