...

View Full Version : [fixed] Server problems from apache on Mac OS X



redhead
03-30-2005, 10:56 PM
Hello everyone,

I finally got myself a Mac Mini last week and figured out how to use OS X much faster than I expected! I worked out how to turn on the pre-installed Apache server today, which works fine when going to http://localhost/~jon which is apparently my user home directory. It lists the directories in my Sites folder, which is just fine. So I click into my "clients" folder, and then into a folder in the clients folder, and at that point I'm greeted with a Forbidden page:
You don't have permission to access /~jon/clients/knuci/ on this server

Any idea how to change these folder permissions so I can view these folders? Because it doesnt seem to make it obvious. Any ideas?

Thanks everyone, let me know if you think you can help! :)

JamieR
03-30-2005, 11:47 PM
You usually get that from CHMOD errors, however I've never used Apache locally so I don't really know if would be that to blame.

redhead
03-31-2005, 12:02 AM
Ah ha! 'Tis fixed, found how to set my whole clients folder to be accessible in the end. I had thought that there was a PHP interperator bundled in, but it appears that my PHP is very much not being interperated, so I'll have to try and install that as well.

redhead
04-01-2005, 12:15 AM
Hmmm, well I've installed PHP now (which works fine) and tried to install mySQL, it said it installed ok but cant get any scripts to connect to it, and I dont actually know how to set up a user, database or table on there without any interface for it (like phpMyAdmin if you get my drift).

phpinfo() gives me the following information regarding mysql:


mysql

MySQL Support
enabled

Active Persistent Links
0

Active Links
0

Client API version
4.1.3-beta

MYSQL_MODULE_TYPE
external

MYSQL_SOCKET
/tmp/mysql.sock

MYSQL_INCLUDE
-I/Users/marc/svn/entropy/php-module/src/mysql-standard-4.1.3-beta-apple-darwin7.4.0-powerpc/include

MYSQL_LIBS
-L/Users/marc/svn/entropy/php-module/src/mysql-standard-4.1.3-beta-apple-darwin7.4.0-powerpc/lib -lmysqlclient



Directive
Local Value
Master Value

mysql.allow_persistent
On
On

mysql.connect_timeout
60
60

mysql.default_host
no value
no value

mysql.default_password
no value
no value

mysql.default_port
no value
no value

mysql.default_socket
no value
no value

mysql.default_user
no value
no value

mysql.max_links
Unlimited
Unlimited

mysql.max_persistent
Unlimited
Unlimited

mysql.trace_mode
Off
OffAny ideas how I can set up mySQL properly? If there is a link, other topic or a helpful google or whatever that I've missed then point me in it's direction. Thanks again :o

JamieR
04-01-2005, 12:20 AM
I would think that you'd need to download phpmyadmin to administer MySQL - its free after all, so nothing to loose:D

redhead
04-01-2005, 12:23 AM
Yep I have done, I've set the host to localhost, user to root and left the password clear and it says "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)" so I guess this is down to my own mistake in configuring it? Hmmm I'm kinda clueless to be honest, cheers for your suggestion though weazel. Any ideas?

redhead
04-01-2005, 10:50 PM
w00t, just for anyone's information if this thread gets searched up anywhen, mysql is running ok now :) Just had to type some commands into Terminal and it seems to be working.

JamieR
04-01-2005, 11:13 PM
ah nice:) Glad it worked out. I'm gonna be installing a WAMP (Windows, Apache, MySQL, PHP) on a box I have here soon...I'd like to hear all the problems people have with it.

~Jamie.

squirellplaying
04-01-2005, 11:49 PM
WAMP (Windows, Apache, MySQL, Linux).
Haha. Perhaps windows, apache, mysql, php?

JamieR
04-02-2005, 12:05 AM
Yeh thats it......god me thinking of Linux (I can't choose between Windoze and Linux, however I think I'll do a dual boot system:p) -

lets get it right:

WAMP - Windows, Apache, MySQL, PHP.:D

redhead
04-02-2005, 12:57 PM
Ok it works more or less ok, the only thing is that if I have a PHP Parse error (and I have more than most ;)) it doesnt tell me! It just outputs absolutley nothing... Any ideas why that happens? Does anyone know how to fix such a thing? It's more than a little inconvienient to upload it just to find out where my parse error is!

Thanks for any help... sorry my server problems keep cropping up, once it's sorted it'll be sorted

marcopb
04-21-2005, 03:50 PM
I was just surfing.. searching for solve the same error...
and I solved reading this link http://help.scibit.com/mysql/manual_Problems.html
I've just to change in your config.inc.php the localhost directive!!!!
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
to
$cfg['Servers'][$i]['host'] = 'your_hostname'; // MySQL hostname or IP addres
or
$cfg['Servers'][$i]['host'] = 'your_IP'; // MySQL hostname or IP addres

Ciao,
Marco :thumbsup:

spaco
05-12-2005, 11:13 AM
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)"

Hi Redhead said she fixed this in terminal but didn't specify how- any ideas?

gsnedders
05-12-2005, 12:19 PM
My advice: Install Apache and PHP from source, and MySQL from a binary before doing both. I've had problems doing what you did.

Instructions (Where % represents the command line, and are in [code] blocks):
Download the Standard OS 10.3 Installer Package from here (http://dev.mysql.com/downloads/mysql/4.1.html#Mac_OS_X) (4.1 somes with a System Panel, which is useful :p). Run all the installers in the disk image. Install it, and go to the MySQL panel is System Preferences, now, turn MySQL on.

Open Terminal:

% cd ~/Desktop
% mkdir gdbuild
% cd gdbuild
% curl -O ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
% curl -O http://heanet.dl.sourceforge.net/sourceforge/png-mng/libpng-1.2.7.tar.gz
% gnutar xzf jpegsrc.v6b.tar.gz
% gnutar xzf libpng-1.2.7.tar.gz
% cd jpeg-6b
% sudo mkdir -p /usr/local/include
% sudo mkdir -p /usr/local/bin
% sudo mkdir -p /usr/local/man
% sudo mkdir -p /usr/local/lib
% sudo mkdir /usr/local/man/man1
% ./configure
% sudo make install
% sudo make install-lib
% sudo ranlib /usr/local/lib/libjpeg.a
% cd ..
% cd libpng-1.2.7
% cp scripts/makefile.macosx ./Makefile
% pico Makefile
Now, the changes you have to make are both near the top, find:
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB=../zlib
ZLIBINC=../zlib and replace with
# Where the zlib library and include files are located
ZLIBLIB=/usr/local/lib
ZLIBINC=/usr/local/include
#ZLIBLIB=../zlib
#ZLIBINC=../zlib Press Ctrl - O (as in Ouch), then Return to save, then Ctrl - X to exit.

Then, back to the command line
% make
% sudo make install
% sudo ranlib /usr/local/lib/libpng.a
% cd ..
% cd ~/Desktop
% mkdir apachebuild
% cd apachebuild
% curl -O http://apache.mirrors.esat.net/httpd/apache_1.3.33.tar.gz
% gnutar -xzf apache_1.3.33.tar.gz
% cd apache_1.3.33
% ./configure \
--enable-module=most \
--enable-shared=max
% make
% sudo make install
Now, for some odd reason, we have to reinstall all of the GD stuff, so, Terminal again.

% cd ~/Desktop
% mkdir gdbuild2
% cd gdbuild2
% curl -O ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
% curl -O http://heanet.dl.sourceforge.net/sourceforge/png-mng/libpng-1.2.7.tar.gz
% gnutar xzf jpegsrc.v6b.tar.gz
% gnutar xzf libpng-1.2.7.tar.gz
% cd jpeg-6b
% sudo mkdir -p /usr/local/include
% sudo mkdir -p /usr/local/bin
% sudo mkdir -p /usr/local/man
% sudo mkdir -p /usr/local/lib
% sudo mkdir /usr/local/man/man1
% ./configure
% sudo make install
% sudo make install-lib
% sudo ranlib /usr/local/lib/libjpeg.a
% cd ..
% cd libpng-1.2.7
% cp scripts/makefile.macosx ./Makefile
% pico Makefile
Now, the changes you have to make are both near the top, find:
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB=../zlib
ZLIBINC=../zlib and replace with
# Where the zlib library and include files are located
ZLIBLIB=/usr/local/lib
ZLIBINC=/usr/local/include
#ZLIBLIB=../zlib
#ZLIBINC=../zlib Press Ctrl - O (as in Ouch), then Return to save, then Ctrl - X to exit.[/code]
Now, that's done again, we can get on with building PHP:

% cd ~/Desktop
% mkdir phpbuild
% cd phpbuild
% curl -O http://ie.php.net/distributions/php-4.3.11.tar.gz
% gnutar -xzf php-4.3.11.tar.gz
% cd php-4.3.11
% ./configure \
--with-ftp \
--with-xml \
--with-zlib \
--with-gd \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-mysql=/usr/local/mysql \
--with-apxs=/usr/sbin/apxs
% make
% sudo make install If you want a php.ini file:
% sudo cp php.ini-dist /usr/local/lib/php.ini

Now, you need to edit httpd.conf, so, pico again :p

% sudo pico /etc/httpd/httpd.conf
This time, the edits are:
Commenting out (Placing a # a the beginning of the line) the following lines:

LoadModule hfs_apple_module libexec/httpd/mod_hfs_apple.so
and
AddModule mod_hfs_apple.c
Now, here's where it changes from OS to OS, if you are on Tiger (Mac OS 10.4), you have to comment out:
LoadModule bonjour_module libexec/httpd/mod_bonjour.so and
AddModule mod_bonjour.c

If you are on Panther (Mac OS 10.3), you have to comment out:
LoadModule rendezvous_module libexec/httpd/mod_rendezvous.so and
AddModule mod_rendezvous.c

Now, save and exit (Ctrl - O, Return, Ctrl - X). Now, all you need to do is start/restart Apache:
% sudo apachectl restart

MySQL will now have it's default root password (nothing) and should be changed using
% /usr/local/mysql/bin/mysqladmin -u root password new_password_here

datasetgo
05-27-2005, 02:13 PM
Just stumbled upon this thread - thought I'd clairfy a couple things. First of all, the parent post by Redhead was asking how to view the contents of folders in their Sites directory. By default , Apache on OS X is configured not to produce directory listings. So, if there is no index file in those directories, you cannot view them. To correct, either add an index.html or index.php file OR modify /etc/httpd/httpd.conf and turn on Indexes (though not the greatest of ideas if this is an open to the net server, imho).

Later on, Redhead mentioned that PHP was not functioning. Rather than installing the whole mess via source, maybe you should try *turning it on* first - it's already installed. ;-) Edit /etc/httpd/httpd.conf, uncomment these 2 lines:

LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c

Then restart the webserver by either issuing a /usr/sbin/apachectl graceful
or simply go to System Preferences-->Sharing and turn off/turn on the webserver.

gsnedders
05-27-2005, 03:54 PM
Later on, Redhead mentioned that PHP was not functioning. Rather than installing the whole mess via source, maybe you should try *turning it on* first - it's already installed. ;-) Edit /etc/httpd/httpd.conf, uncomment these 2 lines:

LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c

Then restart the webserver by either issuing a /usr/sbin/apachectl graceful
or simply go to System Preferences-->Sharing and turn off/turn on the webserver.
That's an old version of PHP with known security holes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum