LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-16-2014, 06:50 AM   #1
time
LQ Newbie
 
Registered: May 2014
Location: Italy
Distribution: Slackware64 - LFS
Posts: 3

Rep: Reputation: Disabled
Moving web application (php & mysql) to another distro


Hi all,
I'm using linux since a few months and I need some help with the above packages as I don't have much experience with them, nor with Debian distro.

I have a soho server, running debian, hosting our "web application" for business management purpose. The application is tailor-made, developed in php and some jscript, using mysql as db. There is also phpmyadmin, but I think that's the last problem.

Now I have to move the application on another machine running slackware 13.37.

As this is my training pc, all the packages are compiled from source, so I think the paths are different from debian-packages.

Beside copying the whole /var/www directory (that contains all the files of our web-app) what am I supposed to do, to ensure that both machines work the same?

I thinks I have to configure apache and mysql as on the debian machine. Which files do I have to export or copy?

For the mysql part, what can I do to replicate the entire databases from the debian host to the slack one?

I don't know much about mysql and apache configurations, and I just need to move everything from a host to the other, so I did not read the whole maxi documentation of these softwares.

Thanks for your help and sorry for bad spaghetti-english

EDIT: @ MOD: can somebody change topic title in: "

Last edited by time; 05-16-2014 at 09:25 AM. Reason: Wrong title
 
Old 05-16-2014, 10:17 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
You have to make sure that the versions are compatible, config-wise. You can do this by testing, or by reading through the errata and release notes. Its fun.

the /var/www directory is where your web files are most likely stored. You will need that. Then you will need a dump of your database to import into the new database server.

You will also need the config files for both. Apache is generally in /etc/httpd and mysql is at /etc/my.cnf.

If you grab those two config files, the database dump, and the web files you should be able to get started. From there utilize your error logs to fine tune and debug the applications.
 
Old 05-16-2014, 05:14 PM   #3
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Beyond szboardstretcher excellent advice, from the command line on the Debian machine with the Apache server running, enter
Code:
php --ini > php_conf.dump
You'll want a copy of all the ini files in php.conf.dump as well as the php.conf.dump file itself.
When you get to the Slackbox, do the same thing and compare the files if an ini file is missing on the new machine, I would strongly encourage you to resolve that before returning to production. You'd also like to confirm you're running the same version of PHP on both machines (not guaranteed)
I'd also insure you have the Apache version and modules available to you in Slackware that you used in Debian and take a look at the MySQL version on both database engines (probably not going to be a problem but it's better to know then wonder).

Why not load the *Current* Slackware (14.1) on the target machine? The way our beloved despot (et al) has been churning out oh-so-tastey, patches and upgrades recently, you could loose a clear upgrade path sooner than you'd like.

Last edited by dijetlo; 05-16-2014 at 05:44 PM. Reason: more comprehensive
 
Old 05-26-2014, 08:14 AM   #4
time
LQ Newbie
 
Registered: May 2014
Location: Italy
Distribution: Slackware64 - LFS
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi guys,
thanks for fast support and sorry for delayed response. Came back today from work-trip.
Ok it looks easy enough so I'm gonna give a try tonight and I'll let you know if I encounter any problem.
Midwhile I upgraded to slack 14.1, compiled the same build of apache php and mysql (on debian they where not the latest) and I'll try to upgrade them after I get everything running smooth.
I also copied the /var/www folder and after worktime I do the rest.
 
Old 05-26-2014, 02:01 PM   #5
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
it looks easy enough
I always say that right before screwing something up....

Quote:
I'll try to upgrade them after I get everything running smooth.
That is the smartest thing I've seen posted this week.

Good luck, post back if you run into trouble, it looks like you're well prepared to migrate though so I'd be optimisitic.

Last edited by dijetlo; 05-26-2014 at 02:06 PM.
 
Old 05-27-2014, 02:23 PM   #6
time
LQ Newbie
 
Registered: May 2014
Location: Italy
Distribution: Slackware64 - LFS
Posts: 3

Original Poster
Rep: Reputation: Disabled
Angry

Quote:
Originally Posted by dijetlo View Post
I always say that right before screwing something up....
As you said... I screwed everything starting from my brain...

Quote:
Originally Posted by dijetlo View Post
That is the smartest thing I've seen posted this week.
Too bad I'm not the smartest guy haha, check the rest

--- sleep a bit ---

Ok, here we go, I'll try to be clear as I did tons of stuff and I have to reorganize my mind cuz I don't remember what I did and in which order
Code:
I also tell you I'm doing everything on two machines, the slackbox and a salix-core-fresh-install (faster to install, works the same) where I installed only distro-packages (but mysql, that is compiled)
First I discovered httpd doesn't start at boot, so I got m.a.d trying to make it work, without success. So I ended up uninstalling the compiled httpd and installing the distro-package. The version is not the same and the bootscript doesn't work anyways... Ok, after some warcry I said "I'll fix that later. I hate apache"

Next, I removed everything beside Mysql (it's the only thing that always works) and reinstalled apache and php with distro-packs. Started apache manually and I saw I copied wrong all the /var/www files, as I used scp and not rsync, so all the privileges were screwed. No problem, that was an easy fix.

I checked the config files, fixed some httpd.conf issues to make php works but I saw that the debian-package-configs are slightly different from the slack ones.

I had different results on both machines.

Salix with distro-packs (newer versions then debian): I tried to replicate at my best the configs and when I connect to the box the CRM works! There are some graphic problems and the first page is not loading proprely, but the "engine" works, the calculations are correct and all the database functions work good. An half success, but that's good for now! I think the problems are due to jscript or some graphical library maybe... dunno.

Slackbox with compiled sources (ALMOST same versions, a bit newer): I get a CDbException. I think I have to debug but I don't know how to show errors and warning in the browser (I asked the devs to hide them) anyways I THINK it's mysql issue.

So far I'm too tired to go back to pc (21.15 localtime) but I decided to move in this direction:

1. I'll try to install debian on another partition and I'll build the same enviroment of the server
2. At that moment I'll move the application and replicate the exactly same config and check if everything runs fine
3. THEN I'll try to move on slack/salix and I'll ask for dumb-proof instructions if I get any problem.

I think I started too fast, without enought knowledge about php-mysql-apache
I'm reading documentations now.

Anyways, I hate Debian. :P
 
Old 05-27-2014, 04:59 PM   #7
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Time... I notice you have Yii running on this thing... this isn't an e-commerce server, is it?

First, the packages all work. I can vouch personally for the Slackware and RHEL implementations and the Debian version is highly regarded among people who do this for a living, the possibility that you've discovered a bug is not worth considering, especially since you've never configured one of these before. Do what you started out to do. The full install -> Migrate -> clean-up, that's how server migration works.
By the way, don't mess around with httpd, it will only bring you grief. Use apachectl. like this.

apachectl start

I'm reading documentations now

You don't have to know a lot about PHP to migrate a not-for-money server. It just takes a lot longer if you don't. You do have to know something about Apache though, general system administration. network administration and it helps if you know perl and bash quite well.

Last edited by dijetlo; 05-27-2014 at 05:16 PM.
 
  


Reply



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
[SOLVED] Installing apache,php and mysql from source in Linux tarunchawla Linux - Software 3 10-10-2013 08:34 AM
Compiling Apache, PHP and MySQL from source. Phr34Ck Linux - Software 6 02-29-2008 06:05 AM
Compiling PHP +mysql + apache Kupo Linux - Software 2 06-16-2007 03:46 AM
Debian, Apache, PHP, MySQL rossp Linux - Software 2 10-30-2004 06:51 AM
Compiling Apache, MySQL, Perl & PHP jeucken Linux - Software 1 12-15-2003 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration