1

Using examples from DigitalOcean, Rackspace and others, I have (repeatedly) setup a server to provide name-based Vhosts. I have several domains registered and forwarded to my current public IP address, but any attempt to access any of them via the web results in only the default host of last resort responding.

I added the server's public IP address and the domain names to another local computer OS's hosts file, and all websites appear to be functioning fine via local access.

Since this is my first stab at web hosting, I am limited in knowing what to try next. It seems that since LAN access functions OK (with the server info added to the hosts file) and from www the server is found and requests are processed, the settings are at least close to correct. I'm thinking there's a .conf file or some such that just isn't quite right. Or perhaps router port forwarding?

Any suggestions? Any code snippets I should add here to help clarify?


Update. Here is my Virtual Host .conf file:

# domain: example.com 
# public: /var/www/example.com/html 
<VirtualHost *:80> 
    ServerAdmin admin@example.com
    ServerName example.com 
    ServerAlias www.example.com 
    DocumentRoot /var/www/example.com/html 
    LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log 
    CustomLog /var/log/apache2/access-mydomainname.com.log combined 
</VirtualHost>
pa4080
  • 30,621
SteveMc
  • 21

2 Answers2

1

After changes be sure to restart your apache2 server. Your router also needs to allow access to the ports on your computer. You can pretty much follow the guides on the VPS type servers. They are the same for a local hosting computer.

1

Problem is resolved. Solution was to properly configure the DNS records for the sites with my registrar. I had not set the IP address for the A record in the proper field - the manager's menu allowed for two different ways to do this, and I had not picked the correct method.

Thanks to @JackNorthrup and @pa4080 for their kind assistance!

SteveMc
  • 21