Virtual Qmail Web Administrator (VqAdmin) is a CGI Web program to allow virtual email hosting machine administators to add, delete, and modify virtually hosted email domains and users using vpopmail. Authentication is provided by ACLs and the Apache htpasswd method. Machine Administrators can add/delete virtual email domains, and tech users can admin user email accounts such as setting passwords, disk quotas, and privileges.


# cd ~root
# tar xzf ~root/qmail/vqadmin-2.3.7.tar.gz
# cd vqadmin-2.3.7
# chown -R root:wheel .
# patch -p1 < ~root/qmail/vqadmin-2.3.7_20150829.patch
# ./configure --enable-qmaildir=/var/qmail --enable-cgibindir=/usr/local/www/apache24/cgi-bin/ --enable-htmldir=/usr/local/www/apache24/data
# make
# make install-strip

We need to make some modifications to httpd.conf as seen below. There are a total of four steps:
1) NOTE: DO NOT PUT VQADMIN DIR INTO VHOSTS - PUT RIGHT BELOW THIS IN HTTPD.CONF:


# vi /usr/local/etc/apache24/httpd.conf


existing lines:

<Files ".ht*">
Require all denied
</Files>

2) Add this section at the end of all the Directory Statements.


<Directory "/usr/local/www/apache24/cgi-bin/vqadmin/">
Options +ExecCGI
AllowOverride AuthConfig
</Directory>

3) Uncomment the following lines httpd.conf


<IfModule mpm_prefork_module>
LoadModule cgi_module libexec/apache24/mod_cgi.so
</IfModule>

AddHandler cgi-script .cgi

We need to restart apache after making these changes:


# /usr/local/etc/rc.d/apache24 restart

Now we need to change permissions on the cgi-bin file


# cd /usr/local/www/apache24/cgi-bin/vqadmin
# chown root:wheel vqadmin.cgi
# chmod 644 .htaccess
# vi .htaccess

Replace the following in .htaccess


AuthType Basic
AuthUserFile /usr/local/vqadmin.passwd
AuthName vQadmin
require valid-user

We need to create the password file as seen below:


# /usr/local/bin/htpasswd -bc /usr/local/vqadmin.passwd admin your-web-password

Now go to https://domain.com/cgi-bin/vqadmin/vqadmin.cgi and it should prompt you for the username and password you created above.