Apache PHP MySQL Setup after Slackware 9.0 Installation
For whatever reasons, Apache, PHP and MySQL are not fully setup for use after an initial Slackware 9.0 installation. Below are some steps that helped me quickly setup all three:
Apache/PHP/MySQL Setup 1. Set Apache to boot at startup: chmod 755 /etc/rc.d/rc.httpd 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 You might want to also add an index.php entry to the DirectoryIndex section as well: # # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. # <IfModule mod_dir.c> DirectoryIndex index.html index.php </IfModule> 3. Set permissions on MySQL files: cd /var/lib chown -R mysql mysql mysql chgrp -R root mysql mysql su mysql #prompt changes from # to $ mysql_install_db safe_mysqld --user=mysql & #hit enter once the db loads exit #prompt changes from $ to # mysqladmin -u root status #verify the database is running 4. Add MySQL to startup scripts:: vi /etc/rc.d/rc.local echo Starting MySQL server: safe_mysqld --user=mysql & sleep 2 Good Luck! mb |
Slack 9 does have some probs yes, here is a bug I found.....
the kernel configurator does not even get installed on my system, and the Bash setup in not complete either. I have a Slack subscription, so I have the 4 CD set. I am gonna put 8.1 back in and just upgrade everything and see how it works.:study: |
Location of Apache on Slackware 9.0
I am trying to install Apache 2.0 on Slackware 9.0... using DevShed's "The Soothingly Seemless Setup of Apache, SSL, MySQL and PHP guide.
What is the location of the default install of Apache in Slackware 9.0? I am looking to install Apache 2.0 in /usr/local per the instructions from the guide mentioned above. The recommended paths are /usr/local/apache /usr/local/mysql /usr/local/ssl Can you uninstall the default installation of Apache, SSL, MySQL and PHP? |
Re: Location of Apache on Slackware 9.0
Quote:
You can add your own index.html file in this directory to test. Quote:
If you follow the directions in my first post, you'll have everything installed and working in 10 minutes. Then you can concentrate on what's important: using these tools! If you really want to uninstall these modules, use the 'pkgtool' command as root and remove the packages. mb |
genius - that setup tip is great thanks
*scribbles it down* |
great tips
thnx |
Personally I never liked how slack installed apache/php/sql from 8.0, so I install them myself from source. :-)
|
That is a good peice of advice. That has been stored away in my collection of priceless documents (HOW-TOs, Guides, etc), in a very secure place. Thanks!
|
htdocs location in default RH9 setup
Hello all,
This is my first thread in this forum, so be gentle. Main problem: Cannot find htdocs folder in my RH9 installation. ----- I am trying to locate the usual html file to replace with my content but for some reason cannot find it! I have viewed /etc/httpd/conf/httpd.conf to see the location of the server is poniting at /var/www/html/, which is empty. I have tested http://localhost in mozilla and everything is ok, but it is wierd that i cannot find the main directories. Is there a generic 'search' terminal command that would get me out of future situations like this? Thanx in advance |
Deanglass,
This forum is for information regarding the 'Slackware' distribution, not RH9. I would suggest posting here: http://www.linuxquestions.org/questions/forumdisplay.php?s=&forumid=5 Thanks. . mb |
A very helpful thread, initself.
I've been having trouble installing and running MySQL since I obtained it a few days ago, until I figured out it actually is installed as a package along with Slackware. Using the few steps you mentioned had the server up and running in less than five minutes. Now I just have to figure out how to upgrade it to the newest version of MySQL - as the one provided with Slackware 9.0 only is 3.23.56. Thanks alot. :study: |
Hi, newcomer to slackware (recent convert from debian), so excuse any lame/obvious questions.
I've tried the method for setting up mysql after installing a fresh copy of slack9, but I appear not to have a mysql dir in /var/lib - seem to have the rest of mysql installed ok. Cheers, |
Full Installation?
Quote:
mb |
Re: Full Installation?
Quote:
initially, /usr/share/mysql/mysql.server start crashed out as /var/lib/mysql/ dir was not found, I have now created the mysql dir in /var/lib, and no longer gives the directory not found error. now when I run the following: # cd /usr ; /usr/bin/safe_mysqld & [1] 1043 I get this: # Starting mysqld daemon with databases from /var/lib/mysql 030730 17:05:06 mysqld ended and mysqld exits straight away (presumably due to finding no databases). Cheers, |
Re: Re: Full Installation?
Quote:
You shouldn't have to create any directories at all. You should just be able to follow my instructions line by line. mb |
Re: Re: Re: Full Installation?
Quote:
|
Re: Apache PHP MySQL Setup after Slackware 9.0 Installation
Quote:
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 |
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, |
Re: Apache PHP MySQL Setup after Slackware 9.0 Installation
Quote:
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 |
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.
|
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 |
Re: Re: Apache PHP MySQL Setup after Slackware 9.0 Installation
Quote:
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 |
Quote:
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 |
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? |
Quote:
For example: http://localhost/kev/test.php Quote:
mb |
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
|
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.)
|
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??? |
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. |
Quote:
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. |
Well I can actually run 'mysqladmin -u root status' without a problem but when I try to do anything else I get the error you get. I havn't been looking at it much yet.
But is there enyone that has had this problem and sorted it out? |
<newb alert - apply pinchOfSalt>
It may help to know that mysql opens a port (quite a high number that I can't remember). This means you can check if it's running (and nothing else) by "nmap localhost". MySQL is not automatically started on reboot ... I haven't looked into how to do this yet but you need to run the "./bin/safe_mysqld" script from your mysql directory to do this manually. For some reason this doesn't work from other directory locations (on my system at least). |
I see that you are trying Slackware, so for this distro edit the /etc/rc.d/rc.local script and add the line "safe_mysqld". This should start it automatically after each reboot.
Luck Figa |
does mysql apache and php all install with slack 9.0? I did the full install... and what i was wonderin was how do you use phpmyadmin? i can't seem to figure this out
|
Quote:
But for such additional, big software packages n those frequently released software packages, I'd prefer to have them on their own directory like kde on /opt/kde, {apply also to netscape, mozilla, ..} for easier for maintaining, upgrading. Maybe later drop them into another CD in later realese .. :D |
Just wondering does these setup tips still apply to Slackware 9.1 or is it all setup when you install it?
Thanks... |
Its all sorted now. It relates to RH9 and was available on installation. Thanx anyway
|
Quote:
*edit* 9.1 users have to use mysqld_safe instead of safe_mysqld |
All times are GMT -5. The time now is 11:20 AM. |