Ubuntu 6.06 LTS LAMP option - install problem

|

I'm starting from scratch in building a server to run Advokit for my town's Democratic club (if I'm able to do it, that is!). I used the 'Install a LAMP server' option in Ubuntu 6.06 LTS server to build the system, and then updated the installed software with 'sudo apt-get update' and set the root password for mysql, as well as a password for the ID that owns Apache (www-data). I had to surround that name in single quotes to get mysql to not give syntax errors.

I'm having trouble right out of the gate in installing Advokit. It never connects to the server. Since I'm tired of flailing around without being certain of what is wrong, I was hoping for answers to a few questions.

In the initial screen:

in the 'Database Host' field, is 'localhost' valid if the mysql server is on the same system as the apache server?
in the 'Database User' field, is the name supposed to be that of the owner of the currently running apache process?
Does the database in 'Database name' already have to be created in MySql before running Advokit install?
Can a MySql ID have a hyphen in the name, like 'www-data', since my auto-installed LAMP server set apache up that way?

Thanks to any and all who answer for your help.

OK

"in the 'Database Host' field, is 'localhost' valid if the mysql server is on the same system as the apache server?"

Yes!

"in the 'Database User' field, is the name supposed to be that of the owner of the currently running apache process?"

No, it should be the name of the mysql user that is assigned to the database that you created for advokit. You could just put your MySQL root account and password here, but it is better to create a user name that has root access to your advoikit database only, for security reasons.

"Does the database in 'Database name' already have to be created in MySql before running Advokit install?"

Yes! As mentioned above, you need to create a database in MySQL for the Advokit installer to populate with tables. You should also assign that database a user that has unique access to said database (not all databases in MySQL, like the root account), for security reasons. You also need to create a directory in the root of your file system (not web root) for the important Advokit directories to be built and files to be stored. Also remember to remove the Advokit installer from your web root directory (var/www) after you have installed it.

There are instructions right on this site!

"Can a MySql ID have a hyphen in the name, like 'www-data', since my auto-installed LAMP server set apache up that way?"

That is the user name and group that apache runs under, you probably want to create a different user name and password for MySQL.

Good Luck!

"There are instructions right on this site!"

I KNOW there are instructions right on this site. I read them repeatedly. And I felt like an idiot for not being able to understand why my setup wasn't working BEFORE I posted to this forum.

Thank you for your assistance.

Yes, and...

OK, so did you get it working or not?

Welcome to the Advokit community!

Thanks... and no, not working... YET

At this point I have:

edited apache2.conf as you suggested (I had NOT done it) and restarted
created a db in mysql named advokit
created a mysql ID 'advokit' and given it all permissions on the db advokit
created and then dropped a table in db advokit to verify that the ID has the permissions specified

When accessing the Advokit installer page on my system, I get to the 'Step 2' page and the following text is all I get:

---
Advokit Installation - Step 2 PHP Info
Test database connection

Attempting to connect to database at localhost:3306 as user advokit ...
---

No mention of success or failure in connecting to the database in mysql.

The 'PHP Info' link gives me a page that seems to indicate that PHP is working. The fact that I get the installer pages tells me that apache2 is working. I've told you about creating the database, so mysql is working. They're just not working together, it seems.

I don't know where to look at this point.

Ubuntu Rocks

BTW, i am running an ubuntu server as well, so i think we can get to the bottom of this.

let me get this straight...

in step one you have the following set:

localhost

3306

advokit

advokit

yourpassword

and your table prefix is set to the default:

_ak

did you select yes or no for transaction-safe tables?

Also, what version of Advokit are you installing? Just make sure it is version 1x located here:

http://advokit.net/node/132

I do like Ubuntu

Makes life easier. Usually!

You do have it straight. I have the settings you lay out above for all fields. I tried both Yes and No for transaction-safe tables. Neither option seemed to make a difference.

I downloaded advokit 1.0.0 (http://svn.advokit.net/dl.php?repname=advokit-installer&path=/tags/advokit-r1.0.0/&rev=0&isdir=1) from (http://www.advokit.net/download).

definately try the 1x

definately try the 1x installer instead, it is a much better version and you can help us debug it!

it is the tarball that Pat mentions in the following link:

http://advokit.net/node/132

Same behavior

I downloaded the tarball and stuck it in my /var/www dir,
chown'ed it to www-data,
chmod'ed it to 755,
and accessed it via a browser.

Stuck at:

Test database connection

Attempting to connect to database at localhost:3306 as user advokit ...

I don't know. Did you try

I don't know.

Did you try your MySQL root account with the same results?

Yes, I did

Just now.

Any advice on how to verify that Apache/PHP are properly talking to MySQL? The PHP Info link has this section labeled "dbx":

dbx support enabled
dbx version 1.0.0
supported databases MySQL ODBC PostgreSQL Microsoft SQL Server FrontBase Oracle 8 (oci8) Sybase-CT

hmmm

check:

/etc/mysql/my.cnf

and make sure the following line is commented out, as follows:

#bind-address = 127.0.0.1

if it isn't commented out, do so and restart MySQL.

then try:

sudo netstat -tap

you should see a line that looks something like this:

tcp 0 0 *:mysql *:* LISTEN 4997/mysqld

Done

I get

tcp 0 0 *:mysql *:* LISTEN 3670/mysqld

But Advokit install is still hanging up at Step 2, not connecting to the db at all. Not even a failure msg.

Advokit Installation - Step 2 PHP Info
Test database connection

Attempting to connect to database at localhost:3306 as user advokit ...

By the way, thank you for all of your help up to this point. It's been very nice of you.

I just want Advokit to work for you!

OK try this!

Do:

---

locate mysql.so

---

I think you will find it in /usr/lib/php5/20051025/

Now create the "ext" dir, and copy the extension file in it:

---

sudo mkdir /usr/lib/php5/ext

sudo cp /usr/lib/php5/20051025/mysql.so /usr/lib/php5/ext/

---

Now let's enable this extension in php:

---

sudo vi /etc/php5/apache2/php.ini

---

Look for "extension_dir" in the php.ini file.

It should be equal to "/usr/lib/php5/ext/"

If it's not, set it, between double quotes.

Now lower down in "Dynamic Extensions", just add this line:

---

extension=mysql.so

---

Save, exit, restart apache2, and we'll see.

One thing that just hit me

and I feel stupid about not realizing it earlier. When I installed smarty via apt-get, it installed php4 as well. So my system probably has php4 and php5, and apache2 is not contacting the right php code.

How do I tell which version of php my server is using, or alternately, how do I get smarty to work with php5?

w00t!

your modules probably need to be enabled...

do:

ls /etc/apache2/mods-enabled

you should see, among other things:

php5.conf php5.load

if not, then you'll have to create a symlink from the /etc/apache2/mods-available directory to the mods-enabled directory.

let me know how it goes!

just in case

...you would do so, of course, by doing:

sudo ln -s /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php5.conf

sudo ln -s /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled/php5.load

you may want to do all of this with php4 instead of php5, since advokit runs fine on either.

I created the symlinks for php5

and restarted the server. Apache2 did not load.

I removed the symlinks from /etc/apache2/mods-enabled, and restarted the server. Apache2 loaded again, but of course I was back in the same spot as earlier.

How do I get mysql to work with apache2 and php4? Or verify that they're configured to work with each other?

FINALLY!

I broke down and reinstalled Ubuntu server 6.06 WITHOUT the LAMP option. I then followed the instructions at

https://help.ubuntu.com/community/ApacheMySQLPHP#head-9c0feb0418eaa2775771898bc1318c80d99c4752

and was able to connect to the advokit database I created!

fredsambo, thank you very much for your patience and help.

As for the rest of you, I recommend rolling your own LAMP on Ubuntu as opposed to using the default option if you're as dense as I am.

I installed the LAMP option

I installed the LAMP option out of the box and it went fine. I think your trouble arose when you installed php4 (with smarty) as well as php5.

Another good How-To is located here:

http://www.howtoforge.com/perfect_setup_ubuntu_6.06

Glad you got it working!

How did you install smarty?

I didn't choose to install php4; it was automatically installed when I used apt-get to install smarty.

aptitude vs. apt-get

i didn't install smarty. but i have both php5 and php4 running on my server so...

is Smarty installation needed?

I thought everything you needed for Smarty was included by the Advokit installer.

Pat speaks the truth

It is indeed!

Why did you install smarty beemer, are you working with it in something other than Advokit?

I assumed...

I had built a system months ago, and at that time I was under the impression that I had to install smarty. When I rebuilt recently, I was still under that impression.

Just a dumb mistake.

So...

Is Advokit up and runing for you now?

Yes, it is

Though I've been too busy with phone banking and canvassing lately to do anything with it!

w00t

I hope you had a good election day beemer! Now lets start working on Advokit! :-P

Also...

Be sure that line # 334 in your /etc/apache2/apache2.conf file reads:

AddType application/x-httpd-php .php

as opposed to the default:

#AddType application/x-httpd-php .php

This will allow PHP to run in Apache. By default it is disabled for security reasons. Although it seems like you've already gotten bayond this step.

This topic has been moved... but to where?

I see in both the 'Advokit Info' and the 'Advokit Users' forums that the parent post has been moved, but provides no link to the topic. Did I post incorrectly? Did my post violate some forum rule(s)?

May be a browser caching issue?

Try forcing the page to reload.

Well, regardless of where they're going

You're finding them. Can you answer the questions I originally posted?