Please login or register.

Login with username, password and session length
Advanced search  


Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: How To set up Apache, MySQL and PHP on Vector 5.9 Standard  (Read 12893 times)


  • Member
  • *
  • Posts: 33
How To set up Apache, MySQL and PHP on Vector 5.9 Standard
« on: August 23, 2008, 08:59:58 pm »

Need to set up a web server with MySQL and PHP support?  That's exactly what I needed to do when I
decided to create a photo gallery using the gallery2 open source software package.  Prior to using VL, I actually did the equivalent in Windows using gallery2 and the wamp open source package.  However, using VL lets me dedicate an old PIII-800 to web server duties with VL running nicely on the Pentium III.

Below is how I got  AMP (Apache, MySQL, and PHP) up and running under VectorLinux 5.9 Gold Standard.

This information is based on the Slackware guide for AMP at

First I Installed httpd, MySQL, and PHP using GSLAPT

httpd was 2.2.8-i486-1_slack12.0.tgz
mysql was 5.051-i486-1_slack12.0.tgz
php was 5.2.6-i486-1_slack12.0.tgz

all 3 came from from

create a group called mysql

groupadd mysql

create user mysql (if doesn't exist.. to see if it does,
type su - mysql).
If it says "Unknown id: mysql" then that user does not exist.
(note: this user was alrady present in my system)

useradd -g mysql mysql

give user mysql access

chown -R mysql.mysql /var/lib/mysql

install a database from user mysql

su - mysql

create a my.cnf file

cp /etc/my-medium.cnf /etc/my.cnf

keep the socket in /var/run/mysql/, its more secure than /tmp
don't modify anything else

start mysql

chmod +x /etc/rc.d/rc.mysqld
su - mysql
/etc/rc.d/rc.mysqld start

set a password for mysql root user

/usr/bin/mysqladmin -u root password 'new-password'

Download mysqlcc 0.9.8 from sourceforge and compile it per
the instructions that come with it.

run mysqlcc

cd mysqlcc-0.9.8-src/ (had this directory inside my home - the location mysqlcc was compiled in)

file > new
name: mylocalmysql
hostname: localhost
user: root
password: **********
socket file: /var/run/mysql/mysql.sock

click on test, it should be successful

If you need to create a database for a specific application,
such as gallery2, then do the following:
su - mysql                       (using mysql user at this point)
mysql -h localhost -u root -p    (connect to mysql server)
   Then enter your mysql root password when promted

   Then you will see somethinglike the following:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.51-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


   At the mysql prompt above, type SHOW DATABASES; including
   the semicolon to see what databases are already present
   and to make sure the one you want to create is not already

   next at the mysql prompt, type CREATE DATABASE gallery2;
   (or whatever your new database is)
   SHOW DATABASES; will show the newly created database
   in the list.

   quit at the mysql> prompt will drop the connection
   exit will then exit out of the mysql user

configure php
edit httpd.conf and make sure this line is at the
bottom of the file

Include /etc/httpd/mod_php.conf

edit mod_php.conf
make sure the line looks similar to this

LoadModule php5_module usr/lib/httpd/modules/

start apache & php

cd /etc/rc.d
./rc.httpd start

(had to right click rc.httpd in Thunar running
as root and make the file executable first)

When started, go to your web browser, and go to

you should see a website. Good.

next test php

cd /var/www/htdocs

create a file called test.php and add the following to it

<? phpinfo(); ?>

You should now be able to see all the php configurations.
If you search for mysql, you won't find it.
Let us link mysql to apache and php now.

stop apache

apachectl stop


/etc/rc.d/rc.httpd stop

go back to /etc/apache2, and edit php.ini

cd /etc/apache2/
pico php.ini

search for mysql

ctrl + w  mysql

uncomment the line ; by removing the ';'

restart apache

apachectl start

refresh the http://localhost/test.php
and search for mysql
now you will find it halfway through the webpage.

Congratulations... =)
« Last Edit: August 24, 2008, 12:22:42 pm by LeeDB »


  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: How To set up Apache, MySQL and PHP on Vector 5.9 Standard
« Reply #1 on: October 16, 2008, 11:04:17 am »

I have uploaded a vector php package that I needed for something else....
I don't know if it's properly configured, but it might suffice, and I guess it's best than getting packages from outside the repo.
Give it a try, if you can.


  • Administrator
  • Vectorian
  • *****
  • Posts: 3497
Re: How To set up Apache, MySQL and PHP on Vector 5.9 Standard
« Reply #2 on: October 16, 2008, 12:03:53 pm »

Nice howto


  • Member
  • *
  • Posts: 66
Re: How To set up Apache, MySQL and PHP on Vector 5.9 Standard
« Reply #3 on: December 08, 2008, 05:42:26 pm »

I'm not against command line stuff but PHPMyAdmin is such a time and effort saver. Did you by chance install it? If so I would love to see how it's done.
Strange women lying in ponds distributing swords is no basis for a system of government.