homepage Welcome to WebmasterWorld Guest from 54.242.231.109
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
moving websites from freebsd to linux
Doood




msg:3632354
 2:46 pm on Apr 22, 2008 (gmt 0)

I'm taking over a friends website that is hosted on two freebsd servers and need to consolidate the two boxes into one because the hosting fees are higher than the income.

The host said they have tried and tried to move the contents of one box to the other but the website scripts break and would require a programmer to figure it out because all the scripts were written for two servers. There are several hundred custom scripts on each box.

My host (elsewhere) offers much cheaper prices so I'd prefer to move it there but they don't use freebsd.

Are php/mysql scripts on a freebsd server somehow different that what you would use for linux?

 

bunltd




msg:3632357
 2:54 pm on Apr 22, 2008 (gmt 0)

Not really different. As long as php is setup the same.

It's probably configuration of the scripts. I'll bet the scripts need to be updated to use the path on the new box, since their location will probably be different. Another thing that might have to be updated, database access and set-up - would need to be replicated and/or the scripts updated.

Wonder: is the database hosted on one server, the site on the other box? That'd be my guess.

LisaB

Doood




msg:3632386
 3:21 pm on Apr 22, 2008 (gmt 0)

Yes, the databases and lots of subdomains are on one box and the main site on the other.

There are literally thousands of scripts on the main server and it's hard to figure out which ones are actually being used. I think it's only a couple hundred of them though.

There is no phpMyAdmin and lots of scripts use mysql commands, also there's a bunch of .sh scripts that I don't even understand.

The host just emailed me and said this,

to combine the two servers we would have to run
everything on a Linux server (as our managed server product runs Linux). We
tried once to move the site as-is to our managed platform and certain
elements of the site would not function.

As a general rule there is usually no problem moving sites freely
between operating systems. However, this particular site is custom designed
and frankly so difficult to follow that we were unable to move the
site and keep it running properly while we tried to troubleshoot it. The
developer of the site would be the best candidate to support any
further attempts to move the site again.

arrrrg. This is turning out to be a nightmare.

bunltd




msg:3632396
 3:30 pm on Apr 22, 2008 (gmt 0)

.sh scripts are something else entirely - and could be using OS specific utilities and such, making it harder to move. Like the host said, your best bet may be getting with the original developer re: moving. (especially if this is custom php and not based on any common software)

ckarg




msg:3634255
 3:49 pm on Apr 24, 2008 (gmt 0)

We run our sites on FreeBSD, but no longer use PHP, so my recollection may be a bit hazy. I also investigated moving to linux a while ago, but eventually decided not to.

The Key areas I would investigate are:

1) Location of config files. php.ini on FreeBSD is in /usr/local/etc/php.ini and extensions.ini is in /usr/local/etc/php/extensions.ini

2) Path names in config files (e.g. httpd.conf) - stuff is very likely to be in different places on a linux box (e.g. htdocs may live under /var, while FreeBSD puts it into /usr/local/www).

3) Plain PHP will obviously be the same, but you need to ensure all the required PHP extensions are available. The most incompatible PHP code will be calls to external commands.

4) Any .sh (i.e. bash) scripts may again have hard-coded path names which won't work on linux. FreeBSD's /bin/sh is also different from linux's /bin/bash - bash is mostly a superset, but I have seen /bin/sh scripts fail on /bin/bash.

5) Any external utilities (e.g. tar) called by PHP or the scripts could be in different locations, AND are likely to use some incompatible switches. FreeBSD uses *BSD style switches (obviously); not all of these work or do the same thing as GNU.

6) Read/Write permissions to files and directories used in scripts, etc. (A forked script called from a FreeBSD web server will run as 'www:www', but I believe some linux distros may run it as 'nobody:nobody').

A brute force, quick and dirty approach might be to replicate the locations of everything using symlinks, set file permissions, ensure the PHP configuration is the same, and then you're only left with a bit of .sh script debugging ;)

Doood




msg:3635377
 8:08 pm on Apr 25, 2008 (gmt 0)

Thanks for all the info.

Unfortunately we decided to just shut down the site because all the scripts on these two servers are a mess and no one can figure out how it works.

There are literally thousands of scripts, each with a few hundred to a few thousand lines of code and they don't make sense. It's overwhelming to say the very least.

The whole program was given to me for free cause the current owner couldn't figure it out either.

himalayaswater




msg:3640092
 5:11 am on May 2, 2008 (gmt 0)

Have you tried to move FreeBSD vps? It might save the cost and you can use same scripts

Sharper




msg:3652714
 7:28 pm on May 17, 2008 (gmt 0)

Someone with FreeBSD, Linux, shell scripting, server config, PHP, Apache, database, etc... experience like me could likely figure it all out in short order.

The real question for you becomes is the site worth paying someone like me with the relevant experience to deal with figuring it out?

Honestly, it sounds like something that a little knowledge of sed and awk could put right in a few hours of investigation. Posix/gnu utilities are all pretty commonly shared on both platforms and paths aren't all THAT different.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved