193 lines
12 KiB
Plaintext
193 lines
12 KiB
Plaintext
|
|
Episode: 2312
|
||
|
|
Title: HPR2312: Troubleshooting Websites with XAMPP
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr2312/hpr2312.mp3
|
||
|
|
Transcribed: 2025-10-19 01:10:15
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
This in HBR episode 2,312 entitled, Trouble Shooting website with MAMP.
|
||
|
|
It is hosted by Frank Mel and in about 15 minutes long and Karim a clean flag.
|
||
|
|
The summary is, Frank describes how he used MAMP to clone his website to local host so he
|
||
|
|
could shoot some trouble.
|
||
|
|
This episode of HBR is brought to you by AnanasThost.com.
|
||
|
|
At 15% discount on all shared hosting with the offer code HBR15, that's HBR15.
|
||
|
|
Better web hosting that's honest and fair at AnanasThost.com.
|
||
|
|
Hello, this is Frank Bell.
|
||
|
|
I haven't recorded a podcast for HBR in some time.
|
||
|
|
Part of the problem is identifying a topic on which I feel confident to speak and which
|
||
|
|
I also feel the HBR audience would find interesting.
|
||
|
|
The other part of the problem is that I had just about the most annoying winter ever.
|
||
|
|
I won't go into the details.
|
||
|
|
As Gildner Radner would have said, if it wasn't one thing, it was another.
|
||
|
|
But I am going to talk about one of the annoyances which was that for most of February my website
|
||
|
|
was broken.
|
||
|
|
In particular, the WordPress blog that I maintained was broken.
|
||
|
|
I took advantage of that to do two things.
|
||
|
|
One of them was to move from shared hosting to a VPS.
|
||
|
|
Not because I really eat a VPS, but hey, I'm a Linux geek.
|
||
|
|
I wanted a VPS.
|
||
|
|
The other was to clone my website, including the blog to local host.
|
||
|
|
I did that using Shamp.
|
||
|
|
You may know it as XAMP, XAMP, pronouncing X as in xylophone, but according to a video
|
||
|
|
at their website, the maintainers pronounce it SHAMP, and I will defer to their wishes.
|
||
|
|
Their website is www.apachefriends.org.
|
||
|
|
It is a complete web server stack of Apache, MariaDB, PHP, and Pearl.
|
||
|
|
All configured to work together out of the box.
|
||
|
|
And if you've ever established those different components separately, and then try to get
|
||
|
|
them to work together, you will appreciate the simple beauty of this.
|
||
|
|
It's available for Linux, Windows, and Mac, but I can only speak of the Linux version.
|
||
|
|
It's useful for testing changes to an existing website before bringing them live, practicing
|
||
|
|
your web design skills, or as in my case, troubleshooting something that's not working right.
|
||
|
|
When you download it from Apache Friends, you download a small stub, and that stub starts
|
||
|
|
a binary installer which installs the rest of the package.
|
||
|
|
It really works very, very nicely.
|
||
|
|
I would note, regarding security, that none of the components, the database, the FTP,
|
||
|
|
what have you, of XAMP, are password protected by default.
|
||
|
|
The idea is that this will make it easier for developers to get it up and running.
|
||
|
|
The maintainers caution strongly that XAMP should not be used for a production website.
|
||
|
|
In other words, it should not be public-facing.
|
||
|
|
However, if you have a need for passwords, and I did, you can institute password protection
|
||
|
|
after the installation is complete by issuing the following commands as root, CD, slash
|
||
|
|
opt slash lap by default, ZAMP installs to opt lap, and then issuing the command dot slash
|
||
|
|
lap, that's LAMPP for Linux Apache, MariaDB, PHP and Perl, space security, and that will
|
||
|
|
start a script that will enable you to password protect the various components of the application.
|
||
|
|
In my case, I needed to do so because since I was going to be testing an existing database
|
||
|
|
that already had password protection built into it, I needed to have passwords that were
|
||
|
|
compatible to the existing passwords in my database.
|
||
|
|
That is, the password to access the database as a database administrator, not a title that
|
||
|
|
I would ever give myself.
|
||
|
|
There will be a link in the show notes to the XAMP Linux fact for more information about
|
||
|
|
the LAMP security script and the program as a whole.
|
||
|
|
Once you've got it installed, you can test the installation as follows.
|
||
|
|
As root, issue the command CD, space slash opt slash LAMP, then issue the command dot slash
|
||
|
|
LAMPP space start.
|
||
|
|
As a footnote, if you want to turn it off, the command is dot slash lap LAMPP space stop.
|
||
|
|
If the application has been successfully installed, Shamp will respond as follows.
|
||
|
|
Starting Shamp for Linux kernel kernel number.
|
||
|
|
Starting Apache, okay, starting me SQL, okay, starting pro FTPD, okay, if you do not
|
||
|
|
give that response, it's broke and you need to do some troubleshooting as to why it's
|
||
|
|
not working.
|
||
|
|
But frankly, I have never had an IBU Shamp off and on over nearly 10 years now, never
|
||
|
|
had an installation fail.
|
||
|
|
Assuming I follow the directions, the final test is to point your browser at HTTP call
|
||
|
|
and slash slash local host and you will see the Shamp dashboard page.
|
||
|
|
The next step is to clone your website.
|
||
|
|
The first step of that is to copy all your website files, which you should have backed
|
||
|
|
up to your local hard drive into slash off slash LAMPP slash HT docs, HTDOCS.
|
||
|
|
That is the web root directory for Shamp.
|
||
|
|
If you have a static website, you're done.
|
||
|
|
You can go to work updating your HTML pages in the text editor of your choice and then
|
||
|
|
testing them out in Shamp.
|
||
|
|
Indeed, you can actually edit them directly from the HT docs directory and test your changes
|
||
|
|
on the fly, if you wish.
|
||
|
|
I have actually done that.
|
||
|
|
But if you have a database, there is more to it, much more to it.
|
||
|
|
And who doesn't have a database anymore?
|
||
|
|
For a database, the next two steps are to use PHP MyAdmin to configure MariaDB to
|
||
|
|
receive the database and then to actually import the database into MariaDB.
|
||
|
|
The first of these, preparing MariaDB.
|
||
|
|
By default, your MariaDB user is root and unless you've changed it by default, root does
|
||
|
|
not have a password.
|
||
|
|
In my case, I gave root a password.
|
||
|
|
You want to create a database user who is not root and does not have root access to
|
||
|
|
MariaDB, but will have full access to the database that you will be testing.
|
||
|
|
Here's how to do that.
|
||
|
|
Point your browser at HTTP, call and slash slash local host slash PHP MyAdmin.
|
||
|
|
You will get the login page, login as the root user of your database engine.
|
||
|
|
Make user accounts and then click new.
|
||
|
|
Create a new account, giving it a username and a password and here's where the password
|
||
|
|
and the username need to be compatible with your existing database.
|
||
|
|
Under database for user account, check to create database with same name and grant all privileges.
|
||
|
|
That creates a database with no tables.
|
||
|
|
So that's the first of those steps, preparing MariaDB to receive the database.
|
||
|
|
The next step is to actually import your database back up.
|
||
|
|
If you don't have a database back up at this point, you are now toast.
|
||
|
|
Most common database backup format is SQL.
|
||
|
|
There are other formats that PHP MyAdmin is capable of importing for that list, see the
|
||
|
|
PHP documentation.
|
||
|
|
I usually use the import function, open up the database, my new database and at the top
|
||
|
|
of the screen, there will be a row of buttons and one of them will say import.
|
||
|
|
In order to import the database, there are two changes you need to make in your php.inifile,
|
||
|
|
which is located in slash opt, slash lamp, L-A-M-P-P, slash ETC slash php.inif.
|
||
|
|
Open that up in the text editor of your choice and find the settings, memory underscore
|
||
|
|
limit and post underscore max underscore size.
|
||
|
|
By default, they are set at 8M, capital M for megabyte.
|
||
|
|
These those to a size large enough to allow you to import your backed up database, which
|
||
|
|
you have sitting in a safe place on your hard drive.
|
||
|
|
You can change them back later to smaller sizes if you wish.
|
||
|
|
But to do an import, you have to open the door wide enough to let the import in.
|
||
|
|
Once you've done that, stop and restart, shamp, so that the any files get read and new.
|
||
|
|
Plug into phpmyman again as your database user and then navigate to the empty database
|
||
|
|
you created.
|
||
|
|
Click the import button towards the top of the screen.
|
||
|
|
Navigate to the location of the backup on your hard drive and start the import.
|
||
|
|
Note, do not leave your computer unattended.
|
||
|
|
Even if you've opened the door wide enough, your import may stop with a message about latency
|
||
|
|
or some such thing.
|
||
|
|
I don't remember the exact wording and I am to click here to resume it.
|
||
|
|
If you're off doing something else and that message appears and you don't respond in
|
||
|
|
time, you will not get to resume the import, you will need to start all over.
|
||
|
|
Up the latest HPR podcast into your pod player and listen to it while you watch your screen.
|
||
|
|
Once the import is complete, you are almost ready.
|
||
|
|
Now here I am limited.
|
||
|
|
My only direct experience is with WordPress, but I suspect that other database programs
|
||
|
|
have similar settings that you will need to track down.
|
||
|
|
In your WordPress database, in the WP hyphen options table.
|
||
|
|
There are two settings that point to the location of your website.
|
||
|
|
If you have downloaded this from a hosting provider, they will point to whatever your address
|
||
|
|
is at www.bigwideworld.com.
|
||
|
|
You need to change those to point to localhost.
|
||
|
|
In WordPress, those two settings in the WP options table are site underscore URL and home.
|
||
|
|
The link is near the top of the options table, the other is near the bottom.
|
||
|
|
If you don't change these and you are able to successfully open, in my case, my blog
|
||
|
|
from localhost.
|
||
|
|
And I click on an internal link, such as the settings page.
|
||
|
|
The link will try to go to www.bigwideworld.com instead of to localhost.
|
||
|
|
You need to tell the database that it is supposed to work and play in the play pen on local
|
||
|
|
host and not go outdoors.
|
||
|
|
Now you are ready to troubleshoot.
|
||
|
|
Now going back to why I had this experience, the two problems I had with my blog were completely
|
||
|
|
unrelated.
|
||
|
|
One of them had to do with the theme which had worked very nicely ever since I moved to
|
||
|
|
Virginia which is when I had adapted on Taylor the new theme and it started to get fractures.
|
||
|
|
That had nothing whatsoever to do with the other more serious problem that my database
|
||
|
|
had grown my share hosting.
|
||
|
|
As I said, I got a VPS because I wanted a VPS, but I still wanted to find out what was
|
||
|
|
going on because the database by rights shouldn't have been that big.
|
||
|
|
And I found as I looked at it, I knew they were there, I just hadn't done my house
|
||
|
|
keeping.
|
||
|
|
There were a bunch of tables left over from various plugins I had tried and discarded
|
||
|
|
for various functions.
|
||
|
|
And I was hesitant to go willy-nilly deleting tables from the database for my live site.
|
||
|
|
Once I have it cloned to localhost, I could go through and say, aha, I think I don't
|
||
|
|
need you anymore, drop, you look like I don't need you anymore, drop, and I could find
|
||
|
|
out which tables were safe to drop without affecting the primary functionality of WordPress.
|
||
|
|
So that's why it's so nice to have a testbed.
|
||
|
|
If you break something, you haven't harmed anything.
|
||
|
|
You're still back in the dressing room and you're not falling over your feet in public.
|
||
|
|
And I've got my blogs working very nicely now.
|
||
|
|
I got a lot of profit.
|
||
|
|
The database is back down to a size where I could still be using shared hosting if I wish,
|
||
|
|
but it's really kind of nice to be able to SSH into your own virtual private server.
|
||
|
|
I hope you found this interesting.
|
||
|
|
If you've never experimented with Champ and you want to learn more about how websites
|
||
|
|
work, I recommend it to you highly.
|
||
|
|
You can reach me at Frank at PineViewFarm.net.
|
||
|
|
PineViewFarm is all one word and it's the name of the farm where I grew up.
|
||
|
|
And I hope to be back to HPR on a more frequent basis now that the annoying winter has passed
|
||
|
|
away.
|
||
|
|
I certainly don't want to have a summer as annoying as that winter.
|
||
|
|
I can tell you that.
|
||
|
|
Thank you all very much for listening.
|
||
|
|
Take care.
|
||
|
|
You've been listening to HECCA Public Radio at HECCA Public Radio dot org.
|
||
|
|
We are a community podcast network that releases shows every weekday Monday through Friday.
|
||
|
|
Today's show, like all our shows, was contributed by an HPR listener like yourself.
|
||
|
|
If you ever thought of recording a podcast, then click on our contributing to find out
|
||
|
|
how easy it really is.
|
||
|
|
HECCA Public Radio was founded by the digital dog pound and the Infonomicom Computer Club
|
||
|
|
and is part of the binary revolution at binwreff.com.
|
||
|
|
If you have comments on today's show, please email the host directly, leave a comment on
|
||
|
|
the website or record a follow-up episode yourself.
|
||
|
|
Unless otherwise status, today's show is released on the Creative Commons, Attribution,
|