Click to See Complete Forum and Search --> : Instaling Apache from Slackware pagkage
sleepingbear
12-23-2003, 11:52 AM
Hello all,
When installing Slackware 9.1, it was with the idea that I would eventually have Apache, PHP and mySQL working so that I could construct my own online database (geneology). At the part where asked what packages I wanted installed from the CD, I selected:
apache-1.3.28-i486-2
mysql-4.0.15a-i486-1
php-4.3.3-i486-2
After reading reams of info on apache and mysql, I'm starting to think that I'm going to have to do something else to install/configure them. Do I still have to do the configure, make, make install routine as with binaries? Should I delete and reinstall the packages one by one? In what order do I install them?
If doing all three doesn't go well, my lesser goal is to just get Apache working.
Thanks for your time... SB
No, when you install a package for your system (rpm, dev, slackpack, etc) you avoid having to compile it, that's the idea.
They were compiled and built into these packages.
sleepingbear
12-23-2003, 12:45 PM
Thanks serz!
okay, that's what I thought. According to pkgtool, these three are installed. How do I test each? I'm not familiar with where Slackware would put the bin files for each. Also, what/where are the config files?
Run pkgtool, select "View" and check these packages.
Config files:
Apache uses httpd.conf
PHP uses php.ini I think
sleepingbear
12-23-2003, 01:58 PM
ok... did some rooting around (pun intended)...
found /etc/rc.d/rc.httpd
as per the instructions therein, i made this executable.
Then ran: #./rc.httpd start
Still not sure how to test this. will this work?: point browser to http://(my box ip address)
Also, found /etc/apache/php.ini
reading this now
JamminJoeyB
12-23-2003, 02:15 PM
http://localhost
Should be pretty much what you need to check to see if apache is up and running.
Also ps -A will list all the processes you have running.
sleepingbear
12-23-2003, 06:29 PM
Tried "http://(myipaddress)" and I got the generic Apache page. Looks like Apache works. What code can I add to an HTML file that will test the PHP?
j79zlr
12-24-2003, 02:11 AM
you probably will have to copy a my.cnf file from the mysql docs to /etc to get mysql to function, and to use php you might have to add it to httpd.conf in the modules section
LoadModule php4_module libexec/apache/libphp4.so
and add these
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
voidinit
12-24-2003, 05:22 AM
LAMP systems are fun, powerful, and really exciting to set up. Here is my advice on LAMP over Slackware.
If you are new, and reading a How-To, and going step by step. Read the entire How-To, cover to cover, then uninstall whatever packages the How-To suggests you compile from source. Then, while reading the How-To again, complete the How-To cover to cover, compiling from source as needed. Not only will this ensure the success of your project (If and only If the How-To is well Written), but it will give you valuable experience in aquiring sources and compiling them, plus (hopefully) you will have the latest and greatest of everything that you installed.
If you are advanced enough to read a how-to and map files that need to be edited to the files present on your distro without uninstalling packages and recompiling then go for it! At this stage there isn't much trouble you can get yourself into that you can't get yourself out of.
Secondly I highly suggest that any LAMP system check out the OWL project hosted by sourceforge. I use this for an amazing amount of stuff that I just can't afford have in an 'unavailble' state, much less loose. Once you have LAMP up and running throw this up and I'm sure you won't be sorry.
sleepingbear
12-24-2003, 12:18 PM
I did a bit more research. this is what I'm using to test PHP:
<?php
print ("PHP works!");
?>
I saved the above in the body of a normal html coded file called test.php
Didn't work.
Thanks j79zlr,
ok... I was able to find the two "AddType" lines. Should I add the "LoadModule" to the bottom of the list of like entries? will try a few things & post my results...
I'll work on mySQL once PHP works.
hey voidinit. thanks for replying. um, what does LAMP do?
Remember that you have to restart Apache anytime you change the configuration files.
sleepingbear
12-24-2003, 08:18 PM
uncommented in httpd.conf:
Include /etc/apache/mod_php.conf
stoped, started apache, reloaded test page and VOILA! it now appears to work.
Up next... mySQL. (after putting away laundry & wraping presents).
sleepingbear
12-30-2003, 02:12 AM
ok... thanks goes to those who have been patient.
I found a reasonable test for MySQL:
<?php
phpinfo();
?>
This apparently gives quite a lot of info. Apparently, if MySQL is configured properly, it has a header right at the top of the page. Mine, sadly, does not.
I was able to run mysql_install_db
root@Beechtree:/usr/bin# mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
031226 11:39:49 /usr/libexec/mysqld: Shutdown Complete
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h Beechtree password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
root@Beechtree:/usr/bin# /usr/bin/mysqld_safe &
[1] 622
root@Beechtree:/usr/bin# Starting mysqld daemon with databases from /var/lib/mysql
031230 00:58:22 mysqld ended
[1]+ Done /usr/bin/mysqld_safe
root@Beechtree:/usr/bin# /usr/bin/mysqladmin -u root password 'newpswd'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
root@Beechtree:/usr/bin#
Ok, it's 1AM. And I'm at a loss to explain what I'm doing wrong. I try to start MySQL by typing "safe_mysqld" (see above) and "/usr/bin/mysql.server.start". The second one states that the command doesn't exist. Also, /var/run/mysql/ is empty.
j79zlr
12-30-2003, 02:24 AM
You need a my.cnf file in /etc
There should be some sample ones in your mysql directory.
sleepingbear
12-30-2003, 03:17 AM
ok... found the smaple fles in /etc/
copied my-medium.cnf to /etc/as my.cnf
rebooted... still nuthin.
also tried:
root@Beechtree:/usr/share/mysql# ./mysql.server start
root@Beechtree:/usr/share/mysql# Starting mysqld daemon with databases from /var/lib/mysql
031230 02:17:12 mysqld ended
root@Beechtree:/usr/share/mysql#
Do I have to tweak the my.cnf file?
sleepingbear
12-31-2003, 01:09 AM
ok. got /etc/my.cnf
ran /usr/bin/mysql_install_db (see prev post)
then tried the two following attempts to turn the server on:
root@Beechtree:/usr/bin# mysqld_safe &
[1] 315
root@Beechtree:/usr/bin# Starting mysqld daemon with databases from /var/lib/mysql
031230 23:56:33 mysqld ended
(just hangs had to hit enter)
[1]+ Done mysqld_safe
root@Beechtree:/usr/bin# /usr/share/mysql/mysql.server start
root@Beechtree:/usr/bin# Starting mysqld daemon with databases from /var/lib/mysql
031230 23:59:08 mysqld ended
(just hangs had to hit enter)
root@Beechtree:/usr/bin#
my phpinfo(); test page can be found HERE (http://Beechtree.ajax.phub.net.cable.rogers.com/test2.php)
Any other suggestions? Please? Any would be greatly appreciated!
sleepingbear
12-31-2003, 11:25 PM
I was just poking around when I stumbled across this nugget:
Jerry@Beechtree:/usr/libexec$ mysqld
031231 22:10:30 Can't start server : Bind on unix socket: Permission denied
031231 22:10:30 Do you already have another mysqld server running on socket: /var/run/mysql/mysql.sock ?
031231 22:10:30 Aborting
031231 22:10:30 mysqld: Shutdown Complete
Jerry@Beechtree:/usr/libexec$ ls -la /var/run/mysql/
total 8
drwxr-xr-x 2 mysql mysql 4096 Dec 30 23:59 ./
drwxr-xr-x 5 root root 4096 Dec 31 13:27 ../
Jerry@Beechtree:/usr/libexec$
sleepingbear
01-17-2004, 10:21 PM
UPDATE:
After a load of investigating, I was able to find the mysql log:
/var/lib/mysql/Beechtree.err (Beechtree is the name of my host)
Every time I tried mysqld_safe, it listed the following in the log:
031229 23:51:08 InnoDB: Started
031229 23:51:08 Fatal error: Can't open privilege tables: Can't find file: './m
ysql/host.frm' (errno: 13)
031229 23:51:08 Aborting
031229 23:51:08 InnoDB: Starting shutdown...
031229 23:51:10 InnoDB: Shutdown completed
031229 23:51:10 /usr/libexec/mysqld: Shutdown Complete
031229 23:51:10 mysqld ended
After searching on www.google.ca/linux I found the following procedure:
# chown -R mysql.mysql /var/lib/mysql
# su mysql
$ mysql_install_db
$ mysqld_safe &
Apparently, starting mysql should be done by the mysql user. I verified that mysql is indeed running: mysqladmin version.
So far, so good. I do have one other trivial problem but I'll put it in another thread.