简体   繁体   中英

How can I change the version of apache on OSX Yosemite?

The default version of apache is 2.4.9. I downloaded 2.4.10 from apache website and "make & make install". However, when I do httpd -v, it still shows me 2.4.9.

Is there a way to change the default version or override?

Try typing

which httpd

to see the full path to the one that you are running. Mine is /usr/sbin/httpd - the standard one shipped with OS X.

Then check which directory you installed your new httpd into - probably /usr/local/bin . So the problem is not that it is not installed, but that OSX is looking at a different httpd from the one you installed.

To use the one that you have installed, you need to edit the file /usr/sbin/apachectl and find the line that says:

HTTPD='/usr/sbin/httpd'

and change it to point to wherever you installed your new apache.

My problem is more of I have two versions of Apache on my system. I have been making symlinks in /usr/bin/ but failed because I did not use absolute path in my ln command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM