Link to home
Start Free TrialLog in
Avatar of Jack_son_
Jack_son_Flag for Afghanistan

asked on

PHP/Apache/MySQL Custom Application

I need to move a debian PHP/Apache/MySQL custom app to a new server.  I need some help, generally speaking which folders would I look for in the structure to move?  I know the main one sites-enabled file and www folder as well.  I have moved these, but now apache won't start.  Any help would be appreciated.

Also, is it possible to migrate to a windows OS using the same PHP / Apache and MySQL?
Avatar of DrDamnit
DrDamnit
Flag of United States of America image

Generally speaking, all you have to do is:

1. Create the site in the new server. This involves copying the configs and directives from the /etc/apache2/sites-enabled/000-default (or similar) apache config file to the new server, then restarting the apache service (/etc/init.d/apache2 restart).

2. Move the MySQL databases. I suggest using mysqldump --databases [yourdatabase] > /tmp/dbdump.sql, and then using scp to copy it to the new server. Then use mysql -uroot -p[password] < /tmp/dbdump.sql to import it again. This moves the data.

3. Lastly, just tar up (tar -zcvf customapp.tar.gz /var/www/customapp/) the php files, then scp them to teh new server, and untar them (tar -zxvf customapp.tar.gz).

This will do it for 99% of custom apps. Unless you have something very specific and highly customized.
I missed the bit where you said: "apache won't start".

Stop the apache service (/etc/init.d/apache2 stop). Then try to start it manually from the command line:

apache2

When it fails, it should tell you why. Also, check the apache2 logs (/var/log/apache2). Post anything that seems relevant here, and I'll (we) will have a look.
Avatar of Jack_son_

ASKER

Here are the errors:

*.80 has no virtual hosts

also

var/www/domain.com/public does not exist

I do see  the folder but it is empty on the old server where it works and also here.
Need more information on the "old" config. Can you post the old config?
If I take out this file under sites-enabled and just use the default file, apache will start, here is the file for the app:  (is there a way to incorporate this into the default file?




<VirtualHost 10.10.20.10:80>
      CustomLog /var/log/apache2/name.com/access.log combined
      LogLevel warn
      ErrorLog /var/log/apache2/name.com/error.log

      ServerName  name.com
      ServerAlias www.name.com

      DocumentRoot /var/www/name.com/public
</VirtualHost>
# vim: syntax=apachestyle


also, when I have apache started without this file, I am unable to browse to it from a remote computer, only on the local computer can i browse to the apache website.
ASKER CERTIFIED SOLUTION
Avatar of artzter
artzter
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial