VectorLinux
December 21, 2014, 02:19:26 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: How To set up Apache, MySQL and PHP on Vector 5.9 Standard  (Read 6855 times)
LeeDB
Member
*
Posts: 33


« on: August 23, 2008, 07: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
http://www.linuxquestions.org/questions/slackware-14/slackware-guide-for-amp-apache-mysql-and-php-311344/

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
http://slackware.mirrors.tds.net/pub/slackware/slackware-12.0/

create a group called mysql
============
Code:

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)
============
Code:

useradd -g mysql mysql


give user mysql access
============
Code:

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


install a database from user mysql
============
Code:

su - mysql
mysql_install_db
exit


create a my.cnf file
============
Code:

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
============
Code:

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


set a password for mysql root user
============
Code:

/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
============
Code:

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

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.

mysql>

   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
   there.

   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

Code:
==================
LoadModule php5_module usr/lib/httpd/modules/libphp5.so


start apache & php
==============
Code:

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
http://localhost

you should see a website. Good.


next test php
===============
Code:

cd /var/www/htdocs


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

<? 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
===============
Code:

apachectl stop
or

===============
Code:

/etc/rc.d/rc.httpd stop


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

cd /etc/apache2/
pico php.ini


search for mysql
============
Code:

ctrl + w  mysql


uncomment the line ;extension=mysql.so by removing the ';'
============
Code:

extension=mysql.so


restart apache
============
Code:

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, 11:22:42 am by LeeDB » Logged
wcs
Packager
Vectorian
****
Posts: 1144


« Reply #1 on: October 16, 2008, 10: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.
Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3195



« Reply #2 on: October 16, 2008, 11:03:53 am »

Nice howto
Logged

Monty67
Member
*
Posts: 66



« 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.
Logged

Strange women lying in ponds distributing swords is no basis for a system of government.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!