Updating, recompiling, VirtualHost templates, customizations,  php safemode …How to track which site is using the apache processes and causing load

Updating, recompiling, VirtualHost templates, customizations,  php safemode …How to track which site is using the apache processes and causing load

If you run apache 2.x with custombuild, then it’s already in the that file:

/etc/httpd/conf/extra/httpd-info.conf

Try Change the “Allow from” lines to include your IP (eg: 1.2.3.4), OR remove the line completely to allow from all.

<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 1.2.3.4
</Location>

OR

<Location /secret-server-status>
SetHandler server-status
</Location>

Try Change the /server-status to something  which is hard-to guess if you use the 2nd method, since we don’t want just anyone viewing this page.

Also change the uncomment the #ExtendedStatus by removing the # character:

ExtendedStatus On

track


For apache 1.3, edit your /etc/httpd/conf/httpd.conf and add

ExtendedStatus On
<Location /httpd-status>
SetHandler server-status
</Location>

Even just after the code that it says “ServerSignature On”.   Save and exit, then restart apache.  You can access the stats page by going to http://1.2.3.4/httpd-status where 1.2.3.4 is your server’s IP.

How to Set up webmail.domain.com as default for new domains

1) We will need to add a webmail.* VirtualHost to each domain.

We can make use of a feature that let’s us globally specify CUSTOM# tokens, without altering the original templates.
Create the file

/usr/local/directadmin/data/templates/custom/virtual_host2.conf.CUSTOM.4.post

and then add the code

</VirtualHost>
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
ServerName webmail.|DOMAIN|
ServerAdmin |ADMIN|
DocumentRoot /var/www/html/roundcube
CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>

Consider taking note that we *start* the code with the closing </VirtualHost> because the CUSTOM4 token is before the trailing VH in that virtual_host2.conf template.

The above procedure is for port http:80, but similar code can be used in:

/usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf.CUSTOM.4.post

if you want it for https on the domain, you’d add:

</VirtualHost>
<VirtualHost |IP|:|PORT_443| |MULTI_IP|>
ServerName webmail.|DOMAIN|
ServerAdmin |ADMIN|
DocumentRoot /var/www/html/roundcube

SSLEngine on
SSLCertificateFile |CERT|
SSLCertificateKeyFile |KEY|
|CAROOT|

CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>

2) Then run this:

echo “action=rewrite&value=httpd” >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d

to rewrite the httpd.conf files.

3) You will also need to setup the dns portition.

cd /usr/local/directadmin/data/templates
cp dns_a.conf custom
cd custom
perl -pi -e “s/^smtp=\\|IP\\|\n/smtp=\\|IP\\|\nwebmail=\\|IP\\|\n/” dns_a.conf

This will setup the webmail A record for all new dns zones.  For existing dns zones, you’ll have to manually add the webmail A record to point to the domains IP.

Leave a Reply

Your email address will not be published. Required fields are marked *