Dienstag, 22. Juni 2010

vhost rackmounted

Warning, old Blogpost!

On a rackmounted vps you have to edit the /etc/apache2/sites-enabled/000-default and add this section at the top:

# Use name-based virtual hosting.
#
NameVirtualHost *:80

< VirtualHost *:80 >
##ServerAdmin postmaster@dummy-host2.localhost
DocumentRoot /var/www/folderforyoursubwww/
ServerName yourdomain.com
ServerAlias www.yourdomain.com
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
< / VirtualHost>


This is enough at the beginning and you can add as much sections like this to the apache configuration on rackmounted for multiple domains. The support team has done his job with great effort, so I will recommend there products with this refer link which is linked to me http://whmcs.rackmounted.com/aff.php?aff=107

Montag, 21. Juni 2010

Reset MySQL root password

I will describe, one way to reset the MySQL root password.

turn off mysql
/etc/init.d/mysql -stop


start mysql without any authentication

mysqld --skip-grant-tables


now you can connect without a password or user

mysql -u root -p


now you can set the new password und flush it

UPDATE mysql.user SET Password=PASSWORD('yournewpassword') WHERE User='root';
FLUSH PRIVILEGES;


open a second terminal and stop the mysql server again

/etc/init.d/mysql stop


if you did that you can start the MySQL server

/etc/init.d/mysql start

Mittwoch, 9. Juni 2010

external mysql access

This has nothing to do with debian lenny

To grant an user the right to access to the mysql database from any other places than local you have add an entry to your user table:


INSERT INTO `mysql`.`user` (
`Host` ,
`User` ,
`Password` ,
`Select_priv` ,
`Insert_priv` ,
`Update_priv` ,
`Delete_priv` ,
`Create_priv` ,
`Drop_priv` ,
`Reload_priv` ,
`Shutdown_priv` ,
`Process_priv` ,
`File_priv` ,
`Grant_priv` ,
`References_priv` ,
`Index_priv` ,
`Alter_priv` ,
`Show_db_priv` ,
`Super_priv` ,
`Create_tmp_table_priv` ,
`Lock_tables_priv` ,
`Execute_priv` ,
`Repl_slave_priv` ,
`Repl_client_priv` ,
`Create_view_priv` ,
`Show_view_priv` ,
`Create_routine_priv` ,
`Alter_routine_priv` ,
`Create_user_priv` ,
`Event_priv` ,
`Trigger_priv` ,
`ssl_type` ,
`max_questions` ,
`max_updates` ,
`max_connections` ,
`max_user_connections`
)
VALUES (
'%', 'dbuser', 'md5pwhash', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', '', '0', '0', '0', '0'
);


INSERT INTO `mysql`.`db` (
`Host` ,
`Db` ,
`User` ,
`Select_priv` ,
`Insert_priv` ,
`Update_priv` ,
`Delete_priv` ,
`Create_priv` ,
`Drop_priv` ,
`Grant_priv` ,
`References_priv` ,
`Index_priv` ,
`Alter_priv` ,
`Create_tmp_table_priv` ,
`Lock_tables_priv` ,
`Create_view_priv` ,
`Show_view_priv` ,
`Create_routine_priv` ,
`Alter_routine_priv` ,
`Execute_priv` ,
`Event_priv` ,
`Trigger_priv`
)
VALUES (
'%', 'database', 'dbuser', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'N'
);


flush privileges;

Dienstag, 8. Juni 2010

http checker

http://code.google.com/p/skipfish/

rkhunter install and use

To install the Rootkit Hunter simply use this command:

apt-get install rkhunter


After it is installed you can use rkhunter if you type:

rkhunter -c

Mittwoch, 2. Juni 2010

Warning: The SSH and rkhunter configuration options should be the same: SSH configuration option 'PermitRootLogin': yes

Warning: The SSH and rkhunter configuration options should be the same:
SSH configuration option 'PermitRootLogin': yes
Rkhunter configuration option 'ALLOW_SSH_ROOT_USER': no


you can change the /etc/ssh/sshd_config and set:

PermitRootLogin no


http://debianforum.de/forum/viewtopic.php?f=37&t=109601