Live to Local

VORTEX (Heidi Ann) sent me here. She spoke highly of you folks and said maybe you could help.

I want to get a working copy of my live site (Well . . . actually my brother-in-law’s site. . . . . . but I built it. It’s a simple and basic site, not too many bells and whistles) onto my local machine (yes, I did it backwards . . . whereas most do it locally at first and then upload to live, I did it the other way around).

My OS is Ubuntu 9.10, and instead of LAMPP, I did a standalone install of PHP 5.2, Apache2, and MySQL Server version 5.1.37-1ubuntu5.5. So my local root is /var/www.

Apache runs just fine and so does PHP and MySQL. I transferred my live site db to my local machine and believe it or not the privileges are such that it CAN connect to the MySQL server (I got the usual “Cannot connect . . .” at first, but assigned the privileges to that db via phpmyadmin.)

In any case, now I’m sitting on my local machine with a working apache2, PHP, and MySQL, the db from the live site and not much else. Sort of like all dressed up and no place to go.

I did however FTP all my public_html folders and files to the /var/www folder. The live site is Joomla built (1.5.22), but simply transferring the folders and files and also the db to my local machine doesn’t do anything but give me the standard apache welcome screen, “It works! This is the default web page for this server. The web server software is running but no content has been added, yet.” For some reason the Joomla built content is missing in action. (And I DID rename the index.html file and tried that, but all I got was warning messages about screwed up paths. I guess I could go into some of the .php and .conf files and edit them, but that seems pretty tedious and uploading modifications would screw up the paths on the live site. My hosting is shared, not VPS)

I really don’t know where to go from here. I have no idea what I have to do or even if I can do anything, like modify the configuration.php file from my live site, a copy of which now resides on /var/www.

What I’m thinking about is removing those Joomla folders and files on /var/www and just using Akeeba to backup my live site and installing kickstart.php on my local /var/www and the zipped Akeeba backup and then running kickstart. (Would I remove the apache index.htm file from /var/www, so that only the archived backup and kickstart.php reside on /var/www, and then run kickstart? Do I need to modify the permissions on the /var/www folder for kickstart to work? I DO have the Akeeba and Kickstart manuals and the Akeeba URL).

I’m really lost here . . . I need some kind of a step-by-step guide on where to go from here.

Again, the ultimate goal is to get a working copy of my live site on my local machine, so that I can 'speriment with mods and no longer risk borking the live site. Obviously, included in the scheme would be how to go from local to live when I like the mods and see that they work. Could I do that also with Akeeba?


Welcome Bob.
Keep in mind most here are Brits, so lets see. . . Yep they should be leaving the pubs soon. Oh. . . I know what your thinking, but really that is when they give their best advice when polluted, also the only time they drive on the correct side of the road. ~smiles~

I’m sure someone will be able to give you some help here.


I see your razor sharp tongue and wit are active here also. Kewl . . . and why am I not surprised!

What in the heck is an “Ewok”? I am assuming that means “Rookie”, but it sounds like one of those grotesque creatures from the “Time Machine” story.

I tried to go in and change some things on my profile, like add a Jack Nicholson avatar, but it kept telling me that I wasn’t “authorized”. So I’m assuming I have to get some posts under my belt and establish some whiskers.

Can I go to a pub now? And I won’t even drive . . . I’ll just WALK on the wrong side of the road. Or maybe I should walk on the correct side of the road . . . but then I would likely get run over by a colonial tourist driving on the wrong side of the road (would that be you?).

Maybe I should just remain in the colonies and stay sober.

But those Brits do have the measurement system right. Those clowns that use the metric system . . . does that mean they just have ten months in a year?

Yep I have to come in now and then just to crack a whip.:whip:
Ewok, from star wars silly. :smackbum:
Geeks, nerds, and star wars all go hand and hand.
Anyhow off for a bit to smell the roses.

I would imagine these folks are a bit more cerebral than you and I, so an H.G.Wells novel might be more appropriate than a popcorn action movie.

But yes . . . and add Trekkies to your “go hand in hand” line.

:lol: Welcome to TPR Bob!! :wave: Hi Heidi :wavey: Nice to see you back again. Even though she does crack the whip a bit Bob, we all love her and miss here when when she goes off for a bit…well, we have to or else she will beat us :chuckle:

Linux isn’t my particular brand unfortunately as I do all my sites in Notepad thru Windoze for my sins. There are some penguin fans on here who may be able to help you better than I can.

Even so, welcome aboard and don’t be afraid to ask any questions at all. We’re a friendly site unlike some forums.

By the way has Heidi mentioned Docking@Home? Bit lax if she hasn’t :smiley: Do you run any distributed computer projects? :Pimp: mode on :slight_smile:

@ Cat Man Do,

What the heck is this “Docking@Home” stuff?

No . . . she HAS mentioned and explained it. Just couldn’t resist the chance to get her in “trouble”

Thanks for the welcome, BTW.

Looking forward to some 'nix folks suggestions.

I’ll be back in the morning, had some beers after football … 5aside soccer :chuckle:

if you’re getting the stock apache screen, chances are it’s not the site by a missing virtual host in the apache config :slight_smile:

Back tomorrow :smiley:

[QUOTE=DoubleTop;460262]I’ll be back in the morning, had some beers after football … 5aside soccer :chuckle:

if you’re getting the stock apache screen, chances are it’s not the site by a missing virtual host in the apache config :slight_smile:

Back tomorrow :D[/QUOTE]

@ Double Top,

I did remove the apache2 index.html that was the standard apache2 greeting.

Now I’m getting:

Warning:  include(/home/rbjamie/public_html/zbblock/zbblock.php) [function.include]: failed to open stream: No such file or directory in /var/www/index.php on line 1

Warning:  include() [function.include]:  Failed opening '/home/rbjamie/public_html/zbblock/zbblock.php' for  inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/index.php on line 1

Warning:  Cannot modify header information - headers already sent by (output started at /var/www/index.php:1) in /var/www/libraries/joomla/factory.php on line 566
Database Error: Unable to connect to the database:Could not connect to MySQL

First of all, “zbblock” is the security software I use on my LIVE site. But more importantly, I think that first “Warning” line is because the path on line one in index.php does NOT exist on my local machine. Which is why I’m thinking to try and use Akeeba because maybe it will adjust those paths.

In the alternative, I guess I could just as well go in there and edit the index.php with my IDE. But then I’d have to do that on my LIVE site everytime I uploaded my content modifications.

The second warning seems to be the same.

The third warning I’m not too sure about, except I see there’s that damn " . . . could not connect to MySQL" nonsense again.

I thought I had solved that whole problem when I just flat out reset the MySQL password with the sequence:

sudo /etc/init.d/mysql stop

sudo mysqld --skip-grant-tables &

mysql -u root mysql

And then at the MySQL prompt:


And then I was using my own “testme.php” file:

 START editing here...

$mysql_host     =   'localhost';
$mysql_username =   'root';
$mysql_password =   '';
$mysql_database =   '';

 STOP editing here...

echo('<p>Trying to connect to MySQL on server <strong>'.$mysql_host.'</strong> as user <strong>'.$mysql_username.'</strong> with password <strong>'.$mysql_password.'</strong>.</p>');
if(!is_resource($db)) {
    echo('<p style="color:#c00">FAILED</p>');
    echo('<p>Debug - '.mysql_errno($db) . ':' . mysql_error($db). '</p>');
} else {
    echo('<p style="color:#0c0">SUCCESS</p>');
echo('<hr />');
mysql_query('SET CHARACTER SET \'utf8\';',$db);
mysql_query('SET NAMES \'utf8\' COLLATE \'utf8_general_ci\';',$db);
echo('<p>Trying to talk to database <strong>'.$mysql_database.'</strong>.</p>');
if(!mysql_select_db($mysql_database,$db)) {
    echo('<p style="color:#c00">FAILED</p>');
    echo('<p>Debug - '.mysql_errno($db) . ':' . mysql_error($db). '</p>');
} else {
    echo('<p style="color:#0c0">SUCCESS</p>');
    exit('<p>Thank God! Now it's time for that cigar...</p>');

to see if it worked. The indication was “Success” when I plugged in the LIVE site db name and reset password. (BTW, haven’t divulged any passwords or user names here because in the php script above, the default user is “root” and the default password is nothing (""). I just plugged in the actual db name and new password.)

But I think the configuration.php file from my LIVE site, plus some other imported files, needs to be edited also. The paths are all screwed up.

Bottom line, again this was why I was thinking of using Akeeba to avoid all this hassle . . . which it advertises it will do.

Another problem is that I know just enough to be dangerous, and I was hoping maybe Akeeba would help me not to shoot myself in the foot, which I often end up doing when I try to do things myself.

I get it “half-right” and screw myself up with the other half that is absolutely wrong.

Which is another reason why I need to get my site on my local machine for edits. I’ve been lucky so far, but sooner or later if I keep editing the LIVE site, the law of averages is going to catch up with me and I’m going to bork the LIVE site.

Fortunately I just renamed the Apache index.htm file to “indexold.htm” and was able to recover to at least where I was getting the apache “working” message, which essentially puts me back to square one.

I’ve got to be missing something real simple because I know a lot of people have this kind of setup for test editing and they can’t be going through the tedious cycle of resetting paths every time they go from local to live and then have to adjust the paths on live again.

I haven’t made any mods to any of the .config files nor told it where to look for a virtual host. BTW, is there an httpd or an httpd-vhost file in the standalone versions I installed. I know where they were on a LAMPP installation, but I have no idea where they are or what to do with them on my standalones.

So what am I missing?

which version of Joomla is the site based on 1.5 or 1.6?

@ Double Top,

As I said in my OP, the live site is built with Joomla 1.5.22.

Does that give some kind of a clue about what my problem is?

Any thoughts on Akeeba or do you think I can do what I want to do without it?

Or is it just flat out too early to tell?

What about those .conf files . . . httpd and httpd-vhost?

@ DoubleTop,

This may be informative for you.

haven’t used Akeeba before, does Joomla 1.5 store path info in the database, I’ve only got 1.6 installed.

@ DoubleTop,

Don’t know for sure about the 1.5 db . . . how would I find that out for sure? Could I look at some of the elements in the db via phpmyadmin?

I do know that configuration.php has some paths in it and they are incorrect for the local machine.

I may have a promising idea here (this would be where Heidi Ann would jump in and make a wisecrack about me having “ideas” being “dangerous”).

First of all, DoubleTop, I dumped the MySQL db and loaded it into a text file and searched for some paths (like lines containing “public_html”) and indeed the db contains INTERNAL paths.

What I’m thinking (boy, am I giving Heidi Ann some opportunities for wisecracks . . . don’t disappoint me, Heidi) is that I should use RELATIVE paths instead of ABSOLUTE paths, and they would work on both the LIVE site and LOCAL site, since the tree structures on both are exactly the same.

For example, my php.ini file had a path shown as “”/home/<my user name>/public_html/zbblock/zbblock.php" (zbblock is site security software I use.)

And I was getting a notice that Apache couldn’t find “/home/<my user name>/public_html/zbblock/zbblock.php”. So I edited the php.ini file and changed the path to "zbblock/zbblock.php (the RELATIVE path).

And lo and behold that Apache notice on my local machine no longer appeared.

Am I on to something here?

sounds like that’s the issue then, 1.5 must store some configuration values in the database.

It’s been a busy few days, end of the week I might be able to throw a test site up somewhere to have a look.


If you’d have only given me the chance.

See when you get to be Bobs age (like Jurassic period old.) those brain farts are like extra fermented with rotten smelly ideas.
Hmm. . . yet somehow they always seem to work.

OK . . . now I feel more comfortable having been lashed by Heidi’s sharp tongue.

So is that part of the initiation rites here at TPR?

If not it should be. If someone can withstand a Hedi barb, then they would seem to have the right temperament.

OK . . . on to more serious matters (gee, did I just call Heidi “irrelevant”?)

(Heidi, I PM’d you the same thing on WOT, so you may recognize this).

Have I solved the problem?

Yes and no. I have the live site set up on my machine now, but at first all the internal links in the menu were giving me a 404.

The solution to that was simple: disable SEF.

And then I had a permissions issue on configuration.php. Simple solution again.

The big breakthrough, which I intimated on here to DoubleTop, was ABSOLUTE paths versus RELATIVE paths. Once I made all the paths RELATIVE, things began falling in place.

It had ABSOLUTELY nothing to do with httpd or httpd-vhosts configs or any other configs for that matter. Nor did it have anything to do with the .htaccess file. I was chasing my tail on a lot of those troubleshooting efforts.

The “no” part is that I need to learn how to upload my changes. For now I’ll test the changes and then hopefully do the same procedure on the live site if it works on the test site.

But ultimately I need to gain enough confidence in my “test” site so that I can just flat out upload them and not go through hoops twice.

Right now I’m afraid that if I uploaded the test site db I’d bork the live site.

The next big hurdle?

My brother-in-law, whose site it actually is . . . I just built it for him . . . . . . is now having his daughter maintain and edit the live site.

She has a Windows machine. I’m pretty checked out now on my Linux machine (or at least I have a running start).

So I need to learn how to do this on Windows (we do CrossLoop RA sessions, so I can install it on her machine in a CrossLoop session).

Right now she’s doing live edits on the live site (under my “supervision”). But I’d like to get her setup with a “test” site on HER machine.

I have a Windows VM on this machine, and another dual boot machine with Windows as one of the boots. So I’m going to 'speriment on one of them.

Am assuming the first step would be to start off with WAMP, and see if I can get her server working.

Hopefully, I’ve run into the major pitfalls with this Linux install on my machine, and Windows will be a breeze.

But I do anticipate “new” and different issues.

Heidi has suggested setting up a “test” live site (duplicate) on the host sever, and I guess that’s an option too.

Any tips or heads up on a local test site in Windows or the live site “test” duplicate option?