LinuxQuestions.org
Visit the LQ Articles and Editorials section
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-15-2012, 12:33 PM   #1
KayosTheory
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Rep: Reputation: Disabled
Local Linux server for Testing Windows Website development


Long story short, I would like to use a machine running CentOS 6 to test a website I am developing on Windows 7 using Dreamweaver. Both machines are on the same network, and actually within 10 ft of each other. I would prefer to have the Linux machine connect to a folder on the Windows machine and use it as the root folder for the website. If that is not possible I could have all the files on the Linux machine as long as I can asscess them from the Windows machine like a local folder. I also need to be able to view the running website from Windows in a browser using a local IP (i.e. 127.0.0.2)? If you want the details of WHY, then read on.

I am currently developing a website on a Windows 7 machine. I installed a local installation of Apache, MySQL, and PHP to do local testing. That worked OK until I went to start validating and had to copy/paste everything to use the W3C checker. I found out they have an offline version of the checker, and went about setting that up, and have accomplished everything except installing SGML::Parser::OpenSP, because it asks for the location of OpenSP, which apparently is impossible to install on Windows. I searched for hours with no luck, finding plenty of places basically saying "If you figure it out let us know", but no actual solution.

So that was the last straw, pretty much the entire time I have dealt with the local server I find excellent tutorials for Linux and preconfigured packages (XAMMP, etc.), but have to piece together instructions for Windows, as I have certain requirements that the packages don't meet.

What I would like to do duplicate my remote web server locally (same OS, Apache version, etc) so I can work and develop locally. I make a few changes and the verify everything works every few minutes, so while uploading and checking on my actual server is a possibility it would be a huge time saver to have it locally.

I am modifying some shopping cart software that is tied to a domain AND an IP address, so I have to access it by www.mydomain.com AND the IP has to match either our remote IP or a local IP of 127.0.0.1, 2, or 3. Another reason for doing this is I currently have the website in it's exiting state live, so was hoping to have a couple Virtual hosts so I could have both (current and in development) in separate folders that I can easily switch between. In theory I should be able to have 127.0.0.2 point to testing, 127.0.0.3 point to current, and then just change .hosts file to direct www.mydomain.com to the correct IP. For some reason I have been unable to do so on my Windows machine.

So because of the hurdles the whole way and the ease of use I experienced (or at least extensive guides and tutorials) when using Linux for my home computer I would like to try and give it a go as a local testing server. Any guides or recommendations anyone has to do so is appreciated. I have dabbled a fair amount in Linux in the past (a year or two ago) but the more comprehensive the information the better in my opinion. I would rather get the "guide for idiots" and know most of it than get something that expects me to know something I don't.

Thanks for your time!
 
Old 11-15-2012, 01:33 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,104

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
sounds like a job for samba, which can either share a folder to a windows machine, or mount a windows shared folder on a linux machine, though i believe the former (share the 'document root' of your website via samba would be easier, though some versions of windows 7 have known problems with shared folders)
 
1 members found this post helpful.
Old 11-15-2012, 02:20 PM   #3
KayosTheory
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for the reply! I think Samba should work for what I need it to, been long enough I completely forgot about it (never network my Linux machine with a Windows one).

If there is a good reason (reliability, performance, etc.) to share a local folder instead of mounting a remote folder I can do so. Regarding performance, a second or two additional reading time for page rendering is OK, since the remote server would typically take even longer. I would prefer to mount my Windows folder and read from there, since I currently keep my website files in Dropbox. From there I should be able to have Apache use the shared folder as the default.

So the next question is, I know I can setup the localhost to use IP 127.0.0.1, but can I access the website via domain name from the Windows computer and pull that IP address, i.e. type www.mydomain.com on Windows and have it pull the website on Linux with the 127.0.0.1 IP?
 
Old 11-15-2012, 03:02 PM   #4
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,104

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
the reason i mentioned it is preferable to share the linux folder is that the server will continue to function even if the windows machine goes down, or has to be outright reformatted/replaced, which is imho more likely than having to reformat a linux machine.

127.0.0.1 is what's refered to in linux parlance as the 'loopback' adapter, even windows machines have a 127.0.0.1 address, it's so the machine can talk to itself, no matter what machine you sit in front of, pinging 127.0.0.1 always pings the machine itself, the address you are looking for is the ip address for 'eth0', or something similar, that is the address by which the computer talks on the network, just run ('ifconfig') at a terminal and you should be able to figure that out (if it isn't statically assigned by you, which i would recommend for a server anyways)
 
Old 11-15-2012, 03:15 PM   #5
KayosTheory
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yeah, I am aware of the likelihood of having to reformat a Windows machine, done it plenty of times The website is currently stored on Dropbox for backup protection, so that is the main reason for keeping it on the Windows machine.

So since the 127.0.0 IP is a loopback, I can't access anything but my current machine using that address, I would have to use an address such as 198.162.1.100, right? That might be a possibility, but I have requested new IPs for my shopping cart a lot lately (they changed to where it was IP and domain dependendet recently, then we changed our server, then I started using a testing server, then I added additional local IP's) so hopefully it won't be an issue.

Doing some further searching, would setting up CentOS inside VirtualBox accomplish something similar, i.e. a Linux testing server but fully accessible on my windows machine? Assuming I could fully run CentOS with Apache, PHP, ect from Virtualbox, even if I have to view the page inside Virtualbox I should be able to do all the editing right on windows, since it uses a local partition, correct?
 
Old 11-15-2012, 03:20 PM   #6
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,104

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
here's what i would do if you aren't alread setup this way
1) get yourself a cheap linksys router
2) attach the modem to the router's internet port
3) attach servers to lan ports on router's switch
4) configure router for any necessary port forwarding

this will have the effect of creating a private nework within your house that you can use any number set you wish to talk between machines within your house.
 
Old 11-15-2012, 03:30 PM   #7
KayosTheory
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
I am actually at work, and I manage the network out here, though it is pretty simple. Modem>router>switch to supply 5 computers (including the Linux machine) and 2 printers. I can access the other computers through their IP address, so I assume the same would be true of the Linux machine once I set it up.

If the Virtualbox idea is sound, that might be the easiest I would think.
 
  


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
publish a website on local server hussain6001 Linux - Networking 8 09-27-2010 10:14 AM
Testing PHP Website without Server/Internet 43r05p4c3 Programming 9 05-17-2006 06:15 AM
Website development on Linux vjgoyal Linux - Software 3 10-01-2003 09:02 PM
Help: Website development on Linux maccaday Linux - Newbie 3 07-01-2003 04:24 PM


All times are GMT -5. The time now is 08:51 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration