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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running apachectl(suse9.0)

Status
Not open for further replies.

pemorej

Technical User
Mar 12, 2004
75
PH
good day.

i'd like to ask if the "apachectl" file a "executable" or a "shell script"?

because i installed apache using its default installation/configuration(i followed the instructions at the apacge.org) but when i try to run apache from the console, it gives me the error "apachectl: command not found" then i checked the file and it says its a "shell script".

am i missing something? btw, im using suse 9.0

thanks.
 
Is the location of apachectl included in your $PATH? If not add it and make sure the script is executable. Alternatively, make sure it's executable (chmod 755 apachectl or similar) and specify the full path to it when starting up. HTH.
 
i went to the directory of the apachectl(/usr/local/apache2/bin/) and tried to run this command, "apachectl start" using the konsole, but it gives the error "bash: apachectl command not found". and when i check the apachectl using the konqueror, it shows the apachectl as a "shell script", not "executable".


thanks


p.s. suse 9.0 is my very first taste of linux :D
 
Can you post the output of an ls -la apachectl please? apachectl is actually a shell script, but it must have execuatble permissions to run it. This should enable us to confirm whether it has. Which user are you truying to start it as - we use oracle.
 
You either need to specify the full path to the executable, or it must be in your path. "/usr/local/apache2/bin" is usually not in your path, so you must specify the full path. Try:

"/usr/local/apache2/bin/apachectl"

Or, if you are already in /usr/local/apache2/bin, then just:

./apachectl

 
KenCunningham:
output of the ls -la apachectl
-rwxr-xr-x 1 root root

lgarner:
yes, i am in the path "/usr/local/apache2/bin/" and when i try to type "./apachectl", it displays the usage of "httpd".

i tried to type ./httpd, the error is this, "(98)Address already in use: make_sock: could not bind to address 192.168.0.1:80
no listening sockets available, shutting down
Unable to open logs"
 
apachectl requires some argument in order to work. Try:

apachectl start
apachectl stop
apachectl restart
apachectl graceful

for some. Normally, apache is started by "service httpd start".

The "Address already in use" message indicates that httpd is already running. Try stopping it ("service httpd stop", or killing the processes if necessary) and starting it again.
 
in addition to the last post, apachectl supports two other arguments, 'status'/'fullstatus', which return an url off the local web server, without success if that isnt enabled in your .conf.

. Mac for productivity
.. Linux for developement
... Windows for solitaire
 
i tried these commands:
apachectl start
apachectl stop
apachectl restart
apachectl graceful

and the error is "bash: apachectl: command not found

also this one: httpd start

and the error is "bash: httpd: command not found
 
Did you run these from the directory apachectl is in? Run it in the directory or using the full path, like:

./apachectl start (the ./ is important)

or

/usr/local/apache2/bin/apachectl start

both of which were mentioned by lgarner above.
 
command "./apachectl start" output:

(98)Address already in use: make_sock: could not bind to address 192.168.0.1:80
no listening sockets available, shutting down
Unable to open logs


p.s. yes i have done those commands IN the directory of the apachectl(/usr/local/apache2/bin/)


 
Again from lgarner, try:


service httpd stop or kill -9 <pid of http service>

then ./apachectl start
 
On my SuSE 9.0 box, I use
Code:
/usr/sbin/apache2ctl (start, stop, restart)
Note the path, and the filename.
 
Of course, I used YAST to install Apache2 from the SuSE distribution CDs... It's at version 2.0.47.
 
KenCunningham: the "service" command gives me this output: "bash: service: command not found" so i cant stop/kill the httpd process(if it is running anyway)
i'm getting pissed off already(lol)i think ill re install apache and see what happens.

i'll keep in touch here.

LawnBoy, thanks for you post but i have done that already.
 
apachectl is a script and it must be executable with permissions -rwxr-xr-x. Make sure that root has permissions to execute it. Also, ensure the first line of the script reads #!/bin/sh.

Then you can run ./apachectl start or /usr/local/apache2/bin/apachectl start depending on where you are in the filesystem.
 
aznluvsmc: yes the apachectl has "rwxr-rx-x" permissions. btw, what do you mean by "ensure the first line of the script reads #!/bin/sh"?
 
What part of "ensure the first line of the script reads #!/bin/sh" isn't clear? I wouldn't worry unduly about that, as it should be if your installation was OK. It functions as an instruction to make sure the script is run under sh, not any other shell.

Back to your previous query. You can find and kill any http processes using:

ps -ef | grep httpd

Note the pid of the process and issue a:

kill -9 <pid of httpd process>

Then try starting apache again.
 
There still might not be a "service" command in Suse. That's a RedHat-ism. Try running "/etc/init.d/httpd (start|stop|status|..etc)" instead.

In addition to checking the first line of apachectl, verify where your "sh" is by typing "which sh". They should match. /bin/sh is normal, but Suse might use something like /usr/bin/sh.



 
KenCunningham: i cannot start apache because "bash: apachectl: command not found"

lgarner: still "bash: httpd: command not found" when i try to run it on "etc/init.d/". btw, the "which sh" gives "/bin/sh".

ok now....i uninstalled apache2 using the yast, then installed it back again and the same result....when i uninstall apache2 in the yast, do i have to delete manually the folders of the apache2 in the system?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top