sudo port install apache2

Charlse Darwin macports.users at gmail.com
Sun Dec 16 16:03:30 PST 2007


Thanks for your input Ryan; really informative.
I found the quote below here: http://trac.macosforge.org/projects/ 
macports/wiki/InstallingMacPorts

"The MacPorts binary installer places a .profile file in your home  
directory (view files preceded by a dot with 'ls -a'). The contents  
of this ~/.profile file adds the MacPorts paths in front of the  
standard Unix paths for the default BASH shell. This is done so that  
if you have utilities or libraries from both MacPorts and OS X's  
standard install, the MacPorts libraries will be run instead of the  
ones provided by Apple.

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

…

So a basic ~/.profile file will look like this:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
…
"
in my system I have
$ cat .profile
#
# Your previous .profile  (if any) is saved as .profile.dpsaved
# Setting the path for DarwinPorts.
alias cp='cp -i'
alias mv='mv -i'

export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin:/bin:/ 
sbin:$PATH
export DISPLAY=:0.0

test -r /sw/bin/init.sh && . /sw/bin/init.sh
stty erase ^H
export LC_CTYPE=en_US.UTF-8
test -r /sw/bin/init.sh && . /sw/bin/init.sh
$ ls -a .p*
.port_history   .profile

.psi:
.               ..              profiles
$ env
#…
PATH=/Users/pm/Documents/scripts/:/opt/local/bin:/opt/local/sbin:/usr/ 
bin:/usr/sbin:/bin:/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/ 
sbin/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/teTeX/bin/ 
powerpc-apple-darwin-current
#…
$

# env returns more than what I have in ~/.profile?!!

# About directory "/Library/Frameworks/Python.framework/Versions/ 
Current/bin/bin" ?!! Whatever feeds those extra paths to env is where  
this weird directory and extra /bin and /sbin stem from.
$ ls Library/Frameworks/Python.framework/Versions/Current/bin/bin
ls: Library/Frameworks/Python.framework/Versions/Current/bin/bin: No  
such file or directory
$ ls Library/Frameworks/Python.framework/Versions/Current/bin/
ls: Library/Frameworks/Python.framework/Versions/Current/bin/: No  
such file or directory
$ ls Library/Frameworks/Python.framework/Versions/Current/
ls: Library/Frameworks/Python.framework/Versions/Current/: No such  
file or directory
$ ls Library/Frameworks/Python.framework/Versions/
ls: Library/Frameworks/Python.framework/Versions/: No such file or  
directory
$ ls Library/Frameworks/Python.framework/
ls: Library/Frameworks/Python.framework/: No such file or directory
$ ls Library/Frameworks/
EWSMac.framework                GoogleMapsShared.framework       
Skype.framework
$

Your point about about direct use of apachectl is well taken but what  
I was trying to say was that since bash calls the bash installed by  
Macport I thought, by the same line of reasoning, apachectl should  
call apachectl installed by Macport. After all this is why we set the  
PATH that way; "if you have utilities or libraries from both MacPorts  
and OS X's standard install, the MacPorts libraries will be run  
instead of the ones provided by Apple."

What am I missing?


On Dec 16, 2007, at 4:39 PM, Ryan Schmidt wrote:

>
>> On Dec 16, 2007, at 15:05, Charlse Darwin wrote:
>>> $ env
>>> PATH=/Users/***/Documents/scripts/:/opt/local/bin:/opt/local/ 
>>> sbin:/bin:/sbin:/usr/bin:/usr/sbin:/Library/Frameworks/ 
>>> Python.framework/Versions/Current/bin/bin:/sbin:/usr/bin:/usr/ 
>>> sbin:/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin- 
>>> current
>>> $
>>>
>>> Is my env set up `correctly'?
>
> Your path is fine. (You do have some odd items in there... is there  
> really a directory "/Library/Frameworks/Python.framework/Versions/ 
> Current/bin/bin"? Note the two "/bin"s at the end? Also you have / 
> sbin, /usr/bin and /usr/sbin in your PATH twice each.)
>
> If you want MacPorts's apachectl to be in your PATH, you would need  
> to add /opt/local/apache2/bin to your PATH. However, you're not  
> meant to use apachectl directly. You're meant to use launchctl. See  
> the message that was shown to you when you installed apache2:
>
>> $ sudo port install apache2
>> --->  Fetching apache2
>> --->  Attempting to fetch httpd-2.2.6.tar.bz2 from http:// 
>> www.apache.org/dist/httpd
>> --->  Verifying checksum(s) for apache2
>> --->  Extracting apache2
>> --->  Applying patches to apache2
>> --->  Configuring apache2
>> --->  Building apache2 with target all
>> --->  Staging apache2 into destroot
>> --->  Creating launchd control script
>> ###########################################################
>> # A startup item has been generated that will aid in
>> # starting apache2 with launchd. It is disabled
>> # by default. Execute the following command to start it,
>> # and to cause it to launch at startup:
>> #
>> # sudo launchctl load -w /Library/LaunchDaemons/ 
>> org.macports.apache2.plist
>> ###########################################################
>> Warning: apache2 requests to install files outside the common  
>> directory structure!
>> --->  Installing apache2 2.2.6_0
>> --->  Activating apache2 2.2.6_0
>> --->  Cleaning apache2
>> $
>
>
> In MacPorts 1.6.0, this has been simplified to "sudo port load  
> apache2" (and "sudo port unload apache2" to unload it).
>
>
>> On Dec 16, 2007, at 3:47 PM, Daniel J. Luke wrote:
>>
>>> On Dec 16, 2007, at 3:25 PM, Charlse Darwin wrote:
>>>> It works! Thanks. However still we've got the following:
>>>> $ which apachectl
>>>> /usr/sbin/apachectl
>>>> # as opposed to (which as an example shows my env is set up  
>>>> correctly)
>>>
>>> this doesn't show that your env is set up 'correctly'
>>>
>>>> $ which bash
>>>> /opt/local/bin/bash
>>>> $
>>>
>>>
>>> I believe the apache2 port installs the apachectl binary that you  
>>> want in /opt/local/apache2/bin/ so if you want 'apachectl' by  
>>> itself to run the macports installed one, you need to put that  
>>> directory in your path before /usr/sbin
>>>
>>> ... but again, this isn't a macports problem.



More information about the macports-users mailing list