File permissions for virtual pop inboxes in DirectAdmin
Any domains that you want to use for email (eg: mydomain.com) must be in both the /etc/virtual/domains file and the /etc/virtual/domainowners file.
The directory /etc/virtual/mydomain.com must exist and the files /etc/virtual/mydomain.com/passwd and /etc/virtual/mydomain.com/aliases exist.
File permissions for virtual pop inboxes should be the following below but not applicable with Dovecot/Maildir:
/var/spool/virtual/domain.com 770 username:mail
/var/spool/virtual/domain.com/* 660 username:mail
Creating your own SSL certificate for DirectAdmin
Note : that this is for the DirectAdmin connection on port 2222.
You can switch DirectAdmin to use SSL instead of plain text. -> https instead of http on port 2
If you do not have your own certificates, you’ll need to create your own:
/usr/bin/openssl req -x509 -newkey rsa:1024 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9999 -nodes
And then
chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem
Edit the /usr/local/directadmin/conf/directadmin.conf and set SSL=1 (default is 0). This tells DA to load the certificate and key and to use an SSL connection. DirectAdmin needs to be restarted after this change.
If you want webalizer or awstats pages to be available by default for new domains, you can do so by creating:
/usr/local/directadmin/scripts/custom/domain_create_post.sh
In the file add the code
#!/bin/sh
ln -s ../stats /home/$username/domains/$domain/public_html/stats
exit 0;
Then chmod the domain_create_post.sh script to 755.
If you want it to be for awstats, then change the bold stats name to be awstats instead.
Source: http://directadmin.com/
Cannot use SSH with old system accounts after Installation of DirectAdmin
For all SSH accounts created with DirectAdmin, it adds the “AllowUsers” option to the /etc/ssh/sshd_config file.
When DirectAdmin is installed, it will add “root” and “admin” to that file under the AllowUsers option.
Any other users who have had SSH account on the system will also require to be added to that file in order to access the server via SSH.
Source: http://directadmin.com
Setting up webmail.domain.com as default for new domains with DirectAdmin
1) You’ll need to setup the virtualhost for apache. This can be accomplished by adding a 2nd virtualhost along side the domains main one.
cd /usr/local/directadmin/data/templates
cp virtual_host.conf custom
cd custom
You’ll need to edit the newly copied virtual_host.conf (or virtual_host2.conf if you’re using apache 2) file , just add the following to the end of whatever you currently have.
</VirtualHost>
<VirtualHost |IP|:80>
ServerName webmail.|DOMAIN|
ServerAdmin |ADMIN|
DocumentRoot /var/www/html/squirrelmail
CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
</VirtualHost>
Save and exit. Then run
echo “action=rewrite&value=httpd” >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d
to rewrite the httpd.conf files.
2) You’ll also need to setup the dns portition.
cd /usr/local/directadmin/data/templates
cp dns_a.conf custom
cd custom
echo “webmail=|IP|” >> dns_a.conf
This will setup the webmail A record for new dns zones. For existing dns zones, you’ll have to manually add the webmail A record to point to the domains IP.
Source : http://directadmin.com/