Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-01-2002, 10:17 AM
|
#1
|
Member
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48
Rep:
|
which /sbin redirect
Basically, when typing in the "which" command, I'm shown that a particular program that is the default is located in /sbin [i.e. such as apachectl ]
If I install a newer version and its executable is located in a different directory [i.e. /usr/local/apache/bin/apachectl], I'm still gonna' execute the origional /sbin apachectl.
How may I eliminate the /sbin executable and cause the system to think that my new installations are the default programs to select?
info : RedHat 7.3 web server setup.
Thanks ahead............. |;-)
|
|
|
09-01-2002, 10:42 AM
|
#2
|
Member
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Rep:
|
1. If you don't want the prog in /sbin, remove it and make a link to prog in /usr/local.../bin.
2. If you want any prog to be found before the other, just change your path to check the specific directory first.
(Eg. export PATH=/usr/local...:$PATH )
But I am not familiar with apachae server. May be that prog starts from some file and you might have to modify that.
--Sarin
|
|
|
09-01-2002, 01:42 PM
|
#3
|
Member
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48
Original Poster
Rep:
|
oohhhh yea.....save/rename origional program, then create link using same name, re-directed to the proper program I wish to run. Great! Works fine.
Placed in the /usr/sbin directory :
ln -s /usr/local/apache/bin/apachectl apachectl
I do still wonder what origionally deceided that the programs in /usr/sbin were the "Which" or primary programs to be run.
Much thanks for your help!
|
|
|
09-01-2002, 01:52 PM
|
#4
|
Member
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48
Original Poster
Rep:
|
ooppps, I should of read the entire reply :
2. If you want any prog to be found before the other, just change your path to check the specific directory first.
(Eg. export PATH=/usr/local...:$PATH )
Does that mean that The first instance of any given program will superceed a second one of the same name based on the sequence of pathing listed in the $PATH variable ?
ex :
apachectl is both in -
1. /usr/sbin
2./usr/local/apache/bin
If the $PATH is set as - /usr/sbin : /usr/local/apache/bin
it will distinguish the one in /usr/sbin as first choice ?
sorry, don't mean to be confusing.
|
|
|
09-01-2002, 03:50 PM
|
#5
|
Member
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
|
that is right. The system goes thru the entries in you PATH one by one till it finds the first executable with the name you typed.
BTW, did you install a later version of apache by yourself than the one that comes with RH7.3?
If you did, you might want to configure --with-layout=RedHat ( --enable-layout for apache 2.0.40, I think. See configure --help and config.layout )so that it will install the things you want where RedHat wants it.
So you will be able to type /etc/rc.d/init.d/httpd (start|stop) or /sbin/service httpd (start|stop) .. as root of course.
First, there were distributions. God said "Let there be LSB."
|
|
|
09-01-2002, 04:32 PM
|
#6
|
Member
Registered: Aug 2002
Location: Huntsville AL
Distribution: redhat 7.3
Posts: 48
Original Poster
Rep:
|
Yes, I did a tarball installation to embed PHP 4.0 in Apache.
I'll readup / use --with-layout parameter on my next install, as you suggest.
Very interresting, much thanks! 
|
|
|
All times are GMT -5. The time now is 08:20 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|