Manage website users, vhosts and PHP-FPM pools using Chef
Asked Answered
S

1

6

I'm looking to automate my cloud environment fairly soon using Chef so it can automatically scale instances and add them to HAProxy. One issue I'm having is with the concept of managing multiple virtualhosts and the users created with them to use in PHP-FPM pools.

What I'd like to do is:

  • Create a new user
  • Create a new virtualhost with domain information and aliases, define log * locations etc
  • Create public virtualhost directories, log file locations
  • Update PHP-FPM cgi file so it executes PHP files as that user in it's own pool

I'm a little new to Chef so I'm a puzzled when it comes to using one configuration to influence others. Can this be done?

Thanks

Stouthearted answered 30/4, 2015 at 9:24 Comment(0)
D
2

Chef work with recipes and cookbooks and have some resources.

  • Create a new user: for this, you can use user. Look that use a hash for password.

  • Create a new virtualhost with domain information and aliases, define log * locations etc: Here, you can use template and attributes.

  • Create public virtualhost directories, log file location: Here, you can use the resurce directory with correct user, group and permission.

  • Update PHP-FPM cgi file so it executes PHP files as that user in it's own pool: To edit PHP-FPM, you can use a bash.

OPSCODE have a coobook to install and config PHP. For example, see the recipes, templates and attributes and I have a little cookbook. For use any cookbook as dependencies, you can use the berkshelf to manage.

Dissert answered 30/4, 2015 at 11:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.