Total Media Source brings customers to your web site

>> Setting up Mac OS X Panther as a web server
with Apache, PHP, MYSQL, PHPMySQL & AMFPHP

Setting up Apache on Mac OS X

Installing MySQL on Mac OS X

Installing AMFPHP (Fleash Remoting) on Mac OS X

Installing phpMyAdmin to manage MySQL database on Mac OS X

A Guide to Setting up VNC on Mac OS X Panther
"Working on your computer remotely"

This is my first time of posting some of my learning, so if you see anything at all that could be improved please e-mail your comments to: contact@TotalMediaSource.com

Thank you, Daryl Urig

>> Setting up Apache web server and PHP on Mac OS X Panther


Click your Apple Menu, choose "System Preferences," then select "Services" tab than "Personal Web Sharing", Start.



With Personal web sharing selected it will show you the computers web site address and personal web site address at the bottom of window.

Typing in either will give you a working web page to see that Apache is up and running. We will focus on only the computer web page for this tutorial.

Then select the Firewall tab at top and select "Personal Web Sharing" start to protect your files.

Close the “Sharing” window.

The default folder that your new site will be located in is:
Hard Drive/Library/WebServer/Documents

Let’s create a php page called index.php
To start take everything in the documents folder and pace it in a sub folder called “Apache Orig Stuff”, just in case you want to refer back to it at a later time.

Now open up Dreamweaver, create a new page, select and delete everything and paste this in:

<html><body>
    <h1>Gleefully Served By Mac OS X</h1>
    <? phpinfo()?>
</body></html>

Save the file as index.php in directory:
Hard Drive/Library/WebServer/Documents

This is the new page that will come up once we get php running.

To get php running we are going to edit a config file in Apache.

So  Double click on your hard drive, Applications, Utilities, then Launch the “Terminal” program.
This was new to me. It gives you the familiar command line prompts you may have seen on PC.
Anyways, choose file, new command line, which gives you a window and type this in exactly:

httpd –V



If you look down it shows you some information and location of your your configuration file we discussed.
_D  SERVER_CONFIG_FILE=”/etc/httpd/httpd.config”



But these are hidden files, that you  can not see in the normal Mac interface.

Again create a “New Command” and type in”

sudo pico /etc/httpd/httpd.conf



Hit enter, It will ask for your user password, so type it in, but as you type it does not show you anything, so just believe then hit enter.

Now you are inside the configuration file. You will need to use your arrow buttons to move around, no scrolling here. The short cut keys you can view at the bottom. This mark is short for Control: ^ So all of your commands are control a letter not command or apple.



Down arrow down until you see these two lines of code. They are not right together but very close to each other:

# AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps



And remove the “#” symbol before each line to make both lines active. Use ^D to delete anything that is under the cursor. This may already be removed by default. If not please remove them.

These Lines also need to have the # sign removed before them to activate these lines of code:

LoadModule php4_module
AddModule mod_php4.c

You can use the "Where Is" function (^W) and type out "php4_module" and "mod_php4" to leap to the respective lines, which is a very nice find function.

Now you want to save the file. So ^O, which is Control 0, and in the black area it is telling you it will save over your original config file, and you think you would hit ^T, which is to file, but you do not, you hit “Return”. Just a few minor nuances.

Your file is saved now. Go back to your "Personal Web Sharing" that we discussed earlier, and turn it off then back on to restart your Apache server with PHP now running.

If you go to your browser and type in your computers web site address that we discussed earlier, and wala, it should bring up your index.php page. If you did not remove the other stuff it may bring up the other index.html page instead.

Now your running PHP on Apache Web Server on MAC

It may also be a good idea to set your default page to include your php as follows:

DirectoryIndex index.html index.php



Future Learning:
Good link to setting up multiple web sites, see the third approach:
http://www.macdevcenter.com/pub/a/mac/2003/05/16/web_files.html

Special thanks to:
Rory Francis of COMMUG user Group
and also Kevin Hemenway articles at macdevcenter.com

Daryl Urig
Total Media Source
contact@TotalMediaSource.com



NEXT >>


 

       

 

 


Created and Hosted by TotalMediaSource.com ©2003 all rights reserved