Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-12-2010, 11:26 AM   #1
Registered: Sep 2007
Location: Ohio
Distribution: Raspbian, Debian, CentOS, Ubuntu
Posts: 126

Rep: Reputation: 18
Can I set up a development test zone on a live apache server?

Pretty much as the title states, I have dedicated LAMP server running and I was wondering if I am able to run a dev/testing zone on it so to speak?...
That way, I can have my come back soon, site is being constructed page live, and develop elsewhere on the server.

I was trying a virtualhost, but since that is name based, the web browsers don't know what to do with it.

I know the safest way is to develop on this machine then move to web server but I'm just seeing if what I was trying to do is possible.

Thanks linux community.
Old 03-12-2010, 12:02 PM   #2
Senior Member
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,225

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
virtual host CAN be ip based

DocumentRoot "/home/hopper/webroot/testsite"
<Directory "/home/hopper/webroot/testsite">
allow from all
Options +Indexes
then you just add a virtual ip to your nic
by adding the following to /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static

Last edited by frieza; 03-12-2010 at 12:03 PM.
Old 03-12-2010, 12:09 PM   #3
Registered: Sep 2007
Location: Ohio
Distribution: Raspbian, Debian, CentOS, Ubuntu
Posts: 126

Original Poster
Rep: Reputation: 18
other sites live on it as well...

thanks for quick reply!

My next question is, since I have more than one live site on that IP address, is that possible to use IP?

I'm sorry, I really should have stated that before.

me = newb.
Old 03-12-2010, 12:23 PM   #4
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
If you don't want to add a virtual IP You can use the same IP address, set up a virtual host and make use of the host header instead:

<VirtualHost *:80>
DocumentRoot /home/myname/mywebdirectory
ServerName testarea
ServerAlias testarea.local
<Directory />
Options FollowSymLinks
AllowOverride None
<Directory /home/myname/mywebdirectory/www>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
CustomLog /home/myname/mywebdirectory/logs/access.log combined
This assumes you want to call the testarea with the url 'testarea' or 'testarea.local', that you are putting your html/php files in /home/myname/mywebdirectory/www and want seperate logs in /home/myname/mywebdirectory/logs (the directories must exist)

To make this resolve so a browser can reach 'testarea' or 'testarea.local' edit your hosts file on the machine you want to use to browse it and add a line like:
Quote: testarea testarea.local
This assumes is the IP of the server. You could so this with DNS if you are running a local DNS server.

This method require you to set up either a hosts or dns entry for the virtual server, but it has the advantage that random people browsing the IP on port 80 will be served the main sight and not your test area. This can be spoofed but requires knowledge of the correct host header. I would also limit the IP's that can access this test server as it is a common attack vector for crackers to look for broken or partially installed web applications.

Hope that expands on the options a little.
Old 03-16-2010, 10:32 AM   #5
Registered: Sep 2007
Location: Ohio
Distribution: Raspbian, Debian, CentOS, Ubuntu
Posts: 126

Original Poster
Rep: Reputation: 18
Thanks guys, that did the trick!


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
Apache web server stress test nima0102 Linux - Server 3 01-08-2010 04:07 PM
How Can I test SSL with Single apache Server Machine? your_shadow03 Linux - Newbie 1 10-26-2009 06:40 PM
New server: set time zone to GMT? k1mgy Red Hat 3 12-19-2004 12:22 AM
apache/proftp test server technochef Linux - Software 0 10-05-2004 10:06 PM
Apache as a test server solfer Linux - Newbie 1 02-25-2003 07:01 AM > Forums > Linux Forums > Linux - Newbie

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

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