Different domains for game server/website/etc...

May 30, 2013 2.6k views
I run a Minecraft server and am trying to get a website working with a different domain, I have a domain, we'll say example.com, so I want the Minecraft server address to be mc.example.com and the website to be www.example.com and example.com. Is there any way to do this with only one droplet? If you need any more information on this let me know, I'm not too experienced with this type of thing. Thanks in advance.
7 Answers
Websites are not related to the minecraft server as they're each listening on a separate port.
You can create an A record so that mc.example.com points to your droplet's IP address.
As for the website, you can configure it as you would normally do.
As I said before, I am really not experienced with this type of thing, right now I have mc.example.com pointing to my droplet, that works fine, but then if I have a site, that domain goes to it, I don't want that, I only want www.example.com/example.com to go to the site, how would I do that? I'm sorry if there is already a tutorial for this, but I can't find it.
@Dan Take a look at: https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts
by Etel Sverdlov
This tutorial shows you how to set up a new directory, how to grant the correct permissions, how to add content to a new page, how to turn on virtual hosting, and how to, if needed, set up local hosts. Virtual Hosts are used to run more than one domain off of a single IP address and allows you to run multiple sites off of a single DigitalOcean droplet. This tutorial describes how to set up virtual hosts with Apache.
Ok, so I have set that up now and it seems to be working, but now another thing that I want to do is have different subdomains. Like I want the normal www.example.com/example.com and then another that is zpanel.example.com I can't figure out what I need to change/add to make that possible, this is what my VirtualHost config looks like:

ServerAdmin webmaster@example.com
DocumentRoot /var/www/example.com/public_html
ServerName www.example.com
ServerAlias example.com
ErrorLog /var/www/example.com/error.log
CustomLog /var/www/example.com/requests.log common
Did you install zPanel on your server? If so, I recommend using it to create virtualhosts/websites instead of manually editing the configuration files.
Well when I install zpanel it makes it have the domain of www.example.com/example.com is that supposed to happen and can I change it after the installation?
@Dan: I suggest you ask in the official zPanel forums as people there are more experienced with zPanel and are able to help your better: http://forums.zpanelcp.com/forum.php
Have another answer? Share your knowledge.