Someone with time to add this? ;)

Goba
--- Begin Message --- re: minor changes to file bsd_apache_mysql_php_install.txt

To: [EMAIL PROTECTED]

It has been brought to my attention that two errors occurred in the file I submitted 08-30-03. These have been changed + I added one name to the special thanks area. If you choose to post these instructions, please use the attached version of the installation instructions.

Sincerely,

Greg Magnusson
[EMAIL PROTECTED]
**************************************************************************
**************************************************************************

Installing Apache-ssl + MySQL + PHP on FreeBSD using the PORTS collection.

by Greg L. Magnusson <[EMAIL PROTECTED]> (c) 08-27-2003
special thanks to
John Brooks <[EMAIL PROTECTED]>
Curtis Petit <address with-held>
Pat Lashley <[EMAIL PROTECTED]>
Francis Clark <address with-held>

  One of the easiest ways to install Apache, MySQL, and PHP on FreeBSD is to compile 
each application from 'source' using the FreeBSD ports system.  The following install 
instructions require the following:

1) that you have root control of a FreeBSD box
2) that you have a FreeBSD box connected to the internet
3) that you have installed the 'ports collection'
4) that you have updated the 'ports collection' via CVsup

  If you have FreeBSD running and installed from cd-rom with a working ethernet card, 
you will need to connect to the internet.  To configure your network connection TYPE 
/stand/sysinstall and choose 'networking' from the list of options.
  This installation requires the ports collection.  If you have not already done so, 
install the 'ports collection'.  An outline of how to install the 'ports collection' 
is described in the FreeBSD handbook.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html

  If you have installed the 'ports collection' using a cd-rom it is going to be 
necessary to upgrade to the latest releases of the ported software you are looking 
for.  If you have just installed the 'ports collection' via ftp, it is okay to skip 
the next step.

Installing CVsup.
Fortunately, FreeBSD makes it extremely easy to stay current.

/*note that TYPE means 'at the root prompt, use your keyboard to enter
the data ad verbatim following the TYPE command */


    TYPE cd /usr/ports/net/cvsup
    TYPE make
    TYPE make install
    TYPE make clean
    TYPE shutdown -r now

When your machine gets back up and running:

  As root, copy /usr/share/examples/cvsup/ports-supfile to a new location, such as 
/root or your home directory.

    TYPE cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile

Edit ports-supfile using your favourite editor.

    TYPE ee ports-supfile

You should change the ports-supfile to look something like this.....

#*********************************************************************
*default host=cvsup.ca.FreeBSD.org.
*default base=/usr
*default prefix=/usr
*default release=cvs
*default delete use-rel-suffix
*default tag=.
src-all
#**********************************************************************

.....pay particular attention to the first line, choosing a CVsup mirror that is close 
to you to save time.  At the very least, try to choose the country that you are in to 
download from.  A list of mirrors can be found here.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#CVSUP-MIRRORS

Now it's time to run cvsup:

    TYPE cvsup -g -L 2 /root/ports-supfile

  This command is going to upgrade all the skeletons of your ports collection.  This 
can take a while.

  Once you get the command prompt back, it is onto the fun part.  Enter these commands 
one at a time, waiting for the command prompt between each instance of TYPE.

Install the PERL language (necessary for MySQL)
1)  TYPE cd /usr/ports/lang/perl
    TYPE make
    TYPE make install
    TYPE make clean

Install MySQL
2)  TYPE cd /usr/ports/databases/mysql40-server
    TYPE make
    TYPE make install 
    TYPE make clean

Install Apache13x+mod_ssl
3)  TYPE cd /usr/ports/www/apache13-modssl
    TYPE make
    TYPE make install
    TYPE make clean

Install PHP
4)  TYPE cd /usr/ports/www/mod_php4
    TYPE make
  Choose your installation preferences.  Notice that the dependent choices have been 
made for you.  Realize that certain options will require licensing fees (eg. PDFlib)
    TYPE make test
    TYPE make install
    TYPE make clean

Congratulations...you have Apache-ssl MySql and PHP installed on your FreeBSD system.

To test this, install a web browser.  I like to use LYNX.
    TYPE cd /usr/ports/www/lynx
    TYPE make
    TYPE make install
    TYPE make clean

TYPE lynx 127.0.0.1
You should be viewing a congratulatory Apache screen.
(Note 'q' gets you out)

Three considerations.
1)  edit the Apache httpd.conf file
    TYPE cd ~
    TYPE ee /usr/local/etc/apache/httpd.conf

Add the following lines anywhere within the Apache httpd.conf file
#***************************************
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .php3s
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#***************************************

Find the line that says 'ServerAdmin' and put your email address there.

2)  create a php test file
    TYPE ee /usr/local/www/data/index.php
Add the following to the file you just opened:

<html>
<head>
<title>PHP test</title>
</head>
<body>
<?php
phpinfo();
?>
</body>
</html>

PRESS 'esc' and save this file.

3)  TEST THIS OUT

    TYPE shutdown -r now

  This will shutdown the machine, the reboot will start Apache and MySQL as daemon 
processes.  When you get the root prompt back
    
    TYPE lynx 127.0.0.1
  
  If this worked, you should be viewing the information about your new PHP-MySQL 
enabled Apache web server.  Congratulations.

See you at the top,
Greg L. Magnusson
[EMAIL PROTECTED]

***************************************************************************
***************************************************************************

--- End Message ---

Reply via email to