1
spspt
Newbie guide to MySQL-Apache_PHP
  • 2004/10/28 0:25

  • spspt

  • Just popping in

  • Posts: 1

  • Since: 2004/10/28


Hi,

This is a newbie guide to install the necessary components to run a XOOPS box.
It is intended primarily for Slackware 10 but there's no reason why it should not work with other distros. Here goes :)


Mysql
First things first, after installing the package we need to create the default database.
Issue the command: # mysql_install_db

Next we need to set the MySQL daemon password but first try to launch mysql:
Issue the command: #mysqld_safe &
It gives out an error that is to be expected since it's unable to create the sock.
This happens because the package as well as the compile in slackware don't generate all the necessary permissions. In the case of the compile process it even fails to create some of the necessary directories.

To correct the permissions issue the command:
chown -R mysql.mysql /var/lib/mysql

Let's try and execute MySQL again:
mysqld_safe &

If all goes well you should have successfully launched mysql
Let's change the MySQL daemon password (this is the password you’ll use to connect to MySQL in XOOPS setup):
#mysqladmin -u root password (your password here)

* Lets try logging in to mysql, if a prompt MySQL appears you're home free:
#mysql -u root -p

Apache
Next, let's compile apache, the following command enables modular loading of components to the Apache web server, issue the command inside the uncompressed directory created from the source code:
./configure --enable-module=so --enable-rule=SHARED_CORE

Next issue the command:
# make && make install

That's it. Apache is now installed and ready to go :)
Try it out with: #apachectl start
Point your browser to the localhost, you should see the default web page


PHP
The final piece of the puzzle, the php scripting language.
Let's compile the source with support for apache 2 and mysql, issue the command inside the uncompressed directory created from the source code:
#./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
What this does that’s essential to php/apache is to insert the load module php with the correct path into the apache configuration file (httpd.conf).

Next we need to issue the command:
#cp php.ini-dist /usr/local/lib/php.ini
This puts the .ini file with the right configuration on the right place :)

The final piece of the puzzle is to add the necessary changes to the init apache file, the ‘httpd.conf’.
Inside the httpd.conf locate the Addtype section and insert these 2 lines:
AddType application/x-httpd-php .php .phtml .inc
AddType application/x-httpd-php-source .phps

-this tells the apache server to supply these x-application to the browsers, so they know how to Interpret the site.
Just out of curiosity the second line is the one that makes it compatible with Firefox :)

Last but not least we need to tell apache to look for home pages with php extensions.
Locate the line ‘DirectoryIndex’ and replace it with the one bellow:
DirectoryIndex index.html index.html.var index.php index.phtml index.inc

Save the changes to httpd.conf
Relaunch apache with the command:
#apachectl restart

Assuming you already copied the XOOPS html dir to the document root dir of apache and renamed it to xoops. Point your browser to localhost/xoops and voila, you should see the XOOPS config screen :)

Hope this has been helpful. This is my no means new or something that I discovered.
This is simply a guide with stuff that really works taken from a gazillion support docs and forum posts made by some pretty cool guys.
Have fun with your new XOOPS box. It is truly an amazing software.

Login

Who's Online

148 user(s) are online (92 user(s) are browsing Support Forums)


Members: 0


Guests: 148


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits