Install ACSPanel Core Ensure ACSPanel is installed and configured as the base hosting control panel. This bundle extends its functionality for WordPress farms.
Bundle Installation
Add the bundle to composer.json of your ACSPanel project:
composer require acs/acspanel-wordpress
Register the bundle in config/bundles.php:
return [
// ...
AltCtrlSupr\ACSPanelWordpressBundle\ACSPanelWordpressBundle::class => ['all' => true],
];
Database Migration
Run the bundle’s migration to create the wp_hosting table (links hostings to WordPress databases):
php bin/console doctrine:migrations:migrate
First WordPress Farm
wp-content folder per blog (stored in hosting_id/wp-content).Verify Setup
Access the WordPress admin URL (e.g., https://yourdomain.com/wp-admin). The dashboard should load with the correct database connection.
Create Hosting Use ACSPanel’s UI/CLI to add a new hosting and select the "WordPress" template.
php bin/console acspanel:hosting:create --name="example.com" --template="wordpress"
Bundle Handles the Rest
wp-config.php with the correct DB credentials (auto-fetched from ACSPanel’s wp_hosting table).wp-content directory for themes/plugins/uploads.Access WordPress Point DNS to the hosting’s IP, then install WordPress via the web installer (or pre-populate with a default theme).
Shared Core, Isolated Content:
All blogs share the same WordPress core files (symlinked to /var/www/acspanel/wordpress/), but each has its own:
wp-content/ (themes, plugins, uploads).wp-config.php (auto-generated with unique DB credentials).Folder Structure:
/var/www/acspanel/
├── wordpress/ # Symlinked core (shared)
└── hostings/
├── example1.com/
│ ├── wp-content/ # Unique per blog
│ └── wp-config.php # Auto-generated
└── example2.com/
Hosting Templates:
Configure a "WordPress" template in ACSPanel’s HostingTemplate entity with:
# config/acspanel/hosting_templates.yaml
wordpress:
type: "wordpress"
core_path: "/var/www/acspanel/wordpress"
content_path: "wp-content"
db_prefix: "wp_"
Assign this template when creating hostings.
Database Management:
Use ACSPanel’s Database and DatabaseUser entities to manage WordPress databases. The bundle hooks into these to populate wp_hosting.
Automated wp-config.php:
The bundle generates wp-config.php dynamically using a twig template. Override this template to customize:
define('DB_NAME', '{{ database.name }}');
define('DB_USER', '{{ database.user }}');
define('DB_PASSWORD', '{{ database.password }}');
define('WP_CONTENT_DIR', '{{ hosting.path }}/wp-content');
Create/Update Hostings:
# Create a WordPress hosting
php bin/console acspanel:hosting:create --name="blog.example.com" --template="wordpress"
# Rebuild symlinks for a hosting (if core files change)
php bin/console acspanel-wordpress:hosting:setup --hosting-id=1
Backup/Restore: Leverage ACSPanel’s backup system to include:
wp-content/ (via HostingBackup).DatabaseBackup).Per-Blog Plugins/Themes:
Store plugins/themes in hosting_id/wp-content/plugins/ or hosting_id/wp-content/themes/. Use mu-plugins in the shared core for farm-wide plugins.
Domain Mapping: Use WordPress’s WordPress Multisite or plugins like WP Multi Network if managing subdomains.
Caching:
Configure shared caching (e.g., Redis) in wp-config.php:
define('WP_CACHE', true);
define('WP_REDIS_HOST', 'redis');
Custom Hosting Setup:
Override the bundle’s HostingSetupCommand to add pre/post-install hooks:
// src/Command/CustomWordpressSetupCommand.php
namespace App\Command;
use AltCtrlSupr\ACSPanelWordpressBundle\Command\HostingSetupCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CustomWordpressSetupCommand extends HostingSetupCommand
{
protected function execute(InputInterface $input, OutputInterface $output): int
{
parent::execute($input, $output);
// Add custom logic (e.g., install a default theme)
$this->installDefaultTheme($input->getArgument('hostingId'));
return 0;
}
}
Custom Database Tables:
Extend the wp_hosting table via migrations or use ACSPanel’s HostingExtension trait:
// src/Entity/ExtendedHosting.php
use AltCtrlSupr\ACSPanelWordpressBundle\Entity\HostingExtension;
class ExtendedHosting extends Hosting
{
use HostingExtension;
// Add custom fields (e.g., 'default_theme')
}
Symlink Permissions:
www-data) has read/execute permissions on the shared WordPress core:
chmod -R a+x /var/www/acspanel/wordpress/
chown -R www-data:www-data /var/www/acspanel/hostings/
php bin/console acspanel-wordpress:hosting:setup --hosting-id=1 --force
Database Prefixes:
wp_ by default. Conflict risk if hostings share a database (unlikely, but possible with custom setups).db_prefix in the hosting template or wp-config.php.WordPress Core Updates:
# Update core
cd /var/www/acspanel/wordpress/
git pull origin master
# Rebuild symlinks for all WordPress hostings
php bin/console acspanel-wordpress:hosting:setup-all
HostingEvent system to trigger this automatically after updates.PHP Memory Limits:
memory_limit in the shared php.ini or per-hosting .user.ini:
memory_limit = 512M
Multisite vs. Multitenancy:
wp-config.php and database.ls -la /var/www/
How can I help you explore Laravel packages today?