/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
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.
-
Thank You.. when Iam restarting the server then it is not workingprince_faisal– prince_faisal2018-11-08 06:15:03 +00:00Commented 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).xenoid– xenoid2018-11-08 08:20:14 +00:00Commented Nov 8, 2018 at 8:20