The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   Turning on Personal Web Sharing..!!! (http://hintsforums.macworld.com/showthread.php?t=30271)

AjAy2 11-05-2004 06:17 PM

Turning on Personal Web Sharing..!!!
 
I am trying to get PHP and Apache to work with one another, I am going through a tutorial and it says to turn on the 'Personal Web Sharing' in the system preferences, however when i go to turn it on I click 'Start' and it just doesnt start, it sort of tries to and just consistntly says 'Web sharing is starting up' it never does Start up.

Does anybody know whats up, and why its not working? And how to get roung it?

Any help would be greatly apprectiate.

AjAy

griffman 11-05-2004 06:35 PM

Open the Terminal and type sudo apachectl configtest, then enter your admin password when prompted. This will run a test on the config file, and report back any errors.

Copy and paste any interesting output back here...

-rob.

AjAy2 11-05-2004 06:47 PM

Cheers Rob,

Here is the feedback:
"Last login: Fri Nov 5 23:46:11 on ttyp1
Welcome to Darwin!
Aarrons-Computer:~ Aarron$ sudo apachectl configtest
Syntax error on line 1 of /etc/httpd/httpd.conf:
Invalid command '^W', perhaps mis-spelled or defined by a module not included in the server configuration
Aarrons-Computer:~ Aarron$"

i have just got my Mac and need to do an assignment with PHP for Uni.

Thanks for you help.

Aarron

AjAy2 11-05-2004 06:53 PM

I just did that again and it returned:

Last login: Fri Nov 5 23:46:41 on ttyp1
Welcome to Darwin!
Aarrons-Computer:~ Aarron$ Last login: Fri Nov 5 23:46:11 on ttyp1
Welcome to Darwin!
Aarrons-Computer:~ Aarron$ sudo apachectl configtest
Syntax error on line 1 of /etc/httpd/httpd.conf:
Invalid command '^W', perhaps mis-spelled or defined by a module not included in the server configuration
Aarrons-Computer:~ Aarron$
Aarron ttyp1 Fri Nov 5 23:52 still logged in
Aarron ttyp1 Fri Nov 5 23:52 - 23:52 (00:00)
Aarron ttyp1 Fri Nov 5 23:46 - 23:52 (00:06)
Aarron ttyp1 Fri Nov 5 23:46 - 23:46 (00:00)
Aarron ttyp1 Fri Nov 5 23:46 - 23:46 (00:00)
Aarron ttyp1 Fri Nov 5 23:46 - 23:46 (00:00)
Aarron ttyp1 Fri Nov 5 23:34 - 23:46 (00:12)
Aarron ttyp1 Fri Nov 5 23:34 - 23:34 (00:00)
Aarron ttyp1 Tue Nov 2 19:25 - 23:34 (3+04:08)
Aarron ttyp1 Tue Nov 2 19:25 - 19:25 (00:00)
Aarron ttyp1 Tue Nov 2 18:22 - 19:25 (01:02)
Aarron ttyp1 Tue Nov 2 18:22 - 18:22 (00:00)
Aarron ttyp1 Tue Nov 2 18:21 - 18:22 (00:01)
Aarron ttyp1 Tue Nov 2 18:21 - 18:21 (00:00)
Aarron ttyp1 Tue Nov 2 18:20 - 18:21 (00:00)
Aarron ttyp1 Tue Nov 2 18:20 - 18:20 (00:00)
Aarron ttyp1 Tue Nov 2 18:13 - 18:20 (00:07)
Aarron ttyp1 Tue Nov 2 18:13 - 18:13 (00:00)

wtmp begins Mon Nov 1 23:10
Aarrons-Computer:~ Aarron$ Welcome to Darwin!
-bash: Welcome: command not found
Aarrons-Computer:~ Aarron$ Aarrons-Computer:~ Aarron$ sudo apachectl configtest
-bash: Aarrons-Computer:~: command not found
Aarrons-Computer:~ Aarron$ Syntax error on line 1 of /etc/httpd/httpd.conf:
-bash: Syntax: command not found
Aarrons-Computer:~ Aarron$ Invalid command '^W', perhaps mis-spelled or defined by a module not included in the server configuration
-bash: Invalid: command not found
Aarrons-Computer:~ Aarron$ Aarrons-Computer:~ Aarron$
-bash: Aarrons-Computer:~: command not found
Aarrons-Computer:~ Aarron$

Does this make sense to you?

AjAy

griffman 11-05-2004 06:55 PM

You need to open /etc -> httpd -> httpd.conf in a text editor in the Terminal (such as vi, pico [easiest for newcomers], or emacs), with root permissions:

$ cd /etc/httpd
$ sudo pico httpd.conf

Apparently the very first line has a Control-W at the end of it. Hopefully you can see it in pico; I'm not sure if you will or won't. If you can, delete it. If not, we'll have to try something else (but try this first :) ).

-rob.

AjAy2 11-05-2004 07:02 PM

Yey...

That worked, i now know Apache is working, however it does not recognise the php file when I open it, any idea's on that?

All I need now is PHP working, your a star mate.

Aarron

griffman 11-05-2004 07:07 PM

You have to enable it in that same file; instructions for doing so in 10.3 are on the main site:

Enable the built-in PHP module

-rob.

AjAy2 11-05-2004 07:19 PM

I have entered all of that into the httpd document, but it still doesnt work.

Where do I put the web pages, is there an exact root that Apache wants them in?

Cheers

Aarron

griffman 11-05-2004 07:36 PM

/Library/WebServer/Documents or in your user's Sites folder. The first can be reached at http://127.0.0.1, the second at http://127.0.0.1/~username

Make sure you restart the webserver after making the PHP changes.

-rob.

AjAy2 11-05-2004 07:47 PM

Yeah the first link works fine, the second one doesnt...

Here is what I now have in the httpd document:

#LoadModule ssl_module libexec/httpd/libssl.so
#LoadModule perl_module libexec/httpd/libperl.so
LoadModule php4_module libexec/httpd/libphp4.so

AddModule mod_php4.c

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

i have added thos few lines of code, still doesnt work..I have also restarted Web Sharing, any ideas?

Aarron

cyberkiko 11-07-2004 03:43 PM

TUrning on Personal Web Sharing
 
im trying to turn it on but hapend the same, it dont work, i open the terminal and type sudo apachectl configtest,
and this is what is says:


Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/albertep.conf
Syntax OK


i dont know what to do, i run permitions fix, resintall 10.3.6,
but nothing....

hayne 11-07-2004 04:49 PM

Quote:

Originally Posted by cyberkiko
im trying to turn it on but hapend the same, it dont work, i open the terminal and type sudo apachectl configtest,
and this is what is says:

Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/albertep.conf
Syntax OK

So the syntax of the config files is okay.
What happens when you click on the Start button in the Personal Web sharing section of Sharing preferences?

cyberkiko 11-07-2004 05:05 PM

startingup....

hayne 11-07-2004 05:10 PM

Quote:

Originally Posted by cyberkiko
startingup....

I assume you mean that it says that and stays that way forever. Is that correct? Please use a few more words in your posts to make things clear.

Launch the "Console" application (under the Utilities folder) and look for relevant error messages. Click the Logs button (top left) and go into the /var/log section and then the httpd section. Look at the logs there. Show us relevant error messages.

cyberkiko 11-07-2004 05:38 PM

ok, yes stay that way forever, i chek the console and there is a lot of error, but i dont what to do
[crit] (48)Address already in use: make_sock: could not bind to port 80
that is one that apear much...

[Sun Nov 7 18:05:30 2004] [warn] mod_rendezvous_apple: Skipping user 'albertep' - cannot read index file '/Users/albertep/Sites/index.html'.
Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/albertep.conf
[Sun Nov 7 18:05:30 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80

cyberkiko 11-07-2004 05:59 PM

the one that refers to the index.html, i already corrected, but it seems that the error that dont let me turn on personal web sharing is this one
Sun Nov 7 18:05:30 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
any help with that?

hayne 11-07-2004 08:42 PM

Quote:

Originally Posted by cyberkiko
Sun Nov 7 18:05:30 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80

This error means that port 80 (used for HTTP) is already in use by some other process. This often means that Apache is already started and you are trying to start it again.

Did you by any chance install a startup item to start Apache?
If so, you should uninstall that.

Restart your Mac and then try again.

cyberkiko 11-07-2004 10:23 PM

thanks was the quicktime streaming server,
good nigth

mag74 09-20-2005 05:45 PM

Turning on Personal Web Sharing..!!!
 
I am unable to turn on web sharing. The following error message appears:

[NGLG4:~] northerngifts% sudo /usr/sbin/apachectl start
Password:
Syntax error on line 263 of /etc/httpd/httpd.conf:
Cannot add module via name 'mod_alias.c': not in list of loaded modules
/usr/sbin/apachectl start: httpd could not be started
[NGLG4:~] northerngifts%

I don't know how to fix this.

I would really appreciate help.

Thank you,
mag74

hayne 09-20-2005 06:31 PM

Quote:

Originally Posted by mag74
Syntax error on line 263 of /etc/httpd/httpd.conf:
Cannot add module via name 'mod_alias.c': not in list of loaded modules
/usr/sbin/apachectl start: httpd could not be started

The above error message would seem to indicate that you have edited the file "httpd.conf" and thus introduced the problem. You should revert this file to the original version. If you didn't save a copy of the original version, you can extract it from your Install CD/DVD using the 3rd-party utility "Pacifist".

mag74 09-20-2005 07:33 PM

Thanks for your prompt reply... ergh - I thought I must have caused this & I haven't saved it so I will have to get my install cd/dvd. I will do this tomorrow when I get back into work - Thanks!!

exchaoordo 03-24-2007 10:58 AM

Same message, Web sharing starting up
 
I had web sharing working and now it isn't (unfortunately it is usually a few weeks between my newbie hobbyist efforts at this so I forget what I've done).

Now I get the web sharing starting up message that hangs. The appachectl start and config test (thanks for those) returns:
[alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Then I tried to start and stop and got:

Code:

whitecomputer:~ danielalbert$ sudo apachectl start
Processing config directory: /private/etc/httpd/users/*.conf
 Processing config file: /private/etc/httpd/users/danielalbert.conf
[Sat Mar 24 14:56:34 2007] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
/usr/sbin/apachectl start: httpd started
whitecomputer:~ danielalbert$ sudo apachectl stop
/usr/sbin/apachectl stop: httpd (no pid file) not running

I can't get to localhost, but I can get to localhost/~username


All times are GMT -5. The time now is 08:36 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.