site¶
Performs website specific operations
Usage:
wo site (command) [options]
subcommand | description |
---|---|
create | Create site with WordOps |
update | Update site type or configuration |
info | Get site information |
show | Show site Nginx configuration |
edit | Edit site Nginx configuration |
delete | Delete site |
list | List all sites |
enable | Enable site in Nginx |
disable | Disable site in Nginx |
cd | Move into site webroot directory |
site create¶
Usage¶
wo site create [<site_name>] [options]
Basic sites¶
HTML site¶
To create simple html website use this command.
wo site create site.tld --html
PHP site¶
To create simple php website with no database use this command.
wo site create site.tld --php
PHP+MySQL site¶
To create simple php website with database use this command.
wo site create site.tld --mysql
NOTE: You can find MySQL database details in /var/www/site.tld/wo-config.php
.
Proxy site¶
To create site with Proxy configuration you can use --proxy during site creation
wo site create site.tld --proxy=127.0.0.1:3000
This will create proxy site site.tld with proxy destination as 127.0.0.1:3000. Port is optional. Default port: 80.
Alias site¶
To create an alias site you can use --alias during site creation
wo site create site.tld --alias sitetoredirect.tld
It will create a nginx vhost for site.tld which redirect to sitetoredirect.tld.
WordPress¶
Following are the WordPress website types you can create website based on Cache Mechanism
Standard WordPress site
wo site create site.tld --wp
WordPress site + Nginx fastcgi_cache
wo site create site.tld --wpfc
WordPress site + Redis cache
wo site create site.tld --wpredis
WordPress site + WP-Super-cache
wo site create site.tld --wpsc
WordPress site + WP-Rocket cache
wo site create site.tld --wprocket
WordPress site + Cache enabler
wo site create site.tld --wpce
Enable Ultimate Nginx bad blocker on new site
wo site create site.tld --ngxblocker
Cheatsheet¶
Cache | single site | multisite w/ subdir | multisite w/ subdom |
---|---|---|---|
NO Cache | --wp |
--wpsubdir |
--wpsubdomain |
WP Super Cache plugin | --wpsc |
--wpsubdir --wpsc |
--wpsubdomain --wpsc |
Nginx fastcgi_cache | --wpfc |
--wpsubdir --wpfc |
--wpsubdomain --wpfc |
Redis cache | --wpredis |
--wpsubdir --wpredis |
--wpsubdomain --wpredis |
WP-Rocket plugin | --wprocket |
--wpsubdir --wprocket |
--wpsubdomain --wprocket |
Cache-Enabler plugin | --wpce |
--wpsubdir --wpce |
--wpsubdomain --wpce |
Extra settings¶
Define WordPress administrator user¶
To define WordPress administrator user during site creation use
wo site create site.tld --user=admin
This will create admin as administrator user in WordPress during installation. If not defined it will take git user name.
Define WordPress administrator password¶
To define WordPress administrator password during site creation use
wo site create site.tld --pass=password
This will set defined password as administrator password. If not defined it will generate random pasword for administrator. If you have special characters, you can quote them using single quotes like this:
--pass='my$secret&'
Define WordPress administrator email¶
To define WordPress administrator email during site creation use
wo site create site.tld --email=wo@site.tld
This will set defined email as administrator email. If not defined it will set git email as administrator email.
Virtual host only¶
To create WordPress site and database without installing it, you can use --vhostonly during site creation
For example, you can only create vhost and database without installing WordPress using following command:
wo site create site.tld --wp --vhostonly
Additional features¶
Let's Encrypt¶
WordOps supports Let's Encrypt out of the box.
Domain¶
wo site create site.tld --wp --letsencrypt
This command will issue a certificate for site.tld + www.site.tld.
Subdomain¶
You can also issue Let's Encrypt certificates with subdomains.
wo site create sub.site.tld --wp --letsencrypt
Since the release v3.9.8.4, WordOps will automatically detect if the site is a domain or a subdomain, and will not issue a certificate for www alias with subdomains
Wildcard¶
Since the release v3.9.6, WordOps supports Let's Encrypt Wildcard SSL certificates with DNS API validation. Before issuing a wildcard certificate, it require to define the DNS API crendentials for acme.sh.
Example with Cloudflare DNS:
export CF_Key="d7eab56a903f25dd4xxxxxxxxxxxxxxxxxxxx"
export CF_Email="email@domain.com"
Info
More example in our guide about DNS API configuration
After you define those variables with the command export
, you can issue your certificate with
wo site create site.tld --wp --letsencrypt=wildcard --dns=dns_cf
--dns=dns_cf
can be replaced with another DNS provider supported by acme.sh. For DigitalOcean, it would be--dns=dns_dgon
HSTS¶
Additionally you can enable HSTS on your site by adding the flag --hsts
with --letsencrypt
wo site create site.tld --wp --letsencrypt --hsts
PHP 8.2 & PHP 8.2¶
To create site with PHP 8.2 you can use --php82 during site creation
For example, you can create WordPress site running on PHP 8.2 using following command:
wo site create site.tld --wp --php82
For a WordPress site running on PHP 8.3:
wo site create site.tld --wp --php83
To create simple php site running with PHP 8.3 with no database, you can use this command:
wo site create site.tld --php83
This is the same with PHP 8.2:
wo site create site.tld --php82
site update¶
Update site configuration
Pre-update policy¶
wo site update
command follows following procedure while updating current site.
Before Updating any site:
- Creates nginx configuration backup for site.
- Moves htdocs to backup while updating HTML/PHP/MySQL site.
- Creates database dump in backup.
- While updating current MySQL site WordOps uses same database for installing WordPress tables.
- All these backup are stored outside htdocs, in backup directory.
WordOps possible Update Options¶
WordOps Possible Site Update Options | |||||||||||||||
html | php | mysql | wp | wpfc | wpsc | wpredis | wpsubdom | wpsubdom + wpfc | wpsubdom + wpsc | wpsubdir | wpsubdir + wpfc | wpsubdir + wpsc | wpsubdir + wpsc | ||
html | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
php | ✘ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
mysql | ✘ | ✘ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
wp | ✘ | ✘ | ✘ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
wpfc | ✘ | ✘ | ✘ | ✔ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
wpsc | ✘ | ✘ | ✘ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
wpredis | ✘ | ✘ | ✘ | ✔ | ✔ | ✔ | - | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
wpsubdom | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | - | ✔ | ✔ | ✘ | ✘ | ✘ | ✘ | |
wpsubdom+wpfc | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔ | - | ✔ | ✘ | ✘ | ✘ | ✘ | |
wpsubdom+wpsc | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔ | ✔ | ✔ | ✘ | ✘ | ✘ | ✘ | |
wpsubdom+wpredis | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔ | ✔ | - | ✘ | ✘ | ✘ | ✘ | |
wpsubdir | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | - | ✔ | ✔ | ✔ | |
wpsubdir+wpfc | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔ | - | ✔ | ✔ | |
wpsubdir+wpsc | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔ | ✔ | - | ✔ | |
wpsubdir+wpredis | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔ | ✔ | ✔ | - |
Example: updating site from basic wp to wp + fastcgi_cache:
Usage¶
Usage:
wo site update [<site_name>] [options]
options | description |
---|---|
--html |
update to html site |
--php |
update to php site |
--mysql |
update to MySQL + PHP site |
--php74 |
update site to PHP 7.4 |
--php80 |
update site to PHP 8.0 |
--php81 |
update site to PHP 8.1 |
--php82 |
update site to PHP 8.2 |
--php82 |
update site to PHP 8.3 |
--wp |
update site to WordPress without cache |
--wpfc |
update site to WordPress with fastcgi_cache |
--wpsc |
update site to WordPress with wp-super-cache plugin |
--wpredis |
update site to WordPress with redis-cache |
--wprocket |
update site to WordPress with WP-Rocket plugin |
--wpce |
update site to WordPress with Cache-Enabler plugin |
--wpsubdir |
update site to WordPress multisite on subdirectories |
--wpsubdomain |
update site to WordPress multisite on subdomains |
--password |
update admin password for a WordPress site |
--letsencrypt ,-le |
secure site with Let's Encrypt SSL certificate |
--letsencrypt=wildcard |
secure site/multisite with a wildcard SSL certificates |
--letsencrypt=off |
disable Let's Encrypt SSL certificate |
--dns , --dns=<dns api provider> |
issue Let's Encrypt certificate with DNS validation. default: dns_cf |
--hsts , --hsts=off |
Enable or disable HSTS on site secured with Let's Encrypt |
--ngxblocker , --ngxblocker=off |
Enable or disable Ultimate Nginx bad blocker |
Examples¶
Update a WordPress site without cache (--wp
), to WordPress with Nginx fastcgi_cache
wo site update site.tld --wpfc
Update a WordPress site running with PHP 8.2 to PHP 8.3
wo site update site.tld --php83
Update a site running with PHP 8.3 to PHP 8.1
wo site update site.tld --php81
Update a site running with PHP 8.1 or PHP 8.2 to PHP 8.3
wo site update site.tld --php83
Update a WordPress site with Nginx fastcgi_cache to WordPress with redis-cache
wo site update site.tld --wpredis
site info¶
Get site information including cache backend, PHP version or user database credentials
Usage:
wo site info [<site_name>]
site delete¶
Delete site including webroot and database:
Usage:
wo site delete [<site_name>] [options]
options | description |
---|---|
--no-prompt |
delete website without confirmation prompt |
--files |
delete only website files |
--db |
delete only database |
site edit¶
Edit site Nginx configuration
Usage:
wo site edit [<site_name>]
You will be prompted to choose the text editor you prefer. Nano is highly recommended for beginners.
site cd¶
Move into a site webroot directory
Usage:
wo site cd [<site_name>]
site list¶
List all sites managed with WordOps
Usage:
wo site list
site show¶
Display site Nginx configuration
Usage:
wo site show [<site_name>]
site disable¶
Disable site Nginx vhost
Usage:
wo site disable [<site_name>]
site enable¶
Enable site Nginx vhost
Usage:
wo site enable [<site_name>]