LinuxQuestions.org
Visit Jeremy's Blog.
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 06-14-2016, 11:12 AM   #1
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 282

Rep: Reputation: Disabled
How to work on a website with a domain name pointed somewhere else?


I have a website under domain.com and I was trying to move it to a different hosting, but it did not work there. The website is back at host A and I have all the files and the database (at least from yesterday) at host B.

I would like to keep the website running on host A and troubleshoot the website on host B without the domain name pointing to it. I have one IP address for the hosting, and I have several other websites there, based on Apache / VirtualHost definitions like:

<VirtualHost *:80>
Document Root /home/www/html/some-domain.com
ServerName some-domain.com
</VirtualHost>

So the site is in /home/www/html/domain.com, the IP is 121.42.55.01, lets say. How would I get this to display in the browser, so I can troubleshoot the site? Once I point the domain to this IP it starts a big mess, the site does not work / load there and all the other sites are messed up to (slow loading / connecting for a long time, and one does not work at all because of an overload protection - too many MySQL queries, I think).

I know that this should be possible, but how to do it (the easiest and the fastest way). The http://121.42.55.01/~some-name-here thing?

Thanks.
 
Old 06-14-2016, 06:26 PM   #2
ktask
LQ Newbie
 
Registered: Sep 2006
Location: Victoria, Texas
Distribution: Redhat, Ubuntu, Xandros, Linspire
Posts: 2
Blog Entries: 1

Rep: Reputation: 2
Stealth Mode ...

Well, that's what I call it, anyway.

Every laptop/tabletop workstation should have DNS setup such that it checks the local host file before DNS. On a Mac/Linux box, /etc/hosts/.

If, the server being developed has virtual apache setup to respond to the fully qualified domain that hasn't been moved yet, one can use their local host file thusly:

IPaddressOfDevServer sitesfqdn hostname

Example: Real server is at www.somenet.net and it's public IP address is xxx.xxx.xxx.xxx
The development server is at yyy.yyy.yyy.yyy

At the bottom of the hosts file add:

yyy.yyy.yyy.yyy www.somenet.net www

No need to restart anything, just open a browser and point to www.somenet.net

Just one catch 22 ... as long as you have that 'fake' entry in your /etc/hosts file, can only view etc. the dev site. Can't work on the real site and the 'Stealth' site at the same time.

'spirit of sharing', Ken
 
2 members found this post helpful.
Old 06-15-2016, 02:10 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,469

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
You may also want to put in an allow/deny block in the vhost config or at firewall level to ensure that only your IP address can connect.

If you're running multiple websites that have multi-table backend databases you may need to increase the open files limit, if you're using MySQL/CentOS there's a link to a good guide on my blog http://centos.tips
 
Old 06-15-2016, 06:40 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Let's here it for "Poor Mans' DNS". Good stuff that /etc/hosts.
Lock down the "new" site during testing to select IPs:
Code:
<Directory /var/www/html/> # Check this. Yours may differ here.
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride All # Allow .htaccess in apache2.4
    Order deny,allow
    deny from all
    allow from 123.123.123.123 # CIDR masks are valid here also
    allow from another_IP
    allow from yet_another
</Directory>

Last edited by Habitual; 06-15-2016 at 06:41 AM.
 
2 members found this post helpful.
  


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
[SOLVED] Cannot get to website using domain name cryingthug Linux - Server 6 01-24-2013 10:42 PM
How can I make my server work with all domains pointed at it? tibberous Linux - Server 8 01-26-2009 12:28 AM
Virtual host www.domain.com work, domain.com don't work stormrider_may Linux - Networking 4 05-03-2006 09:52 PM
Cant get entry in bind to work with domain.com instead of www.domain.com pxes351 Linux - Networking 12 05-09-2005 06:20 AM
Using a domain name instead of ip address for my website??? oulevon General 9 08-10-2001 04:22 PM

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

All times are GMT -5. The time now is 02:01 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
Open Source Consulting | Domain Registration