The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   Stuck with Personal Web Sharing (http://hintsforums.macworld.com/showthread.php?t=20049)

stetner 01-28-2004 07:25 PM

Interesting, mine shows:
Code:

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
<IfModule mod_userdir.c>
    UserDir Sites
</IfModule>

And it is that way in all these files (most notably the httpd.conf.default file)

httpd.conf
httpd.conf.defaultserver
httpd.conf.10.2
httpd.conf.default

(the 10.2 one I created as backup when going to 10.3)

So I think it is supposed to be sites. Between that and the User/Group thing, I think your httpd.conf file has been changed somehow. You might like to try this:
Code:

diff -b /etc/httpd/httpd.conf /etc/httpd/httpd.conf.default
I have made some changes to mine, but if yours is supposed to be quite default, you should not see too many differences between these files.

jkinberg 01-28-2004 07:40 PM

quite a few differences:
Code:

[josh:~] josh% sudo diff -b /etc/httpd/httpd.conf /etc/httpd/httpd.conf.default
139,140c139,140
< MinSpareServers 5
< MaxSpareServers 10
---
> MinSpareServers 1
> MaxSpareServers 5
146c146
< StartServers 5
---
> StartServers 1
171c171
< MaxRequestsPerChild 0
---
> MaxRequestsPerChild 100000
239a240,241
> LoadModule hfs_apple_module  libexec/httpd/mod_hfs_apple.so
> LoadModule rendezvous_apple_module libexec/httpd/mod_rendezvous_apple.so
280a283,284
> AddModule mod_hfs_apple.c
> AddModule mod_rendezvous_apple.c
326,327c330,331
< User nobody
< Group nobody
---
> User www
> Group www
334c338
< ServerAdmin root@edo
---
> #ServerAdmin webmaster@example.com
352c356
< #ServerName edo
---
> #ServerName gump
414c418
<    UserDir public_html
---
>    UserDir Sites
421c425
< #<Directory /home/*/public_html>
---
> #<Directory /home/*/Sites>
848a853
>    AddType image/x-icon .ico
1055a1061,1067
>
> <IfModule mod_rendezvous_apple.c>
> RegisterUserSite all-users
> RegisterDefaultSite
> </IfModule>
>
> Include /private/etc/httpd/users


stetner 01-28-2004 08:22 PM

Looking at that I would probably shut down apache and copy the default file over your current on and restart, do you know where that file came from?
Code:

[josh:~] josh% sudo diff -b /etc/httpd/httpd.conf /etc/httpd/httpd.conf.default
139,140c139,140
< MinSpareServers 5
< MaxSpareServers 10
---
> MinSpareServers 1
> MaxSpareServers 5
146c146
< StartServers 5
---
> StartServers 1

For a personal machine you probably don't need 5-10 servers
Code:

171c171
< MaxRequestsPerChild 0
---
> MaxRequestsPerChild 100000

Code:

The MaxRequestsPerChild directive sets the limit on the number of
requests that an individual child server process will handle. After MaxRequestsPerChild
requests, the child process will die. If MaxRequestsPerChild is 0, then the
process will never expire.

Hmm, I guess I would probably never get to 100000 requests on my home machine so this is probably moot.
Code:

239a240,241
> LoadModule hfs_apple_module  libexec/httpd/mod_hfs_apple.so
> LoadModule rendezvous_apple_module libexec/httpd/mod_rendezvous_apple.so
280a283,284
> AddModule mod_hfs_apple.c
> AddModule mod_rendezvous_apple.c

hfs should probably be in there, rendezvous probably does not matter.
Code:

326,327c330,331
< User nobody
< Group nobody
---
> User www
> Group www

Yep, that should probably change.
Code:

334c338
< ServerAdmin root@edo
---
> #ServerAdmin webmaster@example.com
352c356
< #ServerName edo
---
> #ServerName gump

who is root @ edo ?? you?
Code:

414c418
<    UserDir public_html
---
>    UserDir Sites
421c425
< #<Directory /home/*/public_html>
---
> #<Directory /home/*/Sites>

Yep, the reason you needed to create public_html...
Code:

848a853
>    AddType image/x-icon .ico
1055a1061,1067
>
> <IfModule mod_rendezvous_apple.c>
> RegisterUserSite all-users
> RegisterDefaultSite
> </IfModule>
>
> Include /private/etc/httpd/users

Should be there if the rendezvous module is.

Anyway, like I said, I would probably replace your httpd.conf with the default one.

jkinberg 01-29-2004 01:38 AM

That did the trick! I can now see my sites in Rendezvous too. I'm not sure how my Apache httpd.conf file got so screwed up??

Thanks for all your help!

tymac 02-12-2004 02:20 PM

Hello to all of you!

I am so thankful to have found a thread where a probable solution to my problem lies. For the past several hours ( and it's now 2 am), I have been patiently and carefully following all the instructions here.

By the way, I am using Mac OS ver 10.2.8 with Apache/1.3.29 and php-4.3.4 from enthrophy. My problem is almost identical to "jkinberg's", I am unable to start my Apache by:


1) going to the system preference and click the 'Personal Web Sharing' start button
- icon greyed
- Personal Web Sharing waiting to start (this does not happen before)

2) typing "sudo /usr/sbin/apachectl start" on the terminal
- gives "Syntax error on line 2 of /etc/httpd/httpd.conf:
Invalid command '.so', perhaps mis-spelled or defined by a module not included in the server configuration" /usr/sbin/apachectl start: httpd could not be started


Tried replacing the httpd.conf with the httpd.conf.default and got this:

"Syntax error on line 2 of /etc/httpd/httpd.conf:
Invalid command 'od_status.so', perhaps mis-spelled or defined by a module not included in the server configuration" /usr/sbin/apachectl start: httpd could not be started



Thanks in advance for you kind assistance.

Jose

hayne 02-13-2004 12:56 AM

So you are getting error messages about line 2 of http.conf
What does this line 2 look like? Show us.

One idea: maybe the http.conf file has somehow got its line endings screwed up (e.g. if you edited it and saved with Mac or DOS line endings). Try running this Perl invocation on it:

sudo perl -pi~ -e 's/\r\n?/\n/g' /etc/httpd/httpd.conf

tymac 02-13-2004 02:11 AM

hayne,

Thanks for your input here. I really appreciate it.

Well, lately I have been using dreamweaver mx to edit my httpd.conf file since my trial version of bbedit expired. I am not aware that this might mess up my file.

But running the perl command that you suggested asked me for a password and then back to the prompt without giving out any specific messages.

As for the line 2, below is a part of my httpd.conf file.

-----------------------

1##
2## httpd.conf -- Apache HTTP server configuration file
3##
4
5#
6# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://www.apache.org/docs/> for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# After this file is processed, the server will look for and process
# /usr/conf/srm.conf and then /usr/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone. Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#


--------------


I hope this would be some more enlightenment.

regards,

Jose

tymac 02-13-2004 02:20 AM

This is a followup post after another try.

When I try to type 'sudo /usr/sbin/httpd -t', I get this error message

*****
"Syntax error on line 379 of /etc/httpd/httpd.conf: Invalid command '<Directory>', perhaps mis-spelled or defined by a module not included in the server configuration"
******

And this what I have on my line 379 of my httpd.conf file

******
<Directory>
Options FollowSymLinks
AllowOverride None
</Directory>
*****

Thanks!

hayne 02-13-2004 01:47 PM

1) The Perl command I gave you is not supposed to give any output - it just silently fixes the line endings in yoru file to be the UNIX style (expected by Apache).

2) If you have been editing the httpd.conf file in Dreamweaver, I wouldn't be surprised if it has been corrupted somehow. It is not an HTML file and so Dreamweaver may have screwed it up.
You should get some other text editor to use in editing config files. One that is already on your system is 'pico' (execute this from the Terminal command line and follow the directions at the bottom).

You probably should get a fresh copy of the httpd.conf file from your OS X install CD or by downloading it from Apache. Test that Apache works with this fresh copy before changing anything. Then save a copy and never edit that copy so you always have something you can compare with later.

tymac 02-14-2004 08:15 PM

Hayne,

I patiently tried your suggestion of installting a fresh httpd.conf file from an apache package. And with that, I tried restarting my computer and starting apache from the terminal but, I still get just about the same result that looks like this.

"/usr/sbin/apachectl start
Syntax error on line 2 of /etc/httpd/httpd.conf:
Invalid command '.so', perhaps mis-spelled or defined by a module not included in the server configuration
/usr/sbin/apachectl start: httpd could not be started
"

Always, there is something wrong with the line 2. The only thing that change is the word after "Invalid command. Either it's 'so' , 'ners' or 'dModule' . And this is when I install a different httpd.conf file.

I really hope that this would help enlighten us where the problem is really coming from.

Thanks a gain Hayne.

stetner 02-15-2004 02:36 AM

can you post the results of:
Code:

$ od -c /etc/httpd/httpd.conf| head
0000000    #  #  \n  #  #      h  t  t  p  d  .  c  o  n  f
0000020        -  -      A  p  a  c  h  e      H  T  T  P   
0000040    s  e  r  v  e  r      c  o  n  f  i  g  u  r  a
0000060    t  i  o  n      f  i  l  e  \n  #  #  \n  \n  #  \n
0000100    #      B  a  s  e  d      u  p  o  n      t  h  e
0000120        N  C  S  A      s  e  r  v  e  r      c  o  n
0000140    f  i  g  u  r  a  t  i  o  n      f  i  l  e  s
0000160        o  r  i  g  i  n  a  l  l  y      b  y      R
0000200    o  b      M  c  C  o  o  l  .  \n  #  \n  #      T
0000220    h  i  s      i  s      t  h  e      m  a  i  n

It really sounds like you have some problem with the line endings on your file and this will show what they are.

tymac 02-15-2004 10:48 AM

stetner,

fisrt of all thanks for your time in helping me out.

earlier today i tried reinstalling my apache from the install disk of my osx and at the same time i tried reinstalling php which i got from enthropy. and with a bit of luck, i was able to run my apache once again.

i tried running "od -c /etc/httpd/httpd.conf| head" and i got the same result as what you have posted.

but with this problem solve, i know that there is still more to learn about apache and php. anyway, thank you all for the guidance and patience.

jose

George83 05-13-2004 05:47 PM

The same problem, but different symptoms...
 
I tried following some online instructions on upgrading to Apache 1.3.29 a few days ago, but ever since, Personal Web Sharing refuses to start from System Preferences; it just greys-out when I click 'Start'.

At the end of the installation, it said it had been successfully installed:

Code:

+--------------------------------------------------------+
| You now have successfully built and installed the      |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the        |
| (initially created or preserved) configuration files  |
|                                                        |
|  /etc/httpd/httpd.conf
|                                                        |
| and then you should be able to immediately fire up    |
| Apache the first time by running:                      |
|                                                        |
|  /usr/sbin/apachectl start
|                                                        |
| Thanks for using Apache.      The Apache Group        |
|                                http://www.apache.org/  |
+--------------------------------------------------------+

Here are some commands and their outputs, which may help:

Code:

Mac:~ George$ /usr/sbin/apachectl start
dyld: /usr/sbin/httpd Undefined symbols:
_hfs_apple_module
/usr/sbin/apachectl: line 175:  737 Trace/BPT trap          $HTTPD
/usr/sbin/apachectl start: httpd could not be started

Code:

Mac:~ George$ httpd -v
Server version: Apache/1.3.29 (Darwin)
Server built:  Feb  4 2004 10:31:58

Seeing as I installed it a few days ago, surely the timestamp should be a date in May?

stetner 05-13-2004 07:14 PM

You might want to check your /etc/httpd/httpd.conf file to see if the hfs module is named right in it. Mine says:
Code:

$ grep hfs /etc/httpd/httpd.conf
LoadModule hfs_apple_module  libexec/httpd/mod_hfs_apple.so
AddModule mod_hfs_apple.c
$ /usr/sbin/httpd -v
Server version: Apache/1.3.29 (Darwin)
Server built:  Feb  4 2004 10:31:58

I seem to recall a naming change with this module a few versions back, but from what you posted it did not look like that.

As well, what does
Code:

$ ls -l /usr/libexec/httpd/mod_hfs_apple.so
-rwxr-xr-x  1 root  wheel  8888 13 Sep  2003 /usr/libexec/httpd/mod_hfs_apple.so*

Show? Oh yeah, this will show you the library symbols
Code:

$ nm /usr/libexec/httpd/mod_hfs_apple.so
        U __CurrentRuneLocale
        U ____tolower
        U _ap_make_array
        U _ap_pcalloc
        U _ap_pstrdup
        U _ap_push_array
        U _core_module
        U _free
00001004 D _hfs_apple_module
        U _malloc
        U _memcmp
        U _memset
        U _statfs
        U _strcat
        U _strcmp
        U _strcpy
        U _strlen
        U _strncmp


George83 05-13-2004 08:45 PM

Code:

Mac:~ George$ ls -l /usr/libexec/httpd/mod_hfs_apple.so
-rwxr-xr-x  1 root  wheel  9100 28 Jun  2001 /usr/libexec/httpd/mod_hfs_apple.so

There seems to be a considerable number of library symbols more than you:

Code:

Mac:~ George$ nm /usr/libexec/httpd/mod_hfs_apple.so
        U _FSGetCatalogInfo
        U _FSGetVolumeInfo
        U _FSPathMakeRef
        U __CurrentRuneLocale
        U ____tolower
0000069c t __dyld_func_lookup
00000000 t __mh_bundle_header
        U _ap_log_rerror
        U _ap_make_array
        U _ap_pcalloc
        U _ap_pstrcat
        U _ap_pstrdup
        U _ap_push_array
0000100c D _apple_hfs_module
        U _core_module
        U _free
        U _malloc
        U _strcasecmp
        U _strcmp
        U _strcpy
        U _strlen
        U _strncmp
0000066c t dyld_stub_binding_helper


stetner 05-13-2004 10:58 PM

Hi George, again we are seeing a difference between your files and mine, even though we are both on 10.3.3.

Code:

yours

-rwxr-xr-x  1 root  wheel  9100 28 Jun  2001 /usr/libexec/httpd/mod_hfs_apple.so

vs mine

-rwxr-xr-x  1 root  wheel  8888 13 Sep  2003 /usr/libexec/httpd/mod_hfs_apple.so*

How did you get to 10.3.3? upgrade or clean install? Have you installed the latest patches from software update?

I get the feeling that we may find ourselves in the same situation as the sudo issue, where re-installing the files from the source may be the solution.

George83 05-14-2004 01:02 AM

I think I clean installed on version 10.3.2, and I've been using software update on a regular basis, so all available updates are installed at the moment.

I've reinstalled, but I'm left with Apache version 1.3.28. Is there any recommended of installing the upgrade to 1.3.29?

Your help is valued.

stetner 05-14-2004 01:53 AM

Looking through my receipts under /Library/Receipts it appears that /usr/sbin/httpd was updated last in 10.3.3 and /usr/libexec/httpd/mod_hfs_apple.so came from my original 10.3 install.
Code:

using lsbom <package>.pkg/Contents/Archive.bom and grepping for sbin/httpd and mod_hfs
***** Essentials.pkg
./usr/libexec/httpd/mod_hfs_apple.so    100755  0/0    8888    4249249299
./usr/sbin/httpd        100755  0/0    398492  95398489
***** MacOSXUpdate10.3.3.pkg
./usr/sbin/httpd        100755  0/0    398492  3370360176
***** SecurityUpd2004-01-26Pan.pkg
./usr/sbin/httpd        100755  0/0    398492  2966414809


$ cksum /usr/libexec/httpd/mod_hfs_apple.so
4249249299 8888 /usr/libexec/httpd/mod_hfs_apple.so

$ cksum /usr/sbin/httpd
3370360176 398492 /usr/sbin/httpd

$ ll -drt Essentials.pkg MacOSXUpdate10.3.3.pkg SecurityUpd2004-01-26Pan.pkg
drwxr-xr-x  3 root    wheel  102 29 Oct  2003 Essentials.pkg/
drwxr-xr-x  3 stetner  wheel  102 27 Jan 21:47 SecurityUpd2004-01-26Pan.pkg/
drwxr-xr-x  3 stetner  wheel  102 16 Mar 16:46 MacOSXUpdate10.3.3.pkg/



All times are GMT -5. The time now is 07:33 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.