| Author |
Message |
marko_roi
Joined: 13 Sep 2011
Posts: 35
|
| Posted: Sat Nov 05, 2011 7:06 pm Post subject: Create subdomain and set it up |
|
|
| I would like to create subdomain on my linode and have it online. What do i need to do in DNS manager and what on linode, setup some virtual host? |
|
| Back to top |
|
Piki
Joined: 16 Jun 2011
Posts: 276
Location: Cyberspace
|
| Posted: Sat Nov 05, 2011 7:32 pm Post subject: |
|
|
You need to go to your DNS and create a new A record for your subdomain. If you use Linode's DNS manager, go to Linode Manager -> DNS Manager -> Your Domain A/AAAA Records -> Add a New A Record. Type what you want the subdomain to be and your Linode's IP address. Save it.
On your Linode, you need to set up set up a virtual host in your web server software. This is done the same way that you set up the virtual host for your main domain -- usually it is easiest make a copy of your main domain's vhost and adjust the copy for your subdomain, make sure it's going to be recognized by your web server software (usually done by making a link (shortcut) to your web server's sites-enabled directory if it has one), then restart your web server software. I can't give specific instructions since I don't know what web server software you use. |
|
| Back to top |
|
marko_roi
Joined: 13 Sep 2011
Posts: 35
|
| Posted: Sun Nov 06, 2011 9:32 am Post subject: |
|
|
I did what you said, added A record and it says now
sport 178.79.145.163 Default
and my virtual host is like
<VirtualHost *:80>
ServerAdmin marko@arabba.hr
ServerName sport.arabba.hr
ServerAlias www.sport.arabba.hr
DocumentRoot /srv/www/sport/public_html/
ErrorLog /srv/www/sport/logs/error.log
CustomLog /srv/www/sport/logs/access.log combined
</VirtualHost>
But when running sport.arabba.hr i get page not found, did enable the site and it is in sites-enabled. Is part of directory being only "sport" wrong, should i put sport.arabba.hr as document root, do I need to adjust some NS settings? |
|
| Back to top |
|
marko_roi
Joined: 13 Sep 2011
Posts: 35
|
| Posted: Sun Nov 06, 2011 9:48 am Post subject: |
|
|
I see now that "I cant" setup document root to be other then the one that is set up in main domain. Like it said here
http://davidpodley.com/2010/02/11/setting-up-subdomains-in-linode-and-apache/
So that was probably the problem. Is there a way to put files in any directory i want? |
|
| Back to top |
|
glg
Joined: 09 Jan 2009
Posts: 505
|
| Posted: Sun Nov 06, 2011 9:49 am Post subject: |
|
|
marko_roi wrote: I did what you said, added A record and it says now
sport 178.79.145.163 Default
and my virtual host is like
<VirtualHost *:80>
ServerAdmin marko@arabba.hr
ServerName sport.arabba.hr
ServerAlias www.sport.arabba.hr
DocumentRoot /srv/www/sport/public_html/
ErrorLog /srv/www/sport/logs/error.log
CustomLog /srv/www/sport/logs/access.log combined
</VirtualHost>
But when running sport.arabba.hr i get page not found, did enable the site and it is in sites-enabled. Is part of directory being only "sport" wrong, should i put sport.arabba.hr as document root, do I need to adjust some NS settings?
Did you wait until the DNS manager pushed out your changes (it pushes every 15 minutes). Then you'll want to check to make it's working on your local machine (nslookup sport.arabba.hr)
In any case, your site is working for me now I think (sorry, I don't read Croatian :) ) |
|
| Back to top |
|
marko_roi
Joined: 13 Sep 2011
Posts: 35
|
| Posted: Sun Nov 06, 2011 9:50 am Post subject: |
|
|
I changed setting to
<VirtualHost *:80>
ServerAdmin marko@arabba.hr
ServerName sport.arabba.hr
ServerAlias www.sport.arabba.hr
DocumentRoot /srv/www/arabba.hr/public_html/
ErrorLog /srv/www/arabba.hr/logs/error.log
CustomLog /srv/www/arabba.hr/logs/access.log combined
</VirtualHost>
So maybe that is why its working, but wondering if i can set any document root for my subdomain? Didnt know about this 15 minutes wait. |
|
| Back to top |
|
Piki
Joined: 16 Jun 2011
Posts: 276
Location: Cyberspace
|
| Posted: Sun Nov 06, 2011 10:03 am Post subject: |
|
|
| If /srv/www/arabba.hr/public_html/ is the document root for your your main domain and you want something different for sport.arabba.hr, you'll need to give it a different document root and put whatever you want it to display in your new document root. Your document root for sport.arabba.hr needs to exist and have an index.htm, index.html, or index.php that will display something. Apache should recognize any of those three as your main page, though you should only have one (not all three). |
|
| Back to top |
|
marko_roi
Joined: 13 Sep 2011
Posts: 35
|
| Posted: Sun Nov 06, 2011 10:23 am Post subject: |
|
|
| Piki, all of that I did, maybe its a DNS problem and needs to propagate, I'll leave it for some time and see. |
|
| Back to top |
|
Piki
Joined: 16 Jun 2011
Posts: 276
Location: Cyberspace
|
| Posted: Sun Nov 06, 2011 10:33 am Post subject: |
|
|
| Possible. Depends on how often your ISP updates their DNS. Most update within a couple of hours, though a rare few will take 24+ hours. |
|
| Back to top |
|
waldo
Joined: 21 May 2009
Posts: 336
|
| Posted: Sun Nov 06, 2011 11:02 am Post subject: |
|
|
| sport.arabba.hr works for me, I'm seeing Drupal's setup page. If you want to have www.sport you need to add an A record for the www as well. |
|
| Back to top |
|
marko_roi
Joined: 13 Sep 2011
Posts: 35
|
| Posted: Sun Nov 06, 2011 11:48 am Post subject: |
|
|
| Then its due to my ISP provider to make this work, Drupal setup page is what should be shown but i still get that page not found. Thanx on help I guess tomorrow it will be working. |
|
| Back to top |
|
marko_roi
Joined: 13 Sep 2011
Posts: 35
|
| Posted: Mon Nov 07, 2011 9:12 am Post subject: |
|
|
| It was due to time taken to update. thanks on help. |
|
| Back to top |
|
| |