0

/opt/rh/httpd24/root/usr/sbin/httpd -v command is working on my server but httpd -v is not working. it says command not found. How can i fix this so that httpd -v show me the apache version.

1 Answer 1

2

The difference between /opt/rh/httpd24/root/usr/sbin/httpd -v and just httpd -v is that in the first case the system runs a very specific executable while in the second case it searches the executable in the directories that are listed in the PATH environment variable. But eventually this is going to be the very same executable(*)

To add the required directory to the path, you can use:

export PATH=$PATH:/opt/rh/httpd24/root/usr/sbin/

(*) unless you have installed several instances of httpd... But in that case what is going to be important is the version of httpd which is run as a service, in which case you would have to find the declaration of the service, that likely has the full path to the httpd executable to be used by the service.

2
  • Thank You.. when Iam restarting the server then it is not working Commented Nov 8, 2018 at 6:15
  • The "server" doesn't the PATH you use. The server definition should have the full path to the executable (and the path you have is strange... doesn't look installed correctly). Commented Nov 8, 2018 at 8:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.