LinuxQuestions.org
Visit Jeremy's Blog.
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-12-2010, 12:26 PM   #1
mtlhd
Member
 
Registered: Sep 2007
Location: Ohio
Distribution: 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, 01:02 PM   #2
frieza
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,200

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

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

Last edited by frieza; 03-12-2010 at 01:03 PM.
 
Old 03-12-2010, 01:09 PM   #3
mtlhd
Member
 
Registered: Sep 2007
Location: Ohio
Distribution: 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, 01:23 PM   #4
spampig
Member
 
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:

Quote:
<VirtualHost *:80>
DocumentRoot /home/myname/mywebdirectory
ServerName testarea
ServerAlias testarea.local
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/myname/mywebdirectory/www>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
CustomLog /home/myname/mywebdirectory/logs/access.log combined
</VirtualHost>
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:
192.168.1.10 testarea testarea.local
This assumes 192.168.1.10 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, 11:32 AM   #5
mtlhd
Member
 
Registered: Sep 2007
Location: Ohio
Distribution: Debian, CentOS, Ubuntu
Posts: 126

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


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


All times are GMT -5. The time now is 12:36 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