Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

/usr/local/apache2/bin/apachectl start 1

Status
Not open for further replies.

CodeDeficitDisorder

Technical User
Jul 18, 2002
66
US
I just loaded Suse 9.1 with a minimum install with just enough apps to download and install Apache2 from apache.org.

Now that it's installed, when I run apachectl start, I get the following:

bash: apachectl: command not found

I'm running it from:
/usr/local/apache2/bin

When I do a ls from the console in that directory, I see apachectl listed in green.

Did I install Apache incorrectly, or is there something else that I should know for starting the httpd service?

Thanks!
 
Are you running apachectl as root or another user? Since Apache binds to a privileged port, you'll have to be root to start it.

If that isn't the problem, does root have execute permissions on the file? Check by performing [tt]ls -l[/tt]


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks for the reply. I logged in as myself, and I immediately typed in su, and entered my root password. I then typed in whoami to make sure it replied as root. I'm positive that I'm logged in as root.

I typed in ls -l and next to apachectl it shows:
-rwxr-xr-x 1 root root 3091 2004-10-23 07:10 apachectl

I'm not sure what that means, but I still can't launch apachectl start.

Anyone else have a suggestion?

Thanks in advance!
 
root doesn't have . (the current directory) in his path for security reasons. You would need to type /usr/local/apache2/bin/apachectl to get it to run. Or ./apachectl if you're in the directory.
 
ericbrunson,

I thank you for the reply. Going to the path and typing:

./apachectl start

actually worked. But my question then becomes, what's the difference between typing that, or just typing:

apachectl start

which doesn't work?

Thanks!!!

Jamie

 
type 'echo $PATH'

it will show you the colon delimited list of directories that the shell searches to find an executable when you type it without a path prefix.

Unlike DOS, Unix doesn't include the current directory ("." for short) by default, you are required to explicitly put it in the path. For security reasons root should never include the current directory it it's path.

So, typing "apachectl" searches your PATH for the executable file, but "." is not in there. Typing "./apachectl" says to run the apachectl in the current directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top