You cannot secure something if it doesn't have something insecure on it. Just keep all the software up to date, never allow root login via SSH or FTP ( use sudo with a decent password for tasks that require root ), and any scripts running on your webserver need to be sure they strip database entries of SQL.
and i'd like to secure these and the whole linux system too..
Upgrading to the latest available stable versions of these might help you quite alot. There's httpd/Apache 2.4.6 and a few more out there up for grabs and they've been recommended by Apache. As Shawni has stated there's no need for FTP when there's SSH (it has also a included SSH FTP) which installs with SSH and it's much more secure and useful.
everyday!
2) Don't use FTP, it's generally insecure compared to SSH. Stick with SSH & SFTP.
3) Create another root-like account with admin rights and use it. For root, set extremely hard password and disallow login via SSH. Never touch it then. Same with MySQL.
4) Only allow su for your admin user.
5) Configure iptables, at least some basic limitations.
6) Don't run Apache.
@ DannyDeth:
sudo is so tiresome. I use su instead.
@ lev258:
He has Debian server, not Ubuntu. Not so much difference, but still.
If you just want to secure your server then here are some tips that can help you alot :
*Password are everything, as the command passwd like to tell you that passwords based on dictionary word are really BAD. Try to make your password longer and include some punctuations and some capital letter ( Linux filesystem is case sensitive ).
*Stop using MySQL if it's not indeed.
*Install DenyHost.
*Change SSH port.
*Stop using root ( edit /etc/ssh/ssh_config ) and create another account or use SSH Keys.
Also make your SQL server only accessible from within the same network and disallow all external access (unless you really need it).
And in case you're using PHPMyAdmin: Choose a random folder name (nothing which contains terms like "admin", "php", "sql" or "db") and add at least an additional .htaccess password protection. There are tons of bots out there which systematically search for PHPMyAdmin.
Marcell, if it's a private server from some provider then it's a shame, i mean Debian must be on the top list as it's the best linux distro for servers.