Reputation: 87
I just purchased a domain from GoDaddy, let's call it example.com. I set it up on GoDaddy to where it forwards people to my home IP Address where my Raspberry Pi hosts my website using Apache2. How can I properly set it up so that it shows example.com in the address bar rather than my home IP address?
Here is my .conf file for my website:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Upvotes: 1
Views: 1877
Reputation: 7515
If you visited the site via IP address prior to porting and setting a DNS record. You may need to clear your browser and DNS cache. This is how to flush Windows DNS via command line:
ipconfig /flushdns
Note that you MAY have to run cmd
as admin.
Upvotes: 2