UnitedForums - UK Web Hosting Forum UnitedHosting Community Hosting Forums
Network and Server StatusCustomer SupportUK Web Hosting
UnitedHostingUnitedHosting Sitemap UK Hosting ForumUK Web HostingWeb Hosting ForumsUK Reseller HostingWeb Host CommunityUK Managed Dedicated ServersHosting Help and SupportUK Domain Name Registration

Go Back   UnitedForums.co.uk > UnitedHosting Community > Webmaster Discussion

Reply
 
Thread Tools Rate Thread Display Modes
Old 3rd April 2008, 06:15 PM   #1 (permalink)
Tim
Bloke
 
Tim's Avatar
 
Join Date: Nov 2005
Location: Halifax UK
Posts: 587
Replicating a UH server

This has been covered in the past but I can't find the threads and thought it best to bring it up to date anyway.

What I'd like to do is set up a development server in my office that's as close a copy of a UH server as possible. Could someone create an idiot's guide to doing this please? Oh and I want to skip the PHP4/5 set up, just want PHP5.

Also wondering if this can be run on an old P3 I have, or do I need better kit? It will only be serving me, but I don't want it to be slower than my current local set up, so I'll invest in something better if needed. The P3 currently runs Ubuntu fine, but don't know how it'd do as a server.
Tim is offline   Reply With Quote
Old 3rd April 2008, 07:53 PM   #2 (permalink)
pursuit
Registered User
 
Join Date: Feb 2006
Location: London, UK
Posts: 265
is any particular reason why you must use a linux server/box?
my understanding is as long as mysql & php setup/configurations are the same as those on UH server, a windows machine would do with a copy of xampp, well, that's what I am using anyway.
pursuit is offline   Reply With Quote
Old 3rd April 2008, 08:59 PM   #3 (permalink)
UH-Matt
Administrator
 
UH-Matt's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 8,127
He may want to replicate the paths and such /var/www/html/ rather than c:/bleh/blah/ but I agree it would be simpler to run a winblows box with xampp installed.

If your up for the challenge, how far did you want to take it. Did you want to instal a control panel and such, or are you just looking for php and MySQL and apache etc.. ?
__________________
.
Matt
UnitedHosting Staff

For official support please use our helpdesk at UnitedSupport.co.uk

UnitedHosting proudly hosting more than 20,000 sites since 1998.
UH-Matt is offline   Reply With Quote
Old 3rd April 2008, 09:07 PM   #4 (permalink)
Tim
Bloke
 
Tim's Avatar
 
Join Date: Nov 2005
Location: Halifax UK
Posts: 587
No, not remotely any reason to use Linux other than thinking it would need to be that way to get a true 'image' of UH's set up. Perhaps I'm over-complicating things?

I seem to remember reading on here previously that people had set up pretty good copies of UH's servers and assumed this was needed for an identical local scenario. But I guess simply running the same versions of AMP would do.
Tim is offline   Reply With Quote
Old 3rd April 2008, 09:14 PM   #5 (permalink)
Tim
Bloke
 
Tim's Avatar
 
Join Date: Nov 2005
Location: Halifax UK
Posts: 587
Just seen Matt's post.

Yeah, things like having the correct paths would be good. Really just having my sites locally set up as close to the real thing should make certain maintenance tasks easier.

But no, I have no reason to want to play with the control panel or anything so I'll probably stick to Windows.
Tim is offline   Reply With Quote
Old 3rd April 2008, 11:01 PM   #6 (permalink)
pursuit
Registered User
 
Join Date: Feb 2006
Location: London, UK
Posts: 265
for the path bit, it depends what you are doing. for oscommerce, you can create a local configure.php in the includes/local folder and make no changes to the live one under includes/.

for non-oscommerce applications, create a php function in about 10 lines of code, to detect $_SERVER['HTTP_HOST'], and return the base url accordingly, one for local 127.0.0.1; one for your live testing server - presumely on UH server; and then one for the live site. Call this function at the beginning of each php code page, and that's it. use it over and over again. well, again this is the way I am using.
pursuit is offline   Reply With Quote
Old 3rd April 2008, 11:24 PM   #7 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Location: 36°38'4.48"N - 4°42'18.52"W
Posts: 2,058
Send a message via MSN to Simon Send a message via Yahoo to Simon Send a message via Skype™ to Simon
It could be one of my linux threads you've seen, I run linux not only for web dev but also as a file server and some other backup tasks.

I used to run XAMPP on windows and it works perfectly well and a lot easier to setup than linux. And I still use it on my laptop when I travel.
The main reason I moved is that in any given week I can be working on 6 or 7 different websites, vary rarely are any of these static content. Running my own linux box behind a firewall on a static ip allows my clients to preview sites before I launch them.
Today I was working on some heavy graphics manipulation with PHP and imagemagik and I'm not sure I could have done all that with XAMPP on windows.

It all depends I suppose on what you really need it for. A P3 machine should be fine, I don't think you'll have any problems if its only you accessing it. If you still think you need linux I will post my notes from when I installed my servers.


Good luck,
Simon
__________________
Freelance PHP Programming
__________________
Simon is offline   Reply With Quote
Old 4th April 2008, 12:36 AM   #8 (permalink)
Vger
Senior Member
 
Join Date: Sep 2003
Location: United Kingdom
Posts: 2,807
If you set up nested folders on the C drive called /var/www/html then when you install XAMPP you can change the path from c:/apachefriends/xampp/htdocs to c:/var/www/html - but that's as close as you'll get.

Vger
__________________
Working with computers is a bit like getting old - the longer you're around the more wrinkles you find!
Vger is offline   Reply With Quote
Old 4th April 2008, 12:49 AM   #9 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Location: 36°38'4.48"N - 4°42'18.52"W
Posts: 2,058
Send a message via MSN to Simon Send a message via Yahoo to Simon Send a message via Skype™ to Simon
If its just paths that you are worried about you could always create a function to convert all paths to either Windows or Linux style depending on the current OS.

PHP Code:
// Assumes the following paths are equivalent
// On Windows c:\var\www\html
// On Linux /var/www/html
function filesystemPath($path) {
    if (
strtoupper(substr(PHP_OS03)) === 'WIN')
        return 
'c:'.str_replace('/','\\'$path);
    return 
$path;

You can then use it like this
PHP Code:
require filesystemPath('/var/www/html/path.to.file');

fopenfilesystemPath('/var/www/html/path.to.file'), 'r' ); 
__________________
Freelance PHP Programming
__________________
Simon is offline   Reply With Quote
Old 4th April 2008, 07:54 AM   #10 (permalink)
Tim
Bloke
 
Tim's Avatar
 
Join Date: Nov 2005
Location: Halifax UK
Posts: 587
I suspect it probably was one of your threads about Linux Simon.

I'm going to rethink this one and try to actually define what I need this for and then see if it's worth the effort. I think I might just have been a little bored yesterday and the devil finds work for idle hands! For instance I was also considering a 3-screen display yesterday, which is not remotely needed, but looks so damn cool.

Thanks for all the replies - there are some good suggestions there.
Tim is offline   Reply With Quote
Old 4th April 2008, 08:49 AM   #11 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Location: 36°38'4.48"N - 4°42'18.52"W
Posts: 2,058
Send a message via MSN to Simon Send a message via Yahoo to Simon Send a message via Skype™ to Simon
Unless your familiar with Linux it might be a steep learning curve setting up all the software to a point where it is usable. Adjusting it to match UH could then be time consuming as you compare and match settings on each.

I know what you mean about idle hands, the closest I get to three screens is my dual screened desktop pc and my laptop sat next to it, totally over the top, I normally have emails/forums on the laptop, browsers on screen 1 and dev software (code editors, graphics, ftp) on screen 2... very confusing at times but impressive to look at
__________________
Freelance PHP Programming
__________________
Simon is offline   Reply With Quote
Old 4th April 2008, 10:18 AM   #12 (permalink)
Tim
Bloke
 
Tim's Avatar
 
Join Date: Nov 2005
Location: Halifax UK
Posts: 587
I found this through stumbleupon yesterday and it had me drooling. Check out the link at the top of the page to learn more:

My Tri-Monitor Rackmount PC
Tim is offline   Reply With Quote
Old 4th April 2008, 12:27 PM   #13 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Location: 36°38'4.48"N - 4°42'18.52"W
Posts: 2,058
Send a message via MSN to Simon Send a message via Yahoo to Simon Send a message via Skype™ to Simon
Jealous...
__________________
Freelance PHP Programming
__________________
Simon is offline   Reply With Quote
Old 4th April 2008, 01:02 PM   #14 (permalink)
pursuit
Registered User
 
Join Date: Feb 2006
Location: London, UK
Posts: 265
a kvm switch is more practical for me. after all, a setup of three pcs running different applications with one set of keyboard, display and mouse is potentially more useful than one pc with 3 displays, as far as I am concerned.

btw (sorry, off topic), talking about screens, anyone has any idea why or how this recent 1440:900 screen ratio comes about? given the fact it breaks the traditional 4:3 ratio like in 640:480, 800:600,1024:768, 1152:864,1280:1024 and 1600:1280? this 1440:900 gives me a bit of problem for a website (background image).

Last edited by pursuit : 4th April 2008 at 01:17 PM.
pursuit is offline   Reply With Quote
Old 4th April 2008, 01:55 PM   #15 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Location: 36°38'4.48"N - 4°42'18.52"W
Posts: 2,058
Send a message via MSN to Simon Send a message via Yahoo to Simon Send a message via Skype™ to Simon
1440:900 = Widescreen?
__________________
Freelance PHP Programming
__________________
Simon is offline   Reply With Quote
Old 4th April 2008, 03:00 PM   #16 (permalink)
pursuit
Registered User
 
Join Date: Feb 2006
Location: London, UK
Posts: 265
yes, i think thats what they call it - widescreen - seen on many of the new laptops (I suspect UH-Matt got one of this?).

the problem is, if you got an image that needs to adjust its size according to screen resolution, it'd work as long as the screen ratio remains 4:3 (I kinda remember theres a good reason for it - the human eye factor), but the image would be distorted on 1440:900 screen because its a different ratio.
pursuit is offline   Reply With Quote
Old 4th April 2008, 04:00 PM   #17 (permalink)
Simon
Dedicated to life!
 
Simon's Avatar
 
Join Date: Jul 2005
Location: 36°38'4.48"N - 4°42'18.52"W
Posts: 2,058
Send a message via MSN to Simon Send a message via Yahoo to Simon Send a message via Skype™ to Simon
Mines widescreen, can you send me the link for the page you are talking about so I understand what you mean.
__________________
Freelance PHP Programming
__________________
Simon is offline   Reply With Quote
Old 4th April 2008, 04:02 PM   #18 (permalink)
desquinn
Senior Member
 
Join Date: Dec 2005
Location: Paisley
Posts: 329
very nice three monitor setup patch leads look too short ( got to be less than .5m) but the setup is cool. I am happy with my dual 19" setup with Quad core PC but I have been starting to think about adding another 19" or going for 2x22". No rush for me to be honest but this may push me to do it
desquinn is offline   Reply With Quote
Old 4th April 2008, 05:13 PM   #19 (permalink)
Tim
Bloke
 
Tim's Avatar
 
Join Date: Nov 2005
Location: Halifax UK
Posts: 587
Yeah, my new laptop's widescreen with that ratio.

I'm going to try a dual monitor set up first and then consider going triple. Just bought another monitor to match my existing one.
Tim is offline   Reply With Quote
Old 4th April 2008, 05:57 PM   #20 (permalink)
pursuit
Registered User
 
Join Date: Feb 2006
Location: London, UK
Posts: 265
Quote:
Originally Posted by Simon View Post
Mines widescreen, can you send me the link for the page you are talking about so I understand what you mean.
sorry Simon, its not live yet. My solution is create two images, one for this 1440:900 screen, the other for all 4:3 screens, with some simple js scripts to detect screen resolution and load the right image accordingly.

I know this should not be a problem for most websites. whats unusual about this site is that the image needs to scale to full screen whatever resolution/size. while this is not a problem for all 4:3 ratio screen, i wsa sent a screenshot which showed a ball was no longer a ball on a 1440:900 screen, and only at this point i realised theres such thing as 1440:900 ratio (and you can't change the resolution on this type of display, or so I am told).

I am curious why it'd be allowed to be used as computer display? now we not only have to deal with different browsers, but also different w/h ratios.
pursuit is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 02:14 PM.

UK Web Hosting  |  UK Reseller Hosting  |  UK Dedicated Servers UnitedHosting  |  UnitedSupport  |  UnitedForums  |  SEO by vBSEO 3.0.0
Copyright © 1998-2008 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309