LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2013, 05:02 PM   #1
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 78

Rep: Reputation: 0
Add domain to Ubuntu


Hi all,

I am trying to follow these instructions to add a domain to my Ubuntu VPS but so far it is not resolving. I put some screenshots for what I have done here

My webhost support has told me:

Quote:
I have checked your concern and see that the issue with your Apache configuration. Could you please check the Apache configuration settings. While checking, I have seen that your site is resolving from opendns. Please check the DNS settings and add the records.
But I don't understand what I need to do - any suggestions please?

Thanks...
 
Old 03-14-2013, 06:41 PM   #2
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 132

Rep: Reputation: 18
Try going to the ip, does it pop the site up?

Also check the apache logs to see if there is denies or 404's.

Last edited by BeaverusIV; 03-14-2013 at 06:44 PM.
 
Old 03-15-2013, 01:46 AM   #3
d3vrandom
Member
 
Registered: Jun 2006
Location: Karachi, Pakistan
Distribution: OpenSUSE, CentOS, Debian
Posts: 59

Rep: Reputation: 9
You are supposed to make changes to the hosts file on your LOCAL machine and not on your VPS. That way when you enter desertbee.co.uk on your browser it will refer to the hosts file to resolve the domain to your VPS IP. On windows this file is in c:\windows\system32\drivers\etc

Also install the DNS flusher extension for firefox and use it to clear the DNS cache each time you make changes to the hosts file:

https://addons.mozilla.org/en-us/fir...n/dns-flusher/

Finally I can't connect to your IP address 216.224.183.44 so I suspect you don't have apache running or it's blocked by the firewall. To allow access in the firewall run the following as root:

Code:
iptables -I INPUT -p tcp --dport=80 -j ACCEPT

Last edited by d3vrandom; 03-15-2013 at 01:48 AM.
 
Old 03-15-2013, 06:54 AM   #4
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 78

Original Poster
Rep: Reputation: 0
Thanks for replies...

Quote:
Originally Posted by d3vrandom View Post
I can't connect to your IP address 216.224.183.44 so I suspect you don't have apache running or it's blocked by the firewall... [/code]
The IP was working before so I must have messed something up. I have now reinstalled the VPS so the IP is working again = /var/www/index.html. So I am starting again to add this domain. Can anyone please tell me does this look ok and if so what is the next step?

Thanks...

Last edited by Juc1; 03-15-2013 at 07:11 AM.
 
Old 03-15-2013, 07:32 AM   #5
d3vrandom
Member
 
Registered: Jun 2006
Location: Karachi, Pakistan
Distribution: OpenSUSE, CentOS, Debian
Posts: 59

Rep: Reputation: 9
Well the thing is that you are not supposed to add virtual host declarations in httpd.conf on Ubuntu. Instead add it to a separate file in /etc/apache2/sites-available. So I suggest creating a file named desertbee.co.uk in that directory and adding the following to it:

Code:
<virtualhost *:80>
servername desertbee.co.uk
serveralias www.desertbee.co.uk
documentroot /var/www/
ErrorLog ${APACHE_LOG_DIR}/desertbee.co.uk_error.log
</virtualhost>
Then use the tool a2ensite to enable the site:

Code:
a2ensite desertbee.co.uk
Restart apache:

Code:
service apache2 restart
Another thing is that desertbee.co.uk does not point to your server:

Code:
dig desertbee.co.uk

; <<>> DiG 9.8.4-P1 <<>> desertbee.co.uk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21936
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;desertbee.co.uk.               IN      A

;; AUTHORITY SECTION:
desertbee.co.uk.        3185    IN      SOA     ns.myhosting.com. jr5689.gmail.com. 1264747228 14400 7200 2419200 3600

;; Query time: 337 msec
;; SERVER: 64.102.255.44#53(64.102.255.44)
;; WHEN: Fri Mar 15 16:31:58 2013
;; MSG SIZE  rcvd: 98
So you need to change the nameservers for desertbee.co.uk to your VPS's.
 
1 members found this post helpful.
Old 03-15-2013, 02:10 PM   #6
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 78

Original Poster
Rep: Reputation: 0
@ d3vrandom - www.desertbee.co.uk is now loading - awesome, thank you

But I changed the document root in /etc/apache2/sites-available/desertbee.co.uk to /var/www/desertbee.co.uk/httpdocs (attached) - so that I can add more websites - is that ok?

Do I need to do anything else such as create a directory for error logs?


Thanks...
Attached Thumbnails
Click image for larger version

Name:	document root.jpg
Views:	14
Size:	29.8 KB
ID:	12064  
 
Old 03-15-2013, 08:45 PM   #7
d3vrandom
Member
 
Registered: Jun 2006
Location: Karachi, Pakistan
Distribution: OpenSUSE, CentOS, Debian
Posts: 59

Rep: Reputation: 9
Quote:
Originally Posted by Juc1 View Post
@ d3vrandom - www.desertbee.co.uk is now loading - awesome, thank you

But I changed the document root in /etc/apache2/sites-available/desertbee.co.uk to /var/www/desertbee.co.uk/httpdocs (attached) - so that I can add more websites - is that ok?

Do I need to do anything else such as create a directory for error logs?


Thanks...
Great!

Apache logs are in their own directory. Usually that is in /var/log/apache2/. So no need to change that.

You might want to create a site specific access log. Just add the below to /etc/apache2/sites-available/desertbee.co.uk before the closing </virtualhost> line:

Code:
CustomLog ${APACHE_LOG_DIR}/desertbee.co.uk_access.log vhost_combined
Be sure to test the configuration:

Code:
apache2ctl -t
And if everything is ok reload apache:

Code:
service apache2 reload
 
1 members found this post helpful.
Old 03-16-2013, 07:32 AM   #8
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 78

Original Poster
Rep: Reputation: 0
بہت بہت شکريہ

I have attached for a second domain.

Please see my FTP user question here...
Attached Thumbnails
Click image for larger version

Name:	add domain16.jpg
Views:	11
Size:	59.7 KB
ID:	12069  
 
Old 03-16-2013, 07:44 AM   #9
d3vrandom
Member
 
Registered: Jun 2006
Location: Karachi, Pakistan
Distribution: OpenSUSE, CentOS, Debian
Posts: 59

Rep: Reputation: 9
Everything looks ok for your Apache configuration.

About FTP, I don't have much experience with that. If you are the only user of your VPS I strongly recommend not using FTP at all. Instead use SFTP. You don't have to install anything on your server to use SFTP. Just download the freeware program winscp and use your SSH credentials to connect to your server.
 
Old 03-19-2013, 07:38 PM   #10
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 78

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by d3vrandom View Post
Everything looks ok for your Apache configuration.
Ok thanks but do I need to add the permissions mentioned at # 3 in my attached screenshot from here to your file:

Code:
<virtualhost *:80>
servername desertbee.co.uk
serveralias www.desertbee.co.uk
documentroot /var/www/
ErrorLog ${APACHE_LOG_DIR}/desertbee.co.uk_error.log
</virtualhost>

Quote:
About FTP, I don't have much experience with that. If you are the only user of your VPS I strongly recommend not using FTP at all. Instead use SFTP. You don't have to install anything on your server to use SFTP. Just download the freeware program winscp and use your SSH credentials to connect to your server.
Ok thanks I am trying winscp...
Attached Thumbnails
Click image for larger version

Name:	ap.jpg
Views:	11
Size:	129.3 KB
ID:	12089  
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to add a domain in linux bkarthick Linux - Server 5 08-31-2011 06:33 AM
how to add another domain in 1 server 1 ip mandrivian Linux - Server 2 03-07-2011 11:51 PM
add to windows domain vbanoop Linux - Newbie 4 09-28-2010 05:51 AM
[SOLVED] add a new domain ciberrust Linux - Networking 2 08-08-2008 02:18 PM
How add a domain to your personal pc? kane hart Linux - Networking 1 10-16-2003 10:16 PM


All times are GMT -5. The time now is 03:53 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration