skip to Main Content

I want to install apache using chef. But when I use:

package 'httpd' do
  action :install
end

It will install apache inside /etc/httpd but I want to install apache in another directory (for example: /abc).

2

Answers


  1. Chosen as BEST ANSWER

    I have created a custom package and then installed in to desired loaction it helped me a lot Thank you very much everyone


  2. The Chef package resource uses the underlying system’s package manager such as yum, apt.

    You haven’t mentioned the distribution you are running on. However, using package 'httpd' on YUM based distribution will trigger yum install httpd

    So, first find how you can change/set the install path using the underlying OS command. E.g. for YUM:

    yum --installroot=<path> install <package>
    

    In a Chef package resource:

    package 'httpd' do
      options '--installroot=/abc'
      action :install
    end
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search