LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-13-2013, 07:50 AM   #1
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Arch Linux
Posts: 423

Rep: Reputation: 33
Hostnames and subdomain


Hello out there.

Here is the story:

I have bought a domain name. e.g test.org from godaddy.

I have create a hostname www.test.org in my godaddy account to connect the domain name with my web server's IP.

When you visit www.test.org browser reads files from /var/www

Now i have created a new dir in /var/www called news (/var/www/news/) and i want to create a subdomain news.test.org and when you type it on the browser to read files from /var/www/news without the URL be changed like www.test.org/news. I want the url stay as news.test.org

Is something like that possible ?

Thank you.
 
Old 11-13-2013, 08:03 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Yes, create an entry at Godaddy that points news.test.org to your web server.
On your server configure apache to use NameBased virtual hosting and configure a virtual host to use /var/www/news as the document root.

However, if you have your main host set to use /var/www as the document root then www.test.org/news will (by default) also show the content from the /var/www/news folder.
 
Old 11-13-2013, 10:11 AM   #3
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Arch Linux
Posts: 423

Original Poster
Rep: Reputation: 33
Godaddy has two options. Either to create a subdomain that redirects to a specific url or you can add another one host except of the www.
What entry to create so ? Can you be more specific because im a little new on these ideas.
Thank you!
 
Old 11-13-2013, 10:21 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Oh, sorry, my mistake, I had (wrongly) assumed you had control over your own webserver rather than using a GD hosting account.

What does GD support / docs say to do?
 
Old 11-13-2013, 04:22 PM   #5
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Arch Linux
Posts: 423

Original Poster
Rep: Reputation: 33
Hmmm there is a confusion . The web server is mine (at home with static IP). The domain is at GD. So for www.test.org i have create a hostname in GD account and connect it with the static IP of my server. The problem is that if i create a subdomain (news.test.org) to redirect to the /var/www/news , the url when you write new.test.org and press enter it becomes www.test.org/news and it doesn't stay news.test.org. The question is if its possible, after pressing enter the url to stay as it is (news.test.org).
 
Old 11-13-2013, 05:05 PM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Hostnames and subdomain

yes, see my first reply. ignore godaddy redirection create an A record for news. test.org pointing to the same IP as your Web server and use namebased virtual hosts to serve the content.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostnames linux4ever Linux - Networking 4 07-18-2011 04:32 PM
Create webmail subdomain on Plesk master domain. (reserved subdomain) fruitwerks Linux - Server 0 08-11-2010 03:08 PM
hostnames thenewguy05 Linux - Networking 1 07-12-2004 05:08 PM
Hostnames glj Linux - Networking 3 02-12-2002 10:04 AM
subdomain deepak Linux - Networking 2 03-01-2001 09:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration