Archive

Archive for the ‘Directadmin Tricks’ Category

How to Delete All admin Messages from Directadmin

December 26th, 2011 No comments

If your Directadmin server faces a brute-force attack or script-kiddies are trying to guess your password, your message queue is full of messages. If you don’t check them periodically, you will have some problems deleting them.

I have been away for 2 weeks so I didn’t check my server for messages. When I came back, there were 2600 messages, and any attempt to list them all was unsuccessful. Since I know my users aren’t using the Directadmin Message system, it was safe to delete them.

In order to do this, you need to go to /usr/local/directadmin/data/tickets . You will see some folders there. These folders are full of messages, that are safe to delete. In order to find out, which folders you need to delete, you need to check /usr/local/directadmin/data/admin/tickets.list. When you see the list of messages, you may delete those you don’t need.

That’s pretty simple, and you may use this method for any other reseller. Just replace admin with your reseller name and check its message list.

Categories: Directadmin Tricks Tags:

How to Add MySQL Root Password for Directadmin

October 15th, 2010 No comments

Recently I had to deal with a Directadmin VPS that had mysql installed, but for some reason there wasn’t a record for root in mysql user table. Here are the queries I used to add a root account, and to assign all the necessary privilegies.

First of all We need to create a record with username and password.

INSERT INTO user(user, password) values (‘root’, PASSWORD(‘PASSWORD_HERE’));

Then we need to add all the privileges to our root:

UPDATE `mysql`.`user` SET `Select_priv` = ‘Y’,
`Insert_priv` = ‘Y’,
`Update_priv` = ‘Y’,
`Delete_priv` = ‘Y’,
`Create_priv` = ‘Y’,
`Drop_priv` = ‘Y’,
`Reload_priv` = ‘Y’,
`Shutdown_priv` = ‘Y’,
`Process_priv` = ‘Y’,
`File_priv` = ‘Y’,
`Grant_priv` = ‘Y’,
`References_priv` = ‘Y’,
`Index_priv` = ‘Y’,
`Alter_priv` = ‘Y’,
`Show_db_priv` = ‘Y’,
`Super_priv` = ‘Y’,
`Create_tmp_table_priv` = ‘Y’,
`Lock_tables_priv` = ‘Y’,
`Execute_priv` = ‘Y’,
`Repl_slave_priv` = ‘Y’,
`Repl_client_priv` = ‘Y’,
`Create_view_priv` = ‘Y’,
`Show_view_priv` = ‘Y’,
`Create_routine_priv` = ‘Y’,
`Alter_routine_priv` = ‘Y’,
`Create_user_priv` = ‘Y’ WHERE `user`.`Host` = ” AND `user`.`User` = ‘root’ LIMIT 1 ;

And the last command:

GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY ‘PASSWORD_HERE’ WITH GRANT OPTION

Then you can do the same for da_admin mysql user:

GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost IDENTIFIED BY ‘PASSWORD_HERE’ WITH GRANT OPTION;

Restart mysql and have fun.

How to Update Directadmin Awstats for a Single Domain

October 15th, 2010 No comments

Sometimes you need to update stats for a single domain to deal with most current information. There is a simple command though it is not well documented. The command is much easier than the one for webalizer. Here it is:

/usr/local/directadmin/scripts/awstats_process.sh USER DOMAIN

Of course, you need to insert your username and your domain.If you need to update your stats more often, you can add this command to your crontab.

How to Disable Public Webalizer Stats in Directadmin

February 8th, 2010 No comments

Sometimes you need to show your domain stats to somebody. Directadmin provides this functionality: it is possible to create a link to stats at its statistics page.

But what should you do then you don’t need stats to be public? As you can see, there is no option to disable public stats view.

The solution comes very simple. In order to provide the ability of viewing public stats, Directadmin creates a symbolic link to stats in user directory. All you need is to remove this link using Directadmin file manager.

All you need is to delete this link. Simple, isn’t it?