Catégorie : Gestion de serveur

  • Alerte loggin root

    nano /root/.bashrc Ajouter : echo ‘Accès Shell Root le ‘ `date` `who` | mail -s `hostname` Shell Root de `who | cut -d »( » -f2 | cut -d ») » -f1` myadress@myfai.com

  • Interdire le login en root

    1. Créer un nouvel utilisateur : adduser newuser 2. Mot de passe de newuser : passwd newuser 3. Interdire le loggin par le compte root : nano /etc/ssh/sshd_config Mettre « PermitRootLogin » à « no » 4. Redémarrer ssh : service sshd restart ou /etc/init.d/sshd restart pour Centos /etc/init.d/ssh restart pour Debian 5. Quand il faudra se relogguer, il…

  • Changer le port ssh et se reconnecter

    Pour changer le port SSH : nano /etc/ssh/sshd_config Changer le n° du port en écrivant un n° plus grand que 1024. /etc/init.d/ssh restart /etc/rc.d/init.d/sshd restart Vérifier : netstat -nptl | grep 1210 Pour se reconnecter (mac) : ssh root@ip_du_serveur -p N°_du_port

  • 200 % ?

    You have a processor which has more than one core, or you have multiple processors. If you have two cores and a process is using 100% of both cores, it will show as 200% in top.

  • Optimize my.cnf

    http://www.linuxweblog.com/tune-my.cnf Had to do some fine tuning of MySQL 4.1.9 and here is what my.cnf file looks like for a 2GHz machine with 1GB of memory. [mysqld] socket=/path/to/mysql.sock datadir=/var/lib/mysql skip-locking skip-innodb # MySQL 4.x has query caching available. # Enable it for vast improvement and it may be all you need to tweak. query_cache_type=1 query_cache_limit=1M…

  • Réparation de tables

    http://mirrors.dotsrc.org/mysql/doc/refman/5.1/en/rebuilding-tables.html How To Repair Corrupted MySQL Tables Using myisamchk

  • Tar, tar.gz

    From : http://www.simplehelp.net/2008/12/15/how-to-create-and-extract-zip-tar-targz-and-tarbz2-files-in-linux/ TAR Here’s how you compress a directory: # tar -cvf archive_name.tar directory_to_compress And to extract the archive: # tar -xvf archive_name.tar.gz This will extract the files in the archive_name.tar archive in the current directory. Like with the tar format you can optionally extract the files to a different directory: # tar -xvf…

  • thread_cache_size

    The thread cache hit rate can be calculated with Threads_created/Connections. Ideally you want the threads cached to be able to handle all connections. So a stable (zero growth) or low Threads_created status variable is the goal. Depending on your specific situation, in some case this value can be very high (like 150+). For an idea…

  • thread_concurrency

    thread_concurrency should follow: number of CPU’s*2 for thread_concurrency thread_concurrency -> the number of processes which will run AT SAME TIME. In all modern OSs possible to run a lot of tasks simultaneously. But in real one processor will perform ONE task at once but very frequently switch between tasks. If you have few CPUs it…

  • skip-locking

    http://forums.mysql.com/read.php?21,85701,85966 In the system lock state there is not just done file locking, but also MyISAM locking of the table. In that phase just one thread can access the table, others must wait there. The MyISAM table lock is also used during « system unlocking » though this is not shown in the processlist. If the unlock…