Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Quick websharing question

Quick websharing question
Thread Tools
sahara
Forum Regular
Join Date: Apr 2001
Location: NY, NY, USA
Status: Offline
Reply With Quote
Jun 5, 2003, 04:44 PM
 
So I successfully installed Apache 2.0 side-by-side with the 1.3.27 standard install. I can switch on the fly by using either /usr/sbin/apachectl or /usr/local/apache2/bin/apachectl. However, I want to link the "Personal Web Sharing" button in System Preferences to Apache 2. I thought I could do this by editing the /System/Library/StartupItems/Apache/Apache file, but that didn't seem to change anything. It still uses /usr/sbin/apachectl. Does anyone know where I can set the path to Apache 2 so that System Preferences uses that by default? Thanks!
- Sahara
     
Camelot
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Jun 5, 2003, 07:44 PM
 
Originally posted by sahara:
So I successfully installed Apache 2.0 side-by-side with the 1.3.27 standard install. I can switch on the fly by using either /usr/sbin/apachectl or /usr/local/apache2/bin/apachectl. However, I want to link the "Personal Web Sharing" button in System Preferences to Apache 2. I thought I could do this by editing the /System/Library/StartupItems/Apache/Apache file, but that didn't seem to change anything. It still uses /usr/sbin/apachectl. Does anyone know where I can set the path to Apache 2 so that System Preferences uses that by default? Thanks!
At its first level, /usr/sbin/apachectl is simply a shell script that launches httpd

You could simply edit this script to call the different version.

However,what may be even easier is just replacing /usr/sbin/apachectl with /usr/local/apache2/bin/apachectl since the apache2 version has the correct paths to the apache2 binary.

What I'd do is:

Code:
mv /usr/sbin/apachectl /usr/sbin/apache1ctl ln /usr/local/apache2/bin/apachectl /usr/sbin/apache2ctl ln -s /usr/sbin/apache2ctl /usr/sbin/apachectl
In this way you have two startup scripts in /usr/sbin (apache1ctl and apache2ctl), and a symbolic link that binds /usr/sbin/apachectl to /usr/sbin/apache2ctl

The system will always call /usr/sbin/apachectl and by simply changing the target of the symlink you can easily switch which version is active.
Gods don't kill people - people with Gods kill people.
     
sahara  (op)
Forum Regular
Join Date: Apr 2001
Location: NY, NY, USA
Status: Offline
Reply With Quote
Jun 5, 2003, 08:33 PM
 
Excellent, thanks!
Only problem now is that while the "Start" button in System Preferences starts the Apache 2 server, it doesn't seem able to tell when the server finishes starting up. It just sits on "Starting up..." even though it has finished starting up. The consequences of this is that I never get a "Stop" button. Ideas? Thanks again.

Edit: Seems to be that simply relinking /usr/sbin/apachectl to /usr/local/apache2/bin/apachectl allows the Apache 2 server to run instead of Apache 1, but all the other binaries (apxs, httpd, etc.) are still being run from /usr/sbin and are linked to Apache 1...
Is there any way I can make /usr/local/apache2/bin dominant over /usr/sbin in my path?
( Last edited by sahara; Jun 6, 2003 at 01:02 AM. )
- Sahara
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:04 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,