The command “Webinoly” allows us to make some changes in the configuration, as well as to consult some aspects of the web server. We will explain in detail the use of this command.
sudo webinoly <option>
sudo webinoly -update sudo webinoly -login-www-data=on sudo webinoly -clear-cache=all sudo webinoly -backup=s3 -profile=mysite -run
Tools & Updates
Very useful commands and tools. Don’t forget to keep your system updated!
How do I upgrade to the latest version of Webinoly?
It is very simple, you just have to execute the following command and it will download and install the most recent version of this application.
sudo webinoly -update
It is important to note that this command only updates the Webinoly app, not the other packages installed in the server. You should run a server update and upgrade
sudo apt update && sudo apt -y upgrade at least once a month.
Recover MySQL username and password
Webinoly saves a copy of users and passwords generated automatically during the installation of MySQL since these data are necessary to execute some commands, like the creation of the database for WordPress sites, among others.
sudo webinoly -dbpass
The “raw” option is also supported to remove format:
sudo webinoly -dbpass -raw.
Change MySQL password
We can only modify the password of the “root” and “admin” users, they are the only ones that Webinoly saves and uses to work.
sudo webinoly -mysql-password
We can also use it in the following way:
sudo webinoly -mysql-password=[user,pass].
Access to phpMyAdmin and other tools
At any time you can modify the access port (0-65535), by default we use port 22222 or the one you chose during the initial installation.
sudo webinoly -tools-port
In the same way, you can automate the execution of the command as follows:
sudo webinoly -tools-port=19816
It is also possible to define an existing domain for “only access” to these tools.
sudo webinoly -tools-site=domain.com
Any request from another domain will be blocked.
Now you can access your tools
sudo webinoly -tools-site=default
Import MySQL database
Import a MySQL database directly from the command line.
sudo webinoly -db-import
# Examples sudo webinoly -db-import -file=/folder # Support for external database sudo webinoly -db-import -file=/folder -external-db=[user,pass,host:port]
NGINX & FastCGI Cache
NGINX and FastCGI Cache global configuration and management.
FastCgi Cache settings
Webinoly configures three time values for Cache retention.
- HTTP Code 200: Successful requests.
- HTTP Code 301, 302, 303, 307, 308, 404, 410, 451: Redirects and pages not found.
- Inactivity time: Remove cached data that has not been accessed in the specified time.
To modify the configuration you only have to execute the following command:
sudo webinoly -config-cache
The time parameters must be entered in the following format:
- s – seconds
- m – minutes
- h – hours
- d – days
- w – weeks
- M – Months
- y – years
The command also allows to automate its execution of the following way:
sudo webinoly -config-cache=[10d,1w,5m]
The first argument is the response for 200 codes, the second the downtime and the third for redirects.
# Example: sudo webinoly -clear-cache=fastcgi sudo webinoly -clear-cache=all
Exclude URL from Cache
Exclude an URL from being cached by FastCGI.
sudo webinoly -skip-cache=/page
Due to WordPress compatibility, this group of pages is included by default:
# Exclude one page sudo webinoly -skip-cache=/test # Regex supported (sensitive|insensitive) sudo webinoly -skip-cache='^(one|two)$' -regex=insensitive # List of pages excluded sudo webinoly -skip-cache -list # Remove page from being excluded sudo webinoly -skip-cache=/test -delete
-list -raw option is supported.
Query-String support in Cache
URL’s that contains query-strings are never cached by default. You can specify some exceptions to be cached.
sudo webinoly -query-string-cache
Also, you can specify which query-strings (if present), should never be cached.
sudo webinoly -query-string-never-cache
# Example: sudo webinoly -query-string-cache=one sudo webinoly -query-string-never-cache=two # example.com/?one=true&three=true (Cached) # example.com/?one=true&two=true (No-Cached) ----- # Remove query-string sudo webinoly -query-string-cache=one -delete sudo webinoly -query-string-never-cache=two -delete # Lists supported sudo webinoly -query-string-cache -list sudo webinoly -query-string-never-cache -list
-list -raw option is supported.
Block and deny IP address
To restrict access in Nginx to a specific IP or block of addresses.
sudo webinoly -blockip=188.8.131.52
In the same
Or to list all the IP’s that have been blocked:
sudo webinoly -blockip -list
# Tip - RAW option is supported to remove format. sudo webinoly -blockip -list -raw # Remove IP from the list sudo webinoly -blockip -purge sudo webinoly -blockip=184.108.40.206 -purge
It will be deprecated very soon. Per-site option will be still available.
sudo webinoly -yoast-sitemap=on
Enable/disable (on/off) this feature globally, this way when a site is created this feature will be enabled or disabled by default according to this setting. For a specific site or after a site is created, you can activate/deactivate this feature using our “site” command.
If you access your server from your browser using the IP of the server you will see the Welcome page of Nginx, which is the answer that is configured by default.
Webinoly allows you to customize the site or answer by default.
sudo webinoly -default-site=<option>
default – Nginx default behavior.
blackhole – Any request that does not correspond to an existing domain in the server will return a 444 code in response or in other words, the server will not respond to those requests.
domain – Define an existing domain or site as default response to any request.
HTTP Headers Configuration
Custom HTTP Headers supported:
- HTTP Strict-Transport-Security (HSTS)
These headers are also added but cannot be customized: X-Frame-Options SAMEORIGIN X-Content-Type-Options nosniff X-XSS-Protection "1; mode=block"
Please, read the oficial documentation before any modification: Referrer Policy
sudo webinoly -header-referrer
- no-referrer-when-downgrade (default)
HTTP Strict Transport Security
Please, read the oficial documentation before any modification: HTTP Strict Transport Security
sudo webinoly -header-hsts
# To test before preload (Any number less than 1y) # Strict-Transport-Security: max-age=300; includeSubDomains sudo webinoly -header-hsts=300 # Preload option enabled # Strict-Transport-Security: max-age=63072000; includeSubDomains; preload sudo webinoly -header-hsts=preload # To restore the default value # Strict-Transport-Security: max-age=31536000 sudo webinoly -header-hsts=default
After “preload” is enabled you should submit your site here: HSTS Preload
Content Security Policy
Please, read the oficial documentation before any modification: Content Security Policy
sudo webinoly -header-csp
The content of this header can be long and complex, so it is not supported on the command line as it is usually done in Webinoly.
# Enter this command and then you will be asked to enter the custom content for this header. sudo webinoly -header-csp
Another option for unattended scripts you can create a file
/opt/webinoly/templates/source/csp_webinoly.data and then use the
reload option. In one line, without double-quotes, only the first line of the file will be readed and loaded.
default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'
And then, just run:
sudo webinoly -header-csp=reload
For testing you can use the
Content-Security-Policy-Report-Only instead. To enable this feature use the
Server management tools and configuration.
Allow SFTP access to www-data user
Very useful for uploading files through SFTP, this user has very limited access permissions and can only be used to log in through SFTP and with access only to the file folders of your websites.
sudo webinoly -login-www-data=on
You can block the access at any time.
sudo webinoly -login-www-data=off
* In case you are using SSH keys, www-data user will use the same SSH Keys as the main user.
This command will set the timezone in PHP and in Ubuntu operating system.
sudo webinoly -timezone
You can also directly pass the data in the following way:
sudo webinoly -timezone=America/Mexico_City. Check the supported timezones.
SMTP setting for sending emails
Postfix is always installed with Webinoly for sending emails, for instance, all your WordPress sites notifications, and now you can also configure it to send emails using an external SMTP provider such as Amazon SES, Mandrill, Mailgun, SendGrid or any other provider.
sudo webinoly -smtp
All the server outgoing emails from any of your websites will be sent through this service.
# Test the SMTP service from command line: echo "Subject: test" | sendmail email@example.com # Remove the SMTP configuration and use the Postfix default configuration sudo webinoly -smtp -purge # Tip for Unattended Scripts sudo webinoly webinoly -smtp=[smtp_host,user,password,mainhost]
Webinoly has support for automated backups:
- Backups to S3 (AWS)
- Local WordPress database backup
sudo webinoly -backup
* You can manually configure any backup supported by Duply and Duplicity: Amazon S3, Backblaze B2, DropBox, FTP, GIO, Google Docs, Google Drive, HSI, Hubic, IMAP, local filesystem, Mega.co, Microsoft Azure, Microsoft Onedrive, par2, Rackspace Cloudfiles, rsync, Skylabel, ssh/scp, SwiftStack, Tahoe-LAFS, WebDAV.
Local WP database backup
At any moment you can make a database backup of any of your WordPress sites and it will be saved locally in your server storage.
sudo webinoly -backup=local
# Examples sudo webinoly -backup=local -wp=example.com -destination=/folder # Default destination: $HOME/webinoly-backups/example.com sudo webinoly -backup=local -wp=example.com # Limit the number of backups to keep (-max) and send it to S3 sudo webinoly -backup=local -wp=example.com -destination=/folder -max=5 -bucket=bucketname/folder
The “max” option deletes any file in the destination directory.
In case your WP site is connected to an external database, it will be necessary to enter the username and password. To skip these questions you can use the
Backups to AWS S3
Incremental backups of any folder and send it to S3.
Create as many profile backups as you need.
sudo webinoly -backup=s3
There are some similar services that offer S3 compatibility. Webinoly is configured to accept only names that comply with the official bucket naming convention. If you want to use a service compatible with S3 and you need to enter the URL, you can do it by creating the profile and later editing the profile configuration file to modify the bucket name manually and enter the desired URL.
Before you can make a backup, you need to have your IAM Credential with full access to S3 service.
sudo webinoly -aws-s3-credentials
# To skip questions (unattended) sudo webinoly -aws-s3-credentials=[aws_access_key_id,aws_secret_access_key] sudo webinoly -backup=s3 -profile=name -bucket=bucketname/folder -source=/folder -max-age=2M # For AWS EC2 instances linked to an IAM Role # This way it is not necessary to save credentials on the server. sudo webinoly -aws-s3-credentials=awsiamrole
-max-age argument is optional and is the time frame for old backups to keep, the default value is 1M and format is (s, m, h, D, W, M, Y).
To run a new backup:
sudo webinoly -backup=s3 -run
Delete an existing profile:
sudo webinoly -backup=s3 -delete
sudo webinoly -backup=s3 -list
Display info about an existing profile:
sudo webinoly -backup=s3 -info
Restore or recover the most recent backup:
sudo webinoly -backup=s3 -restore=/folder
The destination folder must exist and be empty.
# Backup recover from an specific date sudo webinoly -backup=s3 -restore=/folder -date=2020/4/27 # Date format supported: 2020-01-25T07:00:00+02:00 (full date time) 2020/3/5 (YYYY/MM/DD) 12D (12 days ago) 1h78m (1 hour 78 minutes ago)
You can always use
-profile=name to skip questions and
-list -raw is supported to remove format characters.
-add-db-pre option allows you to configure an automatic backup of a database immediately before executing the selected S3 profile.
sudo webinoly -backup=s3 -add-db-pre=example.com
# Example # DB backup every time S3 profile backup runs. # Limit to 5 files to keep in DB local backup folder. # Also, send the DB backup to a different bucket. # DB is now backed up in 3 different locations: local folder (default), S3 backup profile and S3 bucket for DB. sudo webinoly -backup=s3 -add-db-pre=example.com -max=5 -bucket=bucketname/folder
Send file to S3
Send a single file to AWS S3.
sudo webinoly -backup=s3 -send-to-s3=/file -bucket=bucketname/folder
Datadog is an external service for monitoring servers and applications, through a SaaS-based data analytics platform.
sudo webinoly -datadog
You only need an API key and Webinoly will automatically install and configure the Datadog agent on your server, including integrations with Nginx, PHP-FPM, MySQL and Redis, in addition to the logs of each service and each site hosted on your server.
# Examples: # Full installation sudo webinoly -datadog # Install only the agent, without integrations or logs. sudo webinoly -datadog=123456789 -integrations=off -logs=off # Set up an integration (nginx, fpm, mysql, redis) sudo webinoly -datadog -integrations=nginx # Remove an integration sudo webinoly -datadog -integrations=nginx -purge # Configure the logs of an integration (on/off) sudo webinoly -datadog -integrations=nginx -logs=on
Remember that in order to see the integrations data from your server, you need to manually install each of them in your Datadog account (Integrations menu). Also, for “Logs” you need to have an active plan with “Log Management” included in your Datadog account.
To completely remove Datadog from your server:
sudo webinoly -datadog -purge
Update, modify or reset server settings
This is an advanced function and you only have to make this type of modifications if you know the impact and result that could cause in the behavior of your server, otherwise we recommend to keep the configuration set by default.
The Webinoly configuration file is located in
/opt/webinoly/webinoly.conf and only the following variables can be updated manually, you must be careful not to modify any other values.
To modify a variable in the configuration file you can use the command
-conf-value_<variable>=<value> as follows:
sudo webinoly -firstname.lastname@example.org.
After any modification to the Webinoly configuration file, you should do a
-server-reset to changes take effect, this command can update the configuration of a specific package
(nginx, php, all) in the following way:
sudo webinoly -server-reset=php. If the packages (stack) have not been installed yet, the values will be loaded automatically when you do the installation, if they are already installed, the current configuration will be updated and any changes made manually by the user will be lost.
-server-reset option can be used in many different situations when you want to restore the default configuration or remove unwanted changes you probably made manually.
For example, when you update your hardware specs, more RAM was added, you can update your server configuration with server-reset to take the new values. Also, the permissions (755 and 644) and owner (www-data) on the folders and files of your sites will be restored.
The size of the SWAP file is calculated according to the amount of RAM available, if you need to force Webinoly to recalculate this value, you must use the parameter
max-mb-uploads – Defines the maximum size of an uploaded file, by default a value of 50MB is declared.
redis-max-mem – It establishes the memory limit that Redis can use and is a percentaje of the total RAM available, default value is 10.
swap-mem – Webinoly automatically creates a SWAP memory partition, the size is determined based on the amount of RAM installed on your server.
php-max-mem – It establishes the memory limit that a PHP script can use, it is a direct adjustment to the
memory_limit variable in the
php-max-time – It directly affects the PHP variables
request_terminate_timeout, the default value is 300.
php-max-child – Determine the maximum number of
max_children processes in PHP. Webinoly automatically adjusts this value according to the resources available on the server. Modifying this value can have consequences on server performance, it is not recommended to modify it.
php-pm – Webinoly automatically adjusts this value according to the resources available on the server. Modifying this value can have consequences on server performance, it is not recommended to modify it. You can force one of the options (ondemand, dynamic or static).
php-info – By default, all PHP Webinoly sites created from version 1.12.0 have support for PATH_INFO. With the value “false” you can remove the support in the newly created sites. WordPress sites do not have support for PATH_INFO as it is not required.
fd-ratio – Linux automatically configures the “file descriptors” limit based on system RAM. More or less it is based on 10% of the RAM taking 1kb for each file to calculate that value. This variable in the configuration file modifies the percentage of RAM taken to perform this calculation.
nginx-fd-ratio – From the total of file descriptors calculated in the previous variable, the percentage assigned or allowed to be used or available for Nginx is calculated. That is, this variable is a percentage of the previous total.
nginx-ppa – We can choose the option “mainline” or “stable”. This option only works before Nginx is installed.
log-lines – It establishes the number of lines that the output of the log command will have, the default value is 10.
# Numeric value in Megabytes max-mb-uploads:100 php-max-mem:256 # Numeric value in Gigabytes swap-mem:2 # Numeric value in % percentage fd-ratio:50 nginx-fd-ratio:80 nginx-ppa:mainline log-lines:20 debug:true mail:email@example.com
In the same way you can add the variable
mail:firstname.lastname@example.org in the configuration file to avoid being asked the first time you create an SSL certificate. Or use
debug:true to create SSL certificates in testing environments (Let’s Encrypt Staging Enviroment).
At any time you can verify the integrity of the files related to Webinoly and your web server.
sudo webinoly -verify
This will run a scan for all the main files and check some basic aspects of your configuration.
To see all the information regarding the installation, configuration and optimization made by Webinoly on your server.
sudo webinoly -info
Normally we use it to debug and detect any errors if necessary.
You can also check the Webinoly version:
sudo webinoly -version (-v, -V).
Although we regret that you make this decision, the following command will completely remove Webinoly and all its files from the server.
sudo webinoly -uninstall
- This action will not delete your websites.
- The configuration of your server, as well as the installed packages will not be affected or uninstalled.
- The Webinoly commands to create and manage your server and websites will be removed and will no longer be available for use.
If you want to reinstall Webinoly your previous configuration will be recovered, in case you don’t want to generate this recovery file during the uninstall process you can use the
For a complete removing Webinoly guide, check our FAQ section.
If you have any suggestions, ideas, or comments, or if you (gasp!) found a bug, join us in the support forum.