Customization of wordpress installation

skyrant

Member
Feb 11, 2020
17
2
3
Germany
cPanel Access Level
DataCenter Provider
Where can i find the script that creates the wordpress installation? I am not talking about /usr/local/cpanel/3rdparty/bin/wpAutoInstall.sh but the actual script that creates the database, filesystem and wp_config.

Thanks in advance.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
Hello,

For starters [I]/usr/local/cpanel/3rdparty/bin/wpAutoInstall.sh [/I]is not a cPanel script nor is it something that comes installed on cPanel systems by default. This would be something custom.

The installation is handled by a series of Perl modules, most of which are located at /usr/local/cpanel/Cpanel/WordPress

What specifically are you looking to do? This might be a better place to start so I can guide you to the correct location.
 

skyrant

Member
Feb 11, 2020
17
2
3
Germany
cPanel Access Level
DataCenter Provider
It does not come by default but it is in
Home » cPanel » Install cPAddons Site Software
and says Vendor is cPanel, L.L.C.

I need very a specific installation of Wordpress with customization in more places than i want to elaborate here. Let's just say i want to customize the process to my customers needs with specific Theme, plugins, directory structure and users.

Looks like that directory you mentioned is for the cPanel Wordpress Manager, scanning and managing already existing wordpress installations.

Which script is creating the database and copying the wordpress files?

Thanks in advance.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
It does not come by default but it is in and says Vendor is cPanel, L.L.C.
cPaddons is cPanel, and we ship Wordpress in an RPM that's just default WordPress - the script you noted:

Code:
/usr/local/cpanel/3rdparty/bin/wpAutoInstall.sh
Is not something present on default installs (if it was previously it isn't any longer though I've not seen this before)

The WordPress manager handles all the WordPress related functions now. We use Wordpress's package and you'd manage all of the creation through perl modules associated with the WordPress manager. When you create a new site it looks like it's using: cPanel::Blogs::WordPressX&view=install you might check: /usr/local/cpanel/cpaddons/cPanel/Blogs/ for this as well (actually this is what I was looking for yesterday).
 

skyrant

Member
Feb 11, 2020
17
2
3
Germany
cPanel Access Level
DataCenter Provider
Hi Lauren,

Thanks for the reply. This looks pretty easy, there is a tgz of the wordpress install, a script that unpacks and creates the database. Beautiful.

Let's say i modify this and there is an update of cPanel. Would my changes be overwritten regularly and/or is there a way to prevent that?

I think i have to take a deeper look at your Developer Documentation but this is a good starting point.

Thanks
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
It depends on how you modify it, what specifically are you planning on modifying? You don't have to indicate the specific changes you're making just how you're going to implement the modification.
 

skyrant

Member
Feb 11, 2020
17
2
3
Germany
cPanel Access Level
DataCenter Provider
It depends on how you modify it, what specifically are you planning on modifying? You don't have to indicate the specific changes you're making just how you're going to implement the modification.
Sidenote: I am evaluating cPanel right now if it meets requirements for us and how flexible it is in customizing it for our customers.

In the first step i want to remove the unpacking of the .tgz (see more below), simply modify the WordpressX.pm file and add my own scripts in the "run_scripts =>" section. Once i know more about the cPanel API the plan is to write our own "cpaddon" that would be an alternative to yours customized for us so we don't run into any conflicts during updates of cPanel.

Using a tar archive is not really a good solution in my opinion so we have a different approach.

I am currently managing all wordpress customers with a wordpress version directly from the wordpress git repository. This is done by putting wordpress into a subdirectory and pulling the config and wp-content up one level into the root. Then you just need to so some config changes and it runs just like any other wordpress.

PHP:
// inside the user home directory public_html

index.php             // require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
wp-config.php     //customized WP_SITEURL, WP_CONTENT_DIR, WP_CONTENT_URL
wp-content/         //all content users can edit like theme and plugins is in here.
wordpress/          //this is a simple git clone of the wordpress github. It will also be updated with a few simple git commands
This is the birds eye overview of our custom Wordpress management. We would like to keep that in place as it has proven to be a very secure and easy to maintain setup.