|
|
Quick websharing question
|
|
|
|
Forum Regular
Join Date: Apr 2001
Location: NY, NY, USA
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2001
Location: NY, NY, USA
Status:
Offline
|
|
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 Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|