Koozali.org: home of the SME Server

PHP-Nuke on 4.1

Brad

PHP-Nuke on 4.1
« on: February 17, 2001, 06:54:39 AM »
Hello,
having a problem installing PHP-Nuke 4.4 on a clean install of E-Smith 4.1.
Whenever I try to connect to the admin or index pages I recieve the following error:

Warning: Host 'e-smith.xxxxxxx.peoria1.il.home.com' is not allowed to connect to this MySQL server in /home/e-smith/files/ibays/bradsworld/html/mainfile.php on line 17
Unable to select database

Any ideas? Thanks

erdius

Re: PHP-Nuke on 4.1
« Reply #1 on: February 17, 2001, 09:24:53 AM »
there is no problem with either phpnuke or esmith.  as much as i hate to say RTFM.....you need to read phpnukes install directions.

Alexie

Re: PHP-Nuke on 4.1
« Reply #2 on: February 18, 2001, 01:09:44 AM »
I have the same problem, and maybe im Dum, but i can't find it..:-)..??

erdius

Re: PHP-Nuke on 4.1
« Reply #3 on: February 18, 2001, 02:08:38 AM »
you need to first create the nuke database with something like.

mysqladmin -u root password mynewpassword

edit the conifg.php file, and enter the database information you just created...
thats should do it.

Dan Brown

Re: PHP-Nuke on 4.1
« Reply #4 on: February 18, 2001, 02:13:52 AM »
erdius wrote:

> you need to first create the nuke database with something like.
>
> mysqladmin -u root password mynewpassword

    This line won't do anything useful; all it will do is change the mysql root password.  The line to create the database should look something like

mysql < create_database.sql

    This is off the top of my head, as I don't have a PHP-Nuke installation to refer to.  Check the docs to be sure.

Alexie

Re: PHP-Nuke on 4.1
« Reply #5 on: February 18, 2001, 05:04:50 AM »
Thx for all the tips, it was not so hard, was it..:-))

Please Remenber, we are some novice that not can all yet..
But we geting better and better..:-)

E-Smith and all you Linux freaks have learn me so many good thing about linux, Thx for that..

Dan Brown is allways there for us...Thx Dan..

No More Thx for Today, it's late over here in Denmark..

Alexie from www.zbox.dk

erdius

Re: PHP-Nuke on 4.1
« Reply #6 on: February 18, 2001, 05:29:08 AM »
The mysqladmin was to merely setup the inital database settings.  with phpnuke, you dont need to redirect the sql into the database, you just need to create it, and point your browser at the sql page.

Dan Brown

Re: PHP-Nuke on 4.1
« Reply #7 on: February 18, 2001, 07:11:00 AM »
erdius wrote:

> The mysqladmin was to merely setup the inital database
> settings.  with phpnuke, you dont need to redirect the sql

    So all you need to do is to create the database?  OK, you'd do that with

# mysqladmin create nuke

(or, alternatively)

# mysql
mysql> create nuke;

Gerald Jansen

Re: PHP-Nuke on 4.1
« Reply #8 on: February 18, 2001, 10:58:46 PM »
I have read the FM and I am getting the same error message. Also pointing at line 17. I have tried every combination I can think of and suggestions in the PHP-Nuke forums so don't be so quick to assume that something is not clearly documented in the manual or that e-smith's directory structure is typical.

Brad

Re: PHP-Nuke on 4.1
« Reply #9 on: February 19, 2001, 08:13:52 AM »
The appropriate lines to create the db as cut from the PHP-Nuke manual are:
1) Create a database called, for example, nuke:

    mysqladmin create nuke
   
2) Now fill the databases with the tables in nuke.sql file:

    mysql nuke < nuke.sql

I have also tried the above line to change the root password on the server and put the changes into config.php.

Still no luck...

Noah

Re: PHP-Nuke on 4.1
« Reply #10 on: February 19, 2001, 03:49:37 PM »
Brad wrote:
> Warning: Host 'e-smith.xxxxxxx.peoria1.il.home.com' is not
> allowed to connect to this MySQL server in

I am not familiar with PHPNuke, but this sounds like a problem with how your permissions are setup in MySQL.  In MySQL, both the username and the hostname/address are checked before access is allowed.  Log into MySQL as the root user (mysql -u root) and issue the following Grant statement:

   GRANT ALL on nuke TO user@'e-smith.xxxxxxx.peoria1.il.home.com' IDENTIFIED BY "password";

Where 'nuke' is the name of the PHPNuke database and 'user' is the name of the user PHPNuke runs under (I think this is specified in a PHPNuke config file).  If this does not work, try replacing the host name with the IP address.

Again, I don't know much about PHPNuke, and I have not tried this myself.  Good luck.

Noah

p.s.  Anyone who plans to work with MySQL should check out the MySQL documentation (http://www.mysql.com/doc/).  Make sure to read (and re-read) Chapter 6 -- The MySQL Access Priviledge System.

shadowrex

Re: PHP-Nuke on 4.1
« Reply #11 on: February 19, 2001, 09:02:05 PM »
did you change the password for root in the config.php root's password for mysql is the same as the ldap password.  that password can be found in /etc/openldap/ldap.pw.  the smart thing to do is to create another mysql user to use with nuke because the mysql root account password will change when the ldap password is changed

Jason Miller

Re: PHP-Nuke on 4.1
« Reply #12 on: February 19, 2001, 09:22:26 PM »
It is probably a good idea to create a separate mysql user for php-nuke - but for different reasons than suggested.

Changing the ldap settings should not be overwriting the ldap password - anymore that is, it was a bug in the early 4.1 beta series that was corrected before 4.1 final.

General Advice:

Remember that the mysql root user is much like the linux root user, they have a lot more privileges than most users.  I like to think of it along the lines of this scenario:

- a newly hired webdeveloper is asked to use php-nuke to build the company website.  they need access to the database server for that: you have choice of creating a new user 'nuke' with its own password and privileges only to use the 'nuke' database OR giving them the 'root' password for mysql.

If you give them the root password, suddenly the new worker has full database privileges and can have a peek at the highly sensitive HR/finance data while on their coffee break.  Probably not something you want them to have full privileges to see.

By providing a separate user login/password/database access permissions they can try all they want to see the HR/finance data but it will always return the equivalent of 'permission denied'.

Hope that helps,

Jay

erdius

Try this
« Reply #13 on: February 19, 2001, 11:11:27 PM »
Ok.  Heres all I did to get phpnuke working.  
untar all of the phpnuke stuff into the html directory
Create a mysql user.     --     mysqladmin -u root password mynewpassword
Create a "nuke" database   --   mysqladmin -p create nuke
enter tables etc  --    mysql -p nuke < nuke.sql
chmod all *.php files to 666, all directorys to 777
edit config.php.  enter in localhost, root (for example user), and mysql password.
site should be online at this point.  tell what error messages you get with this process, as it worked just fine (with a fresh 4.1 esmith install) with me.
Are you getting errors entering tables into mysql? can you create the db? user?

Dan Brown

Re: Try this
« Reply #14 on: February 19, 2001, 11:24:38 PM »
erdius wrote:

> Create a mysql user.     --     mysqladmin -u root password
> mynewpassword

    This doesn't create a mysql user; it only changes the password of the existing root user.  There's no good reason to do this, as the root user already has a password set.  It's contained in /root/.my.cnf, so you don't have to enter it when using mysql from the command line.  If you insist on using the root user to access mysql for phpnuke, just make a note of that password and enter it into the config files.

> Create a "nuke" database   --   mysqladmin -p create nuke

    This will work, but you only need the -p if you've changed the root password--see above.  Following this, you really should create a mysql user just for phpnuke, as I (and others) have posted before.  To do this, do:

# mysql
mysql> grant all on nuke.* to nuke@localhost identified by 'nukespassword';

> enter tables etc  --    mysql -p nuke < nuke.sql

    Same comment as above; you shouldn't need the -p

> edit config.php.  enter in localhost, root (for example
> user), and mysql password.

    As above; it's much better to use nuke (or some other limited-purpose mysql user) as the user, and a password just for that user.

Dan Brown

Re: Try this
« Reply #15 on: February 19, 2001, 11:42:55 PM »
Following up to myself...

    I forgot one important step.  After creating the nuke user, you'll need to do one more thing:

# mysqladmin reload

    This will cause MySQL to reload the user tables.  If you don't do this, you won't be able to use the nuke user to access the database.

Tim Litwiller

Re: PHP-Nuke on 4.1
« Reply #16 on: February 20, 2001, 04:34:22 AM »
It looks to me like the whole problem comes from not using localhost as the host machine name in the config.php file for php-nuke.  

Use what ever user you want just be aware that root user has much more access than php-nuke needs so that could create a security issue.

I usually create a user for each of the sites that I host.

keith

Re: PHP-Nuke on 4.1
« Reply #17 on: February 20, 2001, 03:36:32 PM »
Thanks everybody for the above newbie guide to PHP-Nuke.
I now have a working version of this and phpMyAdmin.

Keith

Brandon Friedman

Security Issues
« Reply #18 on: February 20, 2001, 04:04:03 PM »
Hi all
Interesting topic you brought up here. I have for some time been testing a few php/MySQL Apps on my e-smith server... a few things I would like to point out (especially regarding security!)

1) This is more of a question: with regards to installing you tarball into a html directory, are you creating i-bays and then dumping it into there or are you using the primary html directory?

2)'chmod all *.php files to 666, all directorys to 777' is this command safe to run on my directories.... i-bay or primary html...?

3)I have been running both TWIG & phpGroupware - I setup both to run from and i-bay (as described on Tim's web site http://linux.made-to-order.net/article.php ) and from the primary html directory .... I have discussed this setup with the experts (e-smith) and have been warned about security .. they suggest writing an alias url script (or something like that!!) , the same way webmail and the e-smith manager have been setup...?

Well jus thought I would give my 2 cents worth...
Regards
BF

keith

Re: Security Issues
« Reply #19 on: February 20, 2001, 05:43:18 PM »
Brandon Friedman wrote:
>
> Hi all
> Interesting topic you brought up here. I have for some time
> been testing a few php/MySQL Apps on my e-smith server... a
> few things I would like to point out (especially regarding
> security!)
>
> 1) This is more of a question: with regards to installing you
> tarball into a html directory, are you creating i-bays and
> then dumping it into there or are you using the primary html
> directory?

ibays

> 3)I have been running both TWIG & phpGroupware - I setup both
> to run from and i-bay (as described on Tim's web site
> http://linux.made-to-order.net/article.php ) and from
> the primary html directory .... I have discussed this setup
> with the experts (e-smith) and have been warned about
> security

> .. they suggest writing an alias url script (or
> something like that!!) , the same way webmail and the e-smith
> manager have been setup...?

Sounds like a good idea.  How do we do this? is it easy(ish) ;}

Regards

keith

Gordon Rowell

Re: Security Issues
« Reply #20 on: February 21, 2001, 12:10:20 AM »
Brandon Friedman wrote:
> [...]
> 2)'chmod all *.php files to 666, all directorys to 777' is
> this command safe to run on my directories.... i-bay or
> primary html...?
> [...]

I can pretty much guarantee that doing so is unsafe.

On the whole, directories should be 755 (write by owner only) and files should
be 644 (write by owner only). Or even more restrictive, depending on your
application. But 666/777 is almost certainly asking for trouble.

Gordon

Hsing-Foo

Re: Try this
« Reply #21 on: August 15, 2001, 10:55:10 AM »
Hi,

Trying to install php-nuke (post-nuke) i'm encountering the following problem:

Fatal error: Call to undefined function: mysql_connect() in /home/e-smith/files/ibays/intranet/html/mainfile.php on line 66

The root user has a new password to use MySQL so I use -p option with mysql.

With all the suggestions and instructions i'm kind a lost here about what is the 'correct' way to install php-nuke.... I'm afraid I messed up my MySQL installation.

Any ideas?

ps. Can anybody point out the location of the php-sqladmin I keep reading about, so I can examine my MySQL databases. Thanks.

Thanks

Dan Brown

Re: Try this
« Reply #22 on: August 15, 2001, 03:51:26 PM »
That error indicates that MySQL support for PHP isn't installed.  You shouldn't get it on a standard e-smith installation.

guestFF

Re: Try this
« Reply #23 on: August 15, 2001, 08:32:02 PM »
Hmmm, it really is a standard installation of 4.1.2, however I did follow your how-to to upgrade php. (look at your logs and you'll see my visits).

You test.php works fine though..?

Any idea

Thanks

RequestedDeletion

Dan Brown

Re: Try this
« Reply #24 on: August 15, 2001, 09:44:59 PM »
If the test.php works, see if mysql support is indicated there.

guestFF

Re: Try this
« Reply #25 on: August 17, 2001, 09:08:44 AM »
Dan,

How can I tell (What do I look for in the test.php result)

The only time mysql is mentioned is in the block configure command:

--snipp--
shmop=shared' '--with-unixODBC=shared' '--with-mysql=shared,/usr' '--with-ldap=shared' '--with-pgsql=shared' '--with-gettext=shared'
---snapp--

RequestedDeletion

guestHH

Re: Try this
« Reply #26 on: August 17, 2001, 08:24:10 PM »
Dan,

The mysql rpm from your how-to install well, but it seems I do not have mysql support.

Any idea why?

ps. Is there a way to go back to the original state, I was sure it would go well, I installed it on my production machine....

I would like to give it a try on another machine.

Thanks,

guestHH

Dan Brown

Re: Try this
« Reply #27 on: August 17, 2001, 08:40:33 PM »
check /etc/php.ini for a line that says extension=mysql.so

guestFF

Re: Try this
« Reply #28 on: August 18, 2001, 03:22:10 AM »
Dan,

It's there (not commented out with ; )

RequestedDeletion

guestFF

Re: Try this
« Reply #29 on: August 18, 2001, 03:24:59 AM »
btw to all readers,

I realise this is off topic, but I don't know any place else to go with e-smith issues, since it is specific e-smith related.

RequestedDeletion

ps. Yes, I should get more in to MySql and PHP :)

hanscees

Re: Try this
« Reply #30 on: December 13, 2001, 12:40:39 AM »
Following this, you really should create a mysql user just for phpnuke, as I (and others) have posted before. To do this, do:

# mysql
mysql> grant all on nuke.* to nuke@localhost identified by 'nukespassword';

I did this and then mysqladmin reload,
but still the postnuke php scriopt says

'unable to make database'.

I am logged in as root at the console, in a virtual ibay. Should I not first log in as root in mysql or mysqladmin? Are those programs open to anyone or just root? I quess root, but why then can I not make a db?

Perhaps because I use the database Roque? should one of the words in
mysql> grant all on nuke.* to nuke@localhost identified by 'nukespassword';
be Roque then?

hope you can help.

hc

hanscees

Re: Try this
« Reply #31 on: December 13, 2001, 12:43:58 AM »
tried doing
mysql> grant all on Roque.* to nuke@localhost identified by 'nukespassword';

but that does not help either:-(

hanscees

Re: Try this
« Reply #32 on: December 13, 2001, 12:50:49 AM »
hanscees wrote:
>
> tried doing
> mysql> grant all on Roque.* to nuke@localhost identified by
> 'nukespassword';
>
> but that does not help either:-(

damn typo!! IT does!!
sorry for the bandtwidt
hc

J-L Boers

Re: Try this
« Reply #33 on: December 17, 2001, 06:48:15 PM »
I have 2 how-to for postnuke. One for the mutant release on essg 4.1.2/sme 5 and another for the rogue release on sme 5. I will be sending both to documentation@e-smith.com real soon but if you want it, let me know and I'll send you the how-to's.
My site is down for testing at this time. I'm waiting on Mitel to host them :)

J-L
jl AT boers DOT cc