Forum Moderators: travelin cat

Message Too Old, No Replies

Trying to set up Apache Web Server Configuration on MAC

         

tberce

12:44 am on Nov 15, 2003 (gmt 0)

10+ Year Member



I tried to follow the steps from:
[macromedia.com...] but did not understand #4, how to Uncomment...

4.Uncomment the following lines:
LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c

I'm a newbie with the Terminal :)

Is there an easier way... does someone have the script I can just copy and paste into the terminal or ...?

I need your help.
Thanks, wildfire

mivox

1:06 am on Nov 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"Uncommenting" just means to remove the special characters preceeding the line in the script so it becomes 'active'...

In HTML, you 'comment' a line by surrounding it like so:
<!-- commented text here -->

In a Perl script, a 'commented' line would be preceeded by a # character:
# commented line here

In PHP, depending on the section of the script you're commenting, you either preceed a line of text with //:
// commented text here
...or surround a section of code you want to deactivate with /* */:
/* commented data here */

In your case, those lines were 'commented out' because they are not needed in all installations of the server software. So if you do need those lines of code, you 'uncommemnt' them... If you don't need the code, you leave it 'commented' out.

By the way... Welcome to WebmasterWorld! :)

tberce

1:31 am on Nov 15, 2003 (gmt 0)

10+ Year Member



thanks...

So, I've opened the terminal and after my password, typed:
/*LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c*/
-----------
the instructions don't say to press enter ? so I don't, #5 says :
#5.Add the following lines (add these lines above: AddType application/x-tar .tgz):
 
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

***There is no -- AddType application/x-tar .tgz anywhere on the terminal for me to add these lines.

What am I doing wrong?

Here are all of the instructions. Is this right?

1. Launch Terminal from /Applications/Utilities.

2. Open the Apache configuration file and edit the UNIX shell prompt: sudo pico /etc/httpd/httpd.conf.

3. When prompted for a password, enter the Mac OS X administrator account password.
4. Uncomment the following lines:
 
LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c

5Add the following lines (add these lines above: AddType application/x-tar .tgz):
 
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Note: All the commands for the pico editor display on the screen and you can start any commands with the Control key. Use the arrow keys to move around. Pico is a text editor, mostly for UNIX users to use at the UNIX command line. The pico text editor resides in /usr/bin/ directory.

6. Add a new index page for PHP (index.php) so that the web server will recognize it as the first page to load:
 
<IfModule mod_dir.c>
DirectoryIndex index.html index.php index.htm
</IfModule>

7. Save the httpd.conf file by pressing ^X (control + x keys). When the screen asks "Save Modified buffer?", press "Y". When prompted for "File Name to write : httpd.conf", press Return once to accept it. This will return you to the UNIX shell prompt.

Yidaki

1:58 pm on Nov 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>***There is no -- AddType application/x-tar .tgz anywhere
>on the terminal for me to add these lines.

It's not important where exactly you add the additional handlers. Just look for the part where other handlers are specified and put your new handler (AddType application/x-httpd-php .php and AddType application/x-httpd-php-source .phps) there.

(btw, in case you didn't know it: ctrl+W lets you search in a text file in pico.)

Don't forget to restart httpd after changing httpd.conf.

Does it work now?

BjarneDM

7:29 am on Nov 16, 2003 (gmt 0)

10+ Year Member



I'ld suggest going about in quite another way:
Get hold of the Apache2, PHP4, and MySQL you can get from [serverlogistics.com...] And top off with one of the BareBones text-editors - if nothing else then the free BBEdit Lite [barebones.com...] And if you install TinkerTool too you can enable Finder to show you all of the stuff that Apple has chosen to hide in Finder too.

Advantages are :
1) you get out of the terminal. All of the Serverlogistics products are available from the normal Finder as they install in the /Library folder
2) you get newer - and more powerful - versions than what Apple ships
3) there are some really excellent installation instructions