LinuxQuestions.org
Register a domain and help support LQ
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 08-28-2010, 09:42 PM   #1
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Rep: Reputation: 30
database locations??


When I was learning asp I got in the habit of building a db and moving it to a folder call db in the folder for the site. I lked having all my files in one place like that but I have never seen it done with mysql and php. with php the way seems to be to build a script and run that. It made it easy to carry my work around with me and also to move sites to other comps or a cd for storing. Now that I am in a linux only envirement I want the conveniance I had with windows. There is a lot of times I am waiting somewheres for an hour or more and would like to pop open my laptop and work on my current project. with asp you see a lot of sites built as examples that you can download that has eveything in it including the database. I just bought a sitepoint book called build your own dataase driven website using php and mysql and as I work my way through the book would like to save eveything to a memory card and carry it with me. can this be done using php and mysql.

Last edited by dvdljns; 08-28-2010 at 09:45 PM. Reason: spelling
 
Old 08-28-2010, 10:44 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,952

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by dvdljns View Post
When I was learning asp I got in the habit of building a db and moving it to a folder call db in the folder for the site. I lked having all my files in one place like that but I have never seen it done with mysql and php. with php the way seems to be to build a script and run that. It made it easy to carry my work around with me and also to move sites to other comps or a cd for storing. Now that I am in a linux only envirement I want the conveniance I had with windows. There is a lot of times I am waiting somewheres for an hour or more and would like to pop open my laptop and work on my current project. with asp you see a lot of sites built as examples that you can download that has eveything in it including the database. I just bought a sitepoint book called build your own dataase driven website using php and mysql and as I work my way through the book would like to save eveything to a memory card and carry it with me. can this be done using php and mysql.
Yes. Save your PHP files to the memory card, along with all the associated images, style sheets, etc. You can either open the files through the browser as "Open->File" through Firefox, or create a symbolic link in the docroot on the computer in question, and have it point to the memory card. Something like "ln -s /memory/card/filepath /srv/www/htdocs/memcard", then open it with "http://<server name>/memcard. That assumes you've got symlinks enabled in Apache, though.

The DB can be handled in two ways as well. MySQl has a config file, telling it where to put the DB files. You can either modify it to include the directory on your memory card, or you can do a mysqldump, and import it onto the box you're on.

If all of this is done on your laptop, things are easy. Do the symlink for the web pages, so that each project has a different path on your web server, like "ln -s /development/customer1 /srv/www/htdocs/cust1", etc., and keep separate database names for each customer in MySQL. Then you can open your laptop up, and fire away. When time comes to deploy, just do a MySQl dump of the database for that particular customer, and import it into their MySQL db server, and copy the web pages over.

You might also want to investigate using Apache to set up virtual hosts on your laptop, so you COULD then have "http://customer1.localhost.com", "http://customer2.localhost.com", etc....
 
1 members found this post helpful.
Old 08-29-2010, 05:45 AM   #3
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Thanks! sounds like that config file is what I am looking for.
 
  


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
NTOP Error Traversing Database for ipnum = - Perhaps database is corrupt? soslinux Linux - Networking 2 03-03-2010 07:28 AM
DBI Connect Failed:Access denied for user ''@'localhost' to database <database> error kaplan71 Linux - Software 3 06-05-2009 01:39 PM
(my)sql: drop database doesn't remove database kpachopoulos Programming 3 09-19-2007 02:32 PM
Database Programming (database to database transaction) johncsl82 Programming 7 02-02-2007 09:20 AM
Locations Yull29m Linux User Groups (LUG) 3 01-13-2007 03:01 PM


All times are GMT -5. The time now is 12:01 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration