Webmin error "Cannot write to directory /etc/webmin/virtual-server/"

Sometimes, after freshly installing Webmin on the server, when we perform certain tasks like adding SSL to the site or trying to change the default Apache directives in a template we may end up with the "Cannot write to directory /etc/webmin/virtual-server/" error.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Apache configuration queries.

In this context, we shall look into methods to fix Apache configuration issues.

Causes of Apache error "Cannot write to directory /etc/webmin/virtual-server/"

Common causes of this error includes:

  • Issues with installation.
  • Access to Webmin users.
  • Permission of the folders.

Methods to fix "Cannot write to directory /etc/webmin/virtual-server/" Apache error ?

1. Grant access to Webmin users

Insufficient permission of the Webmin user can be one of the possible reasons for this error.

To fix this error we can do the following:

  • While installing the Virtualmin module go to Webmin Configuration.
  • And take Webmin Modules.
  • From there, select the option 'Grant access to all Webmin users'.

This will provide permission to all the Webmin users.

2. Reinstalling the Webmin installation

At times this error can also be caused due to mistakes or issues during the installation.

And one of the reasons for this can be any package that is already installed in the system.

To ensure that there are not package conflicts, we must do the installation of Webmin on a fresh OS.

Otherwise, we can try reinstalling Webmin:

i. Firstly, we can uninstall the existing one with the following command:

$ install.sh --uninstall

ii. After that we can install it with the following command:

$ install.sh

Alternatively, to perform the reinstallation using the operating system package manager in Centos systems, we can use:

$ yum remove webmin
$ yum install webmin

[Need assistance in fixing Apache configuration issues? We can help you. ]


This article covers methods to resolve apache error "Cannot write to directory /etc/webmin/virtual-server/".