LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 07-30-2003, 06:01 PM   #16
woodsta
LQ Newbie
 
Registered: Jul 2003
Location: London
Distribution: slackware
Posts: 5

Rep: Reputation: 0
Re: Re: Re: Full Installation?


Quote:
Originally posted by initself
If you are just starting out with your installation, I would try it again from the start and make sure you install every package.
mb
Thanks, I'll give it a go, not much hassle as I haven't set much up on it yet. Thanks again for the help.
 
Old 07-30-2003, 10:10 PM   #17
figadiablo
Member
 
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Rep: Reputation: 30
Re: Apache PHP MySQL Setup after Slackware 9.0 Installation

Quote:
Originally posted by initself
3. Set permissions on MySQL files:

# cd /var/lib
# chown -R mysql mysql mysql
# chgrp -R root mysql mysql
# su mysql
$ mysql_install_db
$ safe_mysqld --user=mysql & [hit enter once the db loads]
$ exit
# mysqladmin -u root status [verify the database is running]

Right on the money, thanks.
It just so happened that today I tried Mysql on Slack 9 for the first time. Did a search and the first return that I got back was this one. Right On!!

Figa
 
Old 07-31-2003, 01:51 PM   #18
woodsta
LQ Newbie
 
Registered: Jul 2003
Location: London
Distribution: slackware
Posts: 5

Rep: Reputation: 0
just had a thought...I have /var mounted on a different drive to the root, would this cause problems with sql setting up its var directory? I mounted it in slackware setup before installing - are there any properties of /var that make it unsuitable for locating on a different drive to the root? if so I'll keep var on root and move something else to the other drive on setup... apologies if this is verging on the off-topic

cheers,
 
Old 08-07-2003, 07:28 PM   #19
ne21
Member
 
Registered: Jun 2003
Location: Somewhere in Middle America
Distribution: Slackware 10, XandrOS
Posts: 61

Rep: Reputation: 15
Re: Apache PHP MySQL Setup after Slackware 9.0 Installation

Quote:

2. Add PHP support to httpd.conf:

LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
I have a question about this part of the install...in the httpd.conf...is there a specific location in the file you do this? Do you have to add the LoadModule part in the section where all the other modules are loaded and place the others elsewhere? Or can you just add this section to any other location? (Getting ready to install phpNuke so this is pretty important.)

Also, you mentioned that you need to add the apachectl to the rc.local to make apache run at boot time...an easier way to do that is to simply chmod 755 /etc/rc.d/rc.httpd
 
Old 08-07-2003, 09:34 PM   #20
BigBadPenguin
Member
 
Registered: Jun 2003
Location: Warwick (.ac.uk)
Distribution: Arch, Slackware 9.0, (knoppix standing by)
Posts: 256

Rep: Reputation: 30
good call on the rc.httpd, otherwise this post was excellent (shame i just saw it after struggling to install apache on this comp...) As far as adding php to httpd.conf goes, it should just be a matter of uncommenting lines that are already there, so search for them and you'll be sure the lines are in the right place.
 
Old 08-08-2003, 07:57 AM   #21
pbhj
Member
 
Registered: Dec 2002
Location: UK
Distribution: Slackware 12; Ubuntu 7.10
Posts: 358

Rep: Reputation: 31
Woodsta,

If you're installing mysql I think you'll need a flag to tell ./configure the location (if it's anything other than under /usr/local/mysql - the default).

Also the problems you described (from what I've experienced) are due to access rights on the databases. Mysql needs an access rights database to be created (by the ./scripts/mysql_install_db script, or is it just install_db?).

The README / INSTALL in the tarball IIRC gives details about the install procedure and how to create a mysql user in a mysql group and set the relevant access rights for the /mysql directory and /mysql/data directory. It's pretty similar to what Initself said.

Knock yourself out ... now if I could only get php to work properly!

pbhj
 
Old 08-08-2003, 11:14 AM   #22
initself
Member
 
Registered: Feb 2003
Location: Lake Forest, CA
Distribution: Slackware 10.2, Ubuntu 6.06 LTS
Posts: 38

Original Poster
Rep: Reputation: 16
Re: Re: Apache PHP MySQL Setup after Slackware 9.0 Installation

Quote:
Originally posted by ne21
[B]I have a question about this part of the install...in the httpd.conf...is there a specific location in the file you do this? Do you have to add the LoadModule part in the section where all the other modules are loaded and place the others elsewhere? Or can you just add this section to any other location?
Actually I don't believe there is a specific location in the httpd.conf file but I would recommend adding those codes to sections with similar code. I updated the tip:

2. Add PHP support to httpd.conf:

#vi /etc/apache/httpd.conf - add the following to sections containing similar code:

LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
 
Old 08-08-2003, 11:20 AM   #23
initself
Member
 
Registered: Feb 2003
Location: Lake Forest, CA
Distribution: Slackware 10.2, Ubuntu 6.06 LTS
Posts: 38

Original Poster
Rep: Reputation: 16
Quote:
Originally posted by BigBadPenguin
good call on the rc.httpd, otherwise this post was excellent (shame i just saw it after struggling to install apache on this comp...) As far as adding php to httpd.conf goes, it should just be a matter of uncommenting lines that are already there, so search for them and you'll be sure the lines are in the right place.
I updated the first tip as well:

1. Add Apache to startup scripts:

# vi /etc/rc.d/rc.local
echo Starting Apache server:
apachectl start

An alternative solution to make Apache start automatically on boot: chmod 755 /etc/rc.d/rc.httpd

There's more than one way to do it!

mb
 
Old 08-10-2003, 02:09 PM   #24
KevB
Member
 
Registered: Jun 2003
Location: UK
Distribution: Debian (Woody)
Posts: 41

Rep: Reputation: 15
Thanks very much for these instructions, but I have a problem I wonder if anyone else has?

I'm using the full install of Slackware 9 and followed all the instructions in this post. I have apache & mysql up and running and PHP appears to work as the the phpinfo() function works correctly.

My problem happens when I try to access my public_html directory under my home directory. When I visit:

http://localhost/~kev

I get a directory listing and not the index.htm as I would expect.

And my other problem is when using an HTML page with a form that posts data to a PHP file, when I try to Post I get:

405 Method not allowed
The requested method POST is not allowed for the URL /~kev/search.html

Can anyone please help me with this?
 
Old 08-10-2003, 02:18 PM   #25
initself
Member
 
Registered: Feb 2003
Location: Lake Forest, CA
Distribution: Slackware 10.2, Ubuntu 6.06 LTS
Posts: 38

Original Poster
Rep: Reputation: 16
Quote:
Originally posted by KevB
My problem happens when I try to access my public_html directory under my home directory. When I visit:

http://localhost/~kev

I get a directory listing and not the index.htm as I would expect.
The URL you are using assumes you have a directory called '~kev' added to /var/www/htdocs. You probably don't have that directory in there so you are probably getting a blank index. With Apache running, typing localhost into your browser is going to run the index.html file located in /var/www/htdocs. So you need to either edit that file or tell type a URL with a specific file or directory that you create there.

For example: http://localhost/kev/test.php
Quote:
And my other problem is when using an HTML page with a form that posts data to a PHP file, when I try to Post I get:

405 Method not allowed
The requested method POST is not allowed for the URL /~kev/search.html

Can anyone please help me with this? [/B]
Again, sounds like a problem regarding creating the proper dirctory and file in /var/www/htdocs.

mb
 
Old 08-10-2003, 05:39 PM   #26
ne21
Member
 
Registered: Jun 2003
Location: Somewhere in Middle America
Distribution: Slackware 10, XandrOS
Posts: 61

Rep: Reputation: 15
Also, if you get that error and you do in fact have the directory called ~kev make sure it is chmod at least 755 or it will likely not execute. Also, did you edit your httpd.conf file to tell Apache to accept .htm files? By default, Apache only translates .html files
 
Old 08-10-2003, 08:21 PM   #27
BigBadPenguin
Member
 
Registered: Jun 2003
Location: Warwick (.ac.uk)
Distribution: Arch, Slackware 9.0, (knoppix standing by)
Posts: 256

Rep: Reputation: 30
If you're using php, you probably want acceptance for php files too. The line you're looking for is "DirectoryIndex index.html... " just add index.htm and index.php and you're set. (well, with that problem anyway.)
 
Old 08-14-2003, 02:06 PM   #28
KevB
Member
 
Registered: Jun 2003
Location: UK
Distribution: Debian (Woody)
Posts: 41

Rep: Reputation: 15
Thanks for the posts guys, but none of them help me. I'm using a users directory, which is correctly setup, if anyone didn't know you create a directoy called public_html in the users home dir and then access it by:

http://localhost/~username

I've tried my php files in that folder and also in the default document root and both won't allow posting of forms.

Has anyone managed to get this working from a fresh install of Slackware 9???
 
Old 08-17-2003, 04:17 AM   #29
Shah
LQ Newbie
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Red Hat, Fefora, Mandrake, Cygwin
Posts: 13

Rep: Reputation: 0
KevB

Yes I have managed to get it working.
Thanks for your post because I just started using the public_html folder.

I don't think I can help you about posting forms, but if you are saying you can't view the page, try sorting out the permissions.

For directories I usually just give execution rights (chmod 771) so that no one can see the folder through their browsers. And for files I give read rights (chmod 774) just to allow the files to be viewed in the browsers.

To view it I use the url: http://myhostname.com/~shah/phpfile.php

If you don't specifiy the file then the default index.html will load that is if you have one. If you don't then obviously either your dir is shown or forbidden to access.

Hopefully my newbie knowledge of php,apache helps.
 
Old 08-17-2003, 04:16 PM   #30
jaeger2345
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Rep: Reputation: 0
Question

Quote:
3. Set permissions on MySQL files:

# cd /var/lib
# chown -R mysql mysql mysql
# chgrp -R root mysql mysql
# su mysql
$ mysql_install_db
$ safe_mysqld --user=mysql & [hit enter once the db loads]
$ exit
# mysqladmin -u root status [verify the database is running]
Using slack-9.0. Only trying to get mysql going; don't care about php or apache, but this bit should work even so, right?

I did all that, and it goes fine through (as user mysql) safe_mysqld --user=/mysql &

Then:
root@brightstar:/var/lib# mysqladmin -u root status
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

I've tried giving it a password (using -p), I've tried using mysqladmin as mysql, I still get "Access denied".

As mysql, run 'mysqlshow mysql' --> Access denied.

From the VERY little I understand, mysqladmin is what should allow me to allow other users to connect and create databases. But, if I can't run mysqladmin ... ??!

This is after having installed mysql when I first upgraded to 9.0; I tried upgrading to 4.0 with a package from LinuxPackages.net, but got the same basic problem. Removed that package, made sure /var/lib/mysql was deleted, re-installed 3.23.56 from slack-current.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 10.2 + Mysql + Apache + PHP + Tomcat Black187 Slackware 5 11-16-2005 08:11 AM
PHP/MySQL and Apache server setup nenyo Linux - Software 7 02-12-2005 02:48 PM
Apache/PHP/MySQL Setup Help jobless_joe Linux - Software 2 05-30-2004 02:55 PM
Slackware 9.0 / MySQL /PHP/Apache ..? MikeFoo1 Linux - Newbie 2 05-04-2004 12:49 AM
Installation Tutorial Apache 2, PHP 4, MySQL 3.23 freddymio Programming 2 07-03-2002 10:40 AM


All times are GMT -5. The time now is 11:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration