Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Mar 24, 2008 9:29 pm 
Offline
Senior Newbie

Joined: Fri Sep 14, 2007 1:40 pm
Posts: 17
I bet this is a simple question, but I'm starting with servers and I need some guidance.

I registered 3 domains and I have a linode account, say:

domain1.com
domain2.com
domain3.com
my.linode.ip.number

So instead of login into my linode using
Code:
ssh username@my.linode.ip.number
I'd like to be able to login as
Code:
ssh username@linode.domain1.com
or
Code:
ssh username@linode.domain2.com


Is it possible? How?

(You don't have to explain this step-by-step, just tell me the name of this procedure and I'll google it)

Also, I want to host my 3 websites on my Linode, so I've to install Apache (and PHP and a database if applicable), right? After doing so, I do I redirect www.domain1.com to a folder on my htdocs folder (or public_html)?

Thanks for your help.


Top
   
 Post subject:
PostPosted: Mon Mar 24, 2008 10:50 pm 
Offline
Senior Newbie

Joined: Tue Mar 18, 2008 1:48 am
Posts: 9
Location: Sydney, Australia
use something like everydns.net and set an A record for linode.domain1.com

then you can just ssh in no worries

google up an apache virtual host tutorial, that will explain how to host multiple websites on one apache install


Top
   
 Post subject:
PostPosted: Mon Mar 24, 2008 11:00 pm 
Offline
Senior Newbie

Joined: Fri Feb 08, 2008 11:46 pm
Posts: 16
I'm not quite sure why you wouldn't use Linode's own DNS manager...


Top
   
 Post subject:
PostPosted: Mon Mar 24, 2008 11:14 pm 
Offline
Senior Newbie

Joined: Sun Mar 09, 2008 8:12 pm
Posts: 9
I'm not very familiar with SSH and domain so I don't know if it's possible to do what you're trying to do.

As far as setting up multiple domains with Apache, it can be different depending on which distribution you are using (the Apache syntax and declaration stay the same, but the way the files & modules are organized are different from distribution to distribution).

If you're using Ubuntu, you could do the following to add a new site:

Code:
sudo mkdir /var/www/domain1.com/
sudo nano /etc/apache2/sites-available/domain1.com


Copy and paste the following minimal virtual host configuration into /etc/apach2/sites-available/domain1.com:
Code:
<VirtualHost *>
        ServerAdmin webmaster@domain1.com
        ServerName domain1.com
        ServerAlias www.domain1.com

        DocumentRoot /var/www/domain1.com
</VirtualHost>


Then to enable the site, run:
Code:
sudo a2ensite domain1.com


Then restart Apache:
Code:
sudo /etc/init.d/apache2 restart


Top
   
 Post subject:
PostPosted: Mon Mar 24, 2008 11:19 pm 
Offline
Senior Newbie

Joined: Tue Mar 18, 2008 1:48 am
Posts: 9
Location: Sydney, Australia
melancthon wrote:
I'm not quite sure why you wouldn't use Linode's own DNS manager...


well sure, you could use that too. I just already use everydns, so that's why I mentioned it.


Top
   
 Post subject:
PostPosted: Tue Mar 25, 2008 3:09 pm 
Offline
Senior Newbie

Joined: Fri Sep 14, 2007 1:40 pm
Posts: 17
Hey,

Thanks a lot for your answers, they're really helpful. (mainly marv's step-by-step guide to Apache2).

So regarding "SSH using IP" VS "SSH using mydomain", I understood that I need to use a DNS Manager, be it Linode's or a 3rd party one (maybe even my registrar have a DNS manager too, no?).

In the Cpanel of my Registrar I can create/alter the A records which points to an IP address, the CNAMES which points to a Host, MX and TXT that I won't need (no mail server). My registrar also gives me 2 nameservers (I can't change them).

On the other hand, in Linode's DNS Manager I can "Import a zone from a remote nameserver" (I'm prompted to enter a domain + namserver) and "Add a new domain zone" (I'm prompted for a domain + type: master or slave).

I don't know what to do. I think I know in theory...

I need to create a subdomain in my Registrar (CNAME) in the form linode.mydomain.com. But it must point to a host. The only host I have is @ (www) that points to the IP address of my registrar. So I think I've to create another Host, which IP is my Linode's IP.

But if the procedure is that simple, why do I need the DNS manager?

The only thing I want is to ssh username@linode.mydomain.com instead of ssh username@xxx.xxx.xxx.xxx (where the xxx.xxx.xxx.xxx is the IP address of my linode).

Thanks again.


Top
   
 Post subject:
PostPosted: Tue Mar 25, 2008 4:42 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
Quote:
But if the procedure is that simple, why do I need the DNS manager?


DNS ("domain name system") is the way names are mapped to IPs (and vice-versa). So to get "linode.domain1.com" to map to "linode_ip", you need an entry in the DNS *somewhere*. The easiest will probably be your domain register's system. You can move it later without too much pain, if desired Anyway, the point is that without DNS records, no amount of Apache setup is going to help, because the connections will never reach the right machine.

There are several record types in DNS. The most common are A "Address" records,
which map names to IPs, and CNAME "Canonical NAME" records, which map alias names to canonical names. So, for example, you'd have an A record to map linode.domain1.com to 1.2.3.4, and a CNAME record to map www.domain.1.com to linode1.domain.1.com.

Does that clarify?

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.
-- seen on the net


Top
   
 Post subject:
PostPosted: Tue Mar 25, 2008 7:19 pm 
Offline
Senior Newbie

Joined: Fri Sep 14, 2007 1:40 pm
Posts: 17
Hey SteveG,

Yes... I do think so.

At least, I created a new A Record in my registrar DNS Manager:

Host: server
Points to IP: my.linode.ip.number
TTL: 1hour

And now I can ssh myusername@server.mydomain.com successfully.

Despite working I hope I've done things correctly. Thanks for your patience. :?


Top
   
 Post subject:
PostPosted: Wed Mar 26, 2008 2:46 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
Once you're happy with the config, please go back and update your TTL to something larger, like 12 or 24 or 48 hours. Caching is a huge win for DNS, and for a static IP like linodes, there's no reason for a short TTL. (Well, when you know a change is coming, you can put in the small value again.)

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.

-- seen on the net


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group