KNOWNHOST WIKI

User Tools

Site Tools


control-panels:directadmin:custom-package-item-creation-example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
control-panels:directadmin:custom-package-item-creation-example [2019/11/07 15:13]
Karson N. created
control-panels:directadmin:custom-package-item-creation-example [2020/06/16 14:33] (current)
Karson N.
Line 1: Line 1:
 ====== DirectAdmin's Custom Package Item Creation Example - Install WordPress ====== ====== DirectAdmin's Custom Package Item Creation Example - Install WordPress ======
- +----
-\\+
  
 Having WordPress automatically installed could save a lot of time for busy WordPress-only resellers, allowing them to focus on ways to optimize their server and their installations instead. However, there are those users that require something different, too. Some may require Joomla, DokuWiki, Drupal, or other CMSs and you wouldn't want WordPress installed automatically upon creating those accounts. A solution that would allow one to automate WordPress hosting while maintaining the ability to offer alternative CMSs on demand would be to create a custom WordPress package that would install WordPress upon account creation unless you selected an option instructing the server not to. This would allow you to install the requested CMS after account creation, but still automate the majority of your hosting service by installing WordPress by default for other accounts.  Having WordPress automatically installed could save a lot of time for busy WordPress-only resellers, allowing them to focus on ways to optimize their server and their installations instead. However, there are those users that require something different, too. Some may require Joomla, DokuWiki, Drupal, or other CMSs and you wouldn't want WordPress installed automatically upon creating those accounts. A solution that would allow one to automate WordPress hosting while maintaining the ability to offer alternative CMSs on demand would be to create a custom WordPress package that would install WordPress upon account creation unless you selected an option instructing the server not to. This would allow you to install the requested CMS after account creation, but still automate the majority of your hosting service by installing WordPress by default for other accounts. 
Line 8: Line 7:
  
 \\ \\
- 
 ===== Create the Custom Package Item Configuration ===== ===== Create the Custom Package Item Configuration =====
  
 First, create the following file: First, create the following file:
 +<code>
   /usr/local/directadmin/data/admin/custom_package_items.conf   /usr/local/directadmin/data/admin/custom_package_items.conf
 +</code>
  
 Add the following contents to the file: Add the following contents to the file:
 +<code>
   installWP=type=checkbox&string=Install WordPress&desc=Installs WordPress for domains automatically upon creation&checked=yes   installWP=type=checkbox&string=Install WordPress&desc=Installs WordPress for domains automatically upon creation&checked=yes
 +</code>
  
 Note that the above includes 'checked=yes', which means that this feature will be checked and enabled by default for new packages and for new users created under the package. You will have to manually remove the check if you don't want WordPress installed for the new package or for the new user.  If you'd prefer to manually enable the option to install WordPress automatically, then change this to 'checked=no' instead.  Note that the above includes 'checked=yes', which means that this feature will be checked and enabled by default for new packages and for new users created under the package. You will have to manually remove the check if you don't want WordPress installed for the new package or for the new user.  If you'd prefer to manually enable the option to install WordPress automatically, then change this to 'checked=no' instead. 
  
 Correct the ownership: Correct the ownership:
 +<code>
   chown diradmin. /usr/local/directadmin/data/admin/custom_package_items.conf   chown diradmin. /usr/local/directadmin/data/admin/custom_package_items.conf
-   +</code>
-\\  +
  
 +\\
 ===== Add the WordPress Installation Script as a Post Domain Creation Hook ===== ===== Add the WordPress Installation Script as a Post Domain Creation Hook =====
  
-Now, create the post domain creation script, /usr/local/directadmin/scripts/custom/domain_create_post.sh  with the following contents, chmod 700and chown it to diradmin.diradmin. +Now, create the post domain creation script, 
 +<code> 
 +  /usr/local/directadmin/scripts/custom/domain_create_post.sh 
 +</code> 
 +   
 +with the following contents, 
 +<code> 
 +  chmod 700 
 +</code> 
 + 
 +and chown it to diradmin.diradmin. 
  
 <file bash domain_create_post.sh> <file bash domain_create_post.sh>
Line 105: Line 116:
  
 \\ \\
- 
 ===== The Result Thus Far ===== ===== The Result Thus Far =====
  
Line 114: Line 124:
  
 NOTE: A separate script is required for subdomains. See our article discussing post- and pre- scripts available in DirectAdmin for an example script for installing WordPress for a subdomain automatically upon subdomain creation. ((https://www.knownhost.com/wiki/control-panels/directadmin/how-to-use-automation-via-directadmins-hooks)) NOTE: A separate script is required for subdomains. See our article discussing post- and pre- scripts available in DirectAdmin for an example script for installing WordPress for a subdomain automatically upon subdomain creation. ((https://www.knownhost.com/wiki/control-panels/directadmin/how-to-use-automation-via-directadmins-hooks))
 +**[[https://www.knownhost.com/wiki/control-panels/directadmin/how-to-use-automation-via-directadmins-hooks|Automation Via DirectAdmin's Pre and Post Hooks]]**
  
 \\ \\
- 
 ===== Create a Package with the Custom Package Item  ===== ===== Create a Package with the Custom Package Item  =====
  
Line 122: Line 132:
  
 {{:control-panels:directadmin:custompkgda.png?nolink&1200|}} {{:control-panels:directadmin:custompkgda.png?nolink&1200|}}
 +----
  
 \\ \\
- 
 ===== Add a User to the Package ===== ===== Add a User to the Package =====
  
Line 130: Line 140:
  
 {{:control-panels:directadmin:custompkgda-createuser.png?nolink&1200|}} {{:control-panels:directadmin:custompkgda-createuser.png?nolink&1200|}}
 +----
  
 You can click "Customize" next to the "User Package" option to make sure the custom package option is enabled.  You can click "Customize" next to the "User Package" option to make sure the custom package option is enabled. 
Line 136: Line 147:
  
 {{:control-panels:directadmin:custompkgsuccess.png?nolink&1200|}} {{:control-panels:directadmin:custompkgsuccess.png?nolink&1200|}}
 +----
  
 One could do the same for any other CMS whose installation and configuration can be automated. You would be able to automate hosting many types of CMSs and have them installed automatically depending on the type of package you assign to the account.  One could do the same for any other CMS whose installation and configuration can be automated. You would be able to automate hosting many types of CMSs and have them installed automatically depending on the type of package you assign to the account. 
  
 You could offer other custom package items, such as malware scanning/monitoring, site uptime monitoring, dynamic DNS, and whatever other services you can code solutions for. If you can write a script to accomplish the task, you can create a custom package item for it, which will be passed along to the pre- and post- script hooks, and thus, automatically execute the script upon specified actions. The possibilities are endless when you are permitted to create as you please via such features.  You could offer other custom package items, such as malware scanning/monitoring, site uptime monitoring, dynamic DNS, and whatever other services you can code solutions for. If you can write a script to accomplish the task, you can create a custom package item for it, which will be passed along to the pre- and post- script hooks, and thus, automatically execute the script upon specified actions. The possibilities are endless when you are permitted to create as you please via such features. 
control-panels/directadmin/custom-package-item-creation-example.1573161207.txt.gz · Last modified: 2019/11/07 15:13 by Karson N.