Wrong Ubuntu directory structure for install of PHP, MySQL and Apache

I’m studying PHP and MySQL using two books, one of which is Yank’s Database Driven Web Site. Fortunately I already have Apache2, MySQL5 and PHP5 installed and functioning, running on Ubuntu 10.4.

Still, I read through Yank’s description of the installation of those programs and (1) many of the file names he uses do not exist on my system and (2) the various directories he mentions, where those programs should be installed, don’t exist.

I know that different Linux distributions use different locations for the same things, but I’m entirely lost. I understand that Yank is targeting both Red Hat and Ubuntu 8.xx (which seems sensible), but how can the file names and directory structures be so different from what he documents in the book. Is this a result of major configuration changes in Ubuntu 10.4 or since the version of Ubuntu that Yank is using?

I admit to having only read to pg. 42 in Yank’s book, but a quick browse forward didn’t discover anything addressing this issue. Also, I tried a couple of forum searches here with no luck. It’s hard to know what keywords to search for.

Can anyone direct me to a source of info on the differences in file names and directory structures for Apache, MySQL and PHP installations when comparing these between Ubuntu 10.4 and Yank’s book? Thanks

Thanks, Immerse:

As I mentioned, I already have Apache, MySQL and PHP all installed and running. I used Synaptic Package Manager to install, with no problems. If I’m not mistaken, Synaptic is simply a GUI frontend for apt-get, which latter also leans on dpkg. I’ve already successfully created and run some PHP code and MySQL tables.

What I’m trying to understand is how Yank’s manual installs relate to my SPM/apt installs, and how to do the configurations he goes on to mention, when the locations and files he references (e.g., mysql.server) don’t seem to exist on my system or are arranged quite differently. I have similar problems with his discussions of PHP and Apache install details.

I’ve not read the book, so I don’t know what it tells you.
However, I use Ubuntu 10.04, and I installed Apache, MySQL and PHP using apt-get (or the Synaptic Package Manager). Having done that, I never need to worry about starting stuff.

Sorry, I know it’s not the answer you’re looking for. But maybe using apt-get would be easier after which you could skip to the interesting parts - programming some PHP :slight_smile:

My apologies. I have a correction to make to my first post. Yank didn’t mention anything about RH Linux. In his section on “Linux Installation,” he specifically says: “These instructions were tested under Ubuntu 8.10.” The RH reference is from my confusion from another book on Linux Administration I’m reading concurrently with Yank’s book. Sorry.

I’m using the 4th edition of Yank’s book and the copyright date is 2009. I wouldn’t think things have changed so much in the last year and a half or, if so, I would like to think Yank would have mentioned the differences. There is no mention of these problems in the errata for the book. Perhaps he didn’t know about the differences at the time the book was published. But it seems like he should have at least mentioned significant differences, if any, between automatic and manual installs.

Finally, I’m running MySQL 5.1.41-3ubuntu12.3, PHP 5.3.2-1ubuntu4.2 with Suhosin-Patch (CLI) and [B]Apache/2.2.14 /B, all major versions consistent with what Yank says I should be using. Everything was installed automatically with Synaptic Package Manager; i.e., nothing was compiled from source or installed manually.

Following is a list of the discrepancies that are confusing me. To keep things more manageable, I’ll only mention my problems with the MySQL installation, which are typical of the problems I’m also having understanding Yank’s descriptions of the installs of PHP and Apache. Perhaps answers to the MySQL anomalies will enable me to figure out the other similar problems I have with the Apache and PHP installs:

1.) Yank instructs (p. 34) to place the MySQL tar file in the /usr/local directory and uncompress it there, which creates a /usr/local/mysql-version-linux-platform directory. He then creates a symbolic link to that directory using the shorter name “mysql”. Then he changes directory to /usr/local/mysql, which I’m assuming is the MySQL install location. Since I didn’t manually install MySQL there, I have no such directory in my file system. Question: where would my corresponding MySQL install location be after an automatic install with apt?

2.) He then installs database files, does a first launch, and finally tests for proper database operation with these commands:

[INDENT] root@machine:/usr/local/mysql# scripts/mysql_install_db --user=mysql
root@machine:/usr/local/mysql# bin/mysqld_safe --user=mysql &
root@machine:/usr/local/mysql# bin/mysqladmin -u root status[/INDENT]

A search for these files show that mysql_install_db and mysqld_safe are shell scripts, mysqladmin is a shared library, and all three files are located in my /usr/bin directory, along with over 2100 other files. Am I to assume that, with my automatic installation, that /usr/bin is the MySQL install directory? There are no related subdirectories like mysql…, bin, scripts, etc., like Yank indicates. Since /usr/bin is in my $PATH, I can run those commands directly from a shell CLI, but it seems like a pretty sloppy kind of installation, just dumping everything in the /usr/bin directory. Am I missing something here?

3.) Two pages later, Yank tells how to automatically run MySQL server whenever the system is up. He says:

[INDENT]“In the support-files subdirectory of the mysql directory,
you’ll find a script called mysql.server that can be added to your system startup
routines to do this. For most versions of Linux, you can do this by creating a link
to the mysql.server script in the /etc/init.d directory, then create two links to that:
/etc/rc2.d/S99mysql and /etc/rc0.d/K01mysql”[/INDENT]

A search of my file system indicates there is no support-files subdirectory or any script called mysql.server on my system. If /usr/bin is, indeed, the MySQL install directory and that subdirectory and file are not in there, where would mysql.server be located?

I’ve posted here because Yank’s book is a Sitepoint publication and I’m hoping to find someone familiar with this situation. Perhaps I would be better off trying to submit my questions to the author himself. Anyway, this forum seems like a good place to start.

Thanks in advance for any help.

My guess is that Kevin’s book is a couple of years old. PHP, MySQL, Apache and Ubuntu have all been updated quite a lot since then.

I’m not sure if there’s an update/ errata sheet for the book, maybe a Sitepointer will know that.

Maybe if you specify exactly where’s it confusing you, we could help you work out the differences :slight_smile: