Just recently got my VPS and domain for a pet project. I setup Apache and PHP, everything works fine until I put my public ip to the URL. It redirects to the DocumentRoot of one of my set VirtualHost:
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@mydomain.com
ServerName mydomain.com
ServerAlias www.mydomain.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/mysite
<Directory /var/www/mysite>
AllowOverride All
Allow from mydomain.com
Allow from www.mydomain.com
</Directory>
# Log file locations
LogLevel warn
ErrorLog /home/me/public/mydomain.com/log/error.log
CustomLog /home/me/public/mydomain.com/log/access.log combined
</VirtualHost>
What do I need to adjust so that everytime my public IP is the one inputted on the URL, it will be just redirect to the default It works! // /var/www/index.html?
You just need to change where global
DocumentRootpoints inhttpd.confand change the value in
directory: