Hostdog - linux https://www.hostdog.eu/tags/linux en Virtualmin - Webmin https://www.hostdog.eu/blog/virtualmin-webmin <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p><a href="https://www.virtualmin.com/" target="_blank">Virtualmin</a> is a very powerful and light control panel for Unix-based and of course Linux servers,  written mostly in perl, being one of the favorites tools of administrators</p> <p>The reason is simple, it very expandable and does not affect operating system on which is installed, unlike for example radical changes taking place by cPanel. The management is offered by it's own web server providing a web-interface for setting up all available services (<a href="https://www.apache.org" target="_blank">Apache</a>, <a href="https://www.nginx.com" target="_blank">NGINX</a>, <a href="https://www.mysql.com/" target="_blank">MySQL</a>, <a href="https://secure.php.net/" target="_blank">PHP</a>, mailserver, etc) and config files of the system.</p> <p>It is very secure by it's design (only a small amount of security issue in the last 10 years) in addition it's robust architecture offers the ability for easy plugin development and customization. It also remains modern (NGINX webserver support, DKIM signatures on e-mails) as it is frequently updated with new features.</p> <p><br /> Two big projects based on Webmin are Usermin and Virtualmin.</p> <p>Usermin, consists of a subset of features (like webmail access) and appeals to users.<br /> While Virtualmin, is a complete web hosting control panel (like <a href="https://cpanel.net/">cPanel</a>/WHM) which enables to host websites per domain. It appeals to administrators and advanced users/developers managing and developing websites. It supports services management running on the server, automatic backups, locally, on an other server or on Cloud. Offers import tool from cPanel or plesk accounts and of course creating quotas on disk space, bandwitdh etc for users.</p> <p>In other words (because it is impossible to describe all the features of Webmin - Virtualmin in an article) Virtualmin, is a competitor of commercial control panels, with the great advantage that it is supported by open source community and being available for free.</p> <p><strong>UPDATE:</strong> <a href="https://www.hostdog.eu/blog/virtualmin-installation-guide-debian" title="virtualmin installation guide on debian">virtualmin installation guide on debian</a></p> </div></div></div><div class="field field-name-field-screenshots field-type-image field-label-above"><div class="field-label">Screenshots:&nbsp;</div><div class="field-items"><div class="field-item even"><img src="https://www.hostdog.eu/sites/default/files/webmin_configuration.png" width="1200" height="675" alt="Webmin configuration screenshot" title="Webmin configuration control panel screenshot" /></div><div class="field-item odd"><img src="https://www.hostdog.eu/sites/default/files/webmin_usermin_configuration.png" width="1200" height="675" alt="Webmin usermin configuration screenshot" title="Webmin usermin configuration control panel screenshot" /></div><div class="field-item even"><img src="https://www.hostdog.eu/sites/default/files/virtualmin_overview.png" width="1200" height="675" alt="Virtualmin overview screenshot" title="Virtualmin overview page screenshot" /></div><div class="field-item odd"><img src="https://www.hostdog.eu/sites/default/files/virtualmin_plans.png" width="1200" height="675" alt="Virtualmin plans screenshot" title="Virtualmin web hosting plans management screenshot" /></div><div class="field-item even"><img src="https://www.hostdog.eu/sites/default/files/virtualmin_backup_scheduler.png" width="1200" height="675" alt="Virtualmin backup scheduler screenshot" title="Virtualmin automatic backup manager-scheduler screenshot" /></div><div class="field-item odd"><img src="https://www.hostdog.eu/sites/default/files/virtualmin_migrate_cpanel_plesk.png" width="1200" height="675" alt="Virtualmin cpanel plesk migration screenshot" title="Virtualmin cPanel plesk account import-migration tool screenshot" /></div><div class="field-item even"><img src="https://www.hostdog.eu/sites/default/files/virtualmin_services_configuration.png" width="1200" height="675" alt="Virtualmin services configuration screenshot" title="Virtualmin configuration of services screenshot " /></div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0"><a href="https://www.hostdog.eu/tags/virtualmin">virtualmin</a></li><li class="taxonomy-term-reference-1"><a href="https://www.hostdog.eu/tags/webmin">webmin</a></li><li class="taxonomy-term-reference-2"><a href="https://www.hostdog.eu/tags/control-panel">control panel</a></li><li class="taxonomy-term-reference-3"><a href="https://www.hostdog.eu/tags/cpanel">cpanel</a></li><li class="taxonomy-term-reference-4"><a href="https://www.hostdog.eu/tags/plesk">plesk</a></li><li class="taxonomy-term-reference-5"><a href="https://www.hostdog.eu/tags/linux">linux</a></li></ul></div> Wed, 12 Jun 2013 13:47:41 +0000 n.stefanis 387 at https://www.hostdog.eu Optimizing MySQL database using mysqltuner.pl https://www.hostdog.eu/blog/optimizing-mysql-database-using-mysqltunerpl <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even">MySQLTuner is a script written in perl which based to MySQL logs, it generates some pretty safe suggestions about which variables can be changed in MySQL config file for a little extra performance First, we download the script and make it executable: <div class="codeblock"><code>wget https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl<br />chmod +x mysqltuner.pl </code></div> Then we run it: <div class="codeblock"><code> ./mysqltuner.pl</code></div> It is for best, that MySQL has not little uptime when running the script, the longer the more accurate suggestions it will be able to output. As opposed to the "MySQL started within last 24 hours – recommendations may be inaccurate." error message if you attempt to run the script right after a MySQL restart. <div class="codeblock"><code> &gt;&gt;  MySQLTuner 1.2.0 - Major Hayden &lt;major@mhtx.net&gt;<br /> &gt;&gt;  Bug reports, feature requests, and downloads at http://mysqltuner.com/<br /> &gt;&gt;  Run with '--help' for additional options and output filtering<br /><br />-------- General Statistics --------------------------------------------------<br />[--] Skipped version check for MySQLTuner script<br />[OK] Currently running supported MySQL version 5.1.68-cll<br />[OK] Operating on 64-bit architecture<br /><br />-------- Storage Engine Statistics -------------------------------------------<br />[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster<br />[--] Data in MyISAM tables: 1G (Tables: 5367)<br />[--] Data in InnoDB tables: 400M (Tables: 4079)<br />[--] Data in MEMORY tables: 0B (Tables: 33)<br />[!!] Total fragmented tables: 4684<br /><br />-------- Security Recommendations  -------------------------------------------<br />[OK] All database users have passwords assigned<br /><br />-------- Performance Metrics -------------------------------------------------<br />[--] Up for: 15d 10h 40m 6s (68M q [51.568 qps], 1M conn, TX: 794B, RX: 12B)<br />[--] Reads / Writes: 77% / 23%<br />[--] Total buffers: 78.0M global + 7.5M per thread (800 max threads)<br />[OK] Maximum possible memory usage: 5.9G (76% of installed RAM)<br />[OK] Slow queries: 0% (1K/68M)<br />[OK] Highest usage of available connections: 8% (66/800)<br />[OK] Key buffer size / total MyISAM indexes: 36.0M/229.4M<br />[OK] Key buffer hit rate: 98.5% (572M cached / 8M reads)<br />[OK] Query cache efficiency: 70.8% (38M cached / 54M selects)<br />[!!] Query cache prunes per day: 723587<br />[OK] Sorts requiring temporary tables: 0% (4K temp sorts / 2M sorts)<br />[!!] Joins performed without indexes: 109545<br />[!!] Temporary tables created on disk: 31% (1M on disk / 4M total)<br />[OK] Thread cache hit rate: 99% (66 created / 1M connections)<br />[!!] Table cache hit rate: 0% (1K open / 83M opened)<br />[OK] Open file limit used: 3% (1K/48K)<br />[OK] Table locks acquired immediately: 99% (26M immediate / 26M locks)<br />[!!] InnoDB data size / buffer pool: 400.4M/8.0M<br /><br />-------- Recommendations -----------------------------------------------------<br />General recommendations:<br />    Run OPTIMIZE TABLE to defragment tables for better performance<br />    Enable the slow query log to troubleshoot bad queries<br />    Adjust your join queries to always utilize indexes<br />    When making adjustments, make tmp_table_size/max_heap_table_size equal<br />    Reduce your SELECT DISTINCT queries without LIMIT clauses<br />    Increase table_cache gradually to avoid file descriptor limits<br />Variables to adjust:<br />    query_cache_size (&gt; 16M)<br />    join_buffer_size (&gt; 2.0M, or always use indexes with joins)<br />    tmp_table_size (&gt; 16M)<br />    max_heap_table_size (&gt; 16M)<br />    table_cache (&gt; 1024)<br />    innodb_buffer_pool_size (&gt;= 400M)</code></div> You should carefully read the results, especially the recommendations at the end which shows exactly which variables you should adjust in the [mysqld] section of your my.cnf file (/etc/mysql/my.cnf for Debian and Ubuntu). Whenever you change your my.cnf, make sure that you restart MySQL service. After changes to my.cnf file, you can come back after 2 or 3 days and run mysqltuner.pl again, in order to see if there are any additional suggestions to improve the MySQL performance. This way you are able to optimize your MySQL's settings step by step. Give extra attention to "Query cache efficiency" percentage and note down it's change. This method is ideal for learning as well, while you may come up with random configurations across the Internet matching your server's specification, they could become confusing when you have to change a bunch of variables at once or it wouldn't give you the time to study how every variable change affects your MySQL server performance. Please note: We hold no responsibility for any changes you make to your my.cnf config file. Also we strongly suggest you to take backups not only from my.cnf config file itself but take whole database backups as well.</div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0"><a href="https://www.hostdog.eu/tags/linux">linux</a></li><li class="taxonomy-term-reference-1"><a href="https://www.hostdog.eu/tags/mysql">mysql</a></li><li class="taxonomy-term-reference-2"><a href="https://www.hostdog.eu/tags/mysql-optimization">mysql optimization</a></li><li class="taxonomy-term-reference-3"><a href="https://www.hostdog.eu/tags/optimization">optimization</a></li><li class="taxonomy-term-reference-4"><a href="https://www.hostdog.eu/tags/database-optimization">database optimization</a></li><li class="taxonomy-term-reference-5"><a href="https://www.hostdog.eu/tags/mysqltuner">mysqltuner</a></li></ul></div> Wed, 01 May 2013 12:28:53 +0000 ploupas 352 at https://www.hostdog.eu How to find the IPs connecting to my server? https://www.hostdog.eu/blog/how-find-ips-connecting-my-server <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even">The following command displays a list of the IPs that are connected to our server ignoring the STATE of the connection (CLOSE_WAIT, ESTABLISHED, etc) <div class="codeblock"><code>netstat -tn 2&gt;/dev/null</code></div> -t flag tells netstat to display only TCP connections and -n flag tells netstat command not to resolve IPs to hostnames While stderr (2) redirection (&gt;) throws at "garbage" (/dev/null) means that we just don't want possible errors to break our cute output we are trying to make. At this point we have all usable information, but it is a little difficult to use, we will try to come to a more clear and handy format. Piping (|) to grep, we can keep only the IPs that are connecting to port 80 of our webserver. <div class="codeblock"><code>netstat -tn 2&gt;/dev/null | grep ":80 "</code></div> It would be also nice to keep only the 5th column right? <div class="codeblock"><code> netstat -tn 2&gt;/dev/null | grep ":80 " | awk '{print $5}'</code></div> Maybe the trickiest part here is that we only want IPs to be displayed so we use: cut -d: -f1 Where: -d tells cut to use the immediate following character as a delimiter. -f tells how many fields to output, in our case we just need one. <div class="codeblock"><code>netstat -tn 2&gt;/dev/null | grep ":80 " | awk '{print $5}' | cut -d: -f1</code></div> Then using sort, we are sorting our list, using -c we are counting unique occurrences and then we can display in descending order with sort -nr (numeric και reverse). It's in our judgement to use head to check only the first 10 results. <div class="codeblock"><code>netstat -tn 2&gt;/dev/null | grep ":80 " | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head</code></div> Of course, changing the port only in grep, ie to 25, we are able to see if someone is abusing our mail server or in a VPS hosting environment the tracking of a spammer can be a little bit easier. Also we can use a specific connection state in grep that we are interested in, count connections per process (using parameter -p in netstat). Essentially it's about few commands that combined together they become a very useful tool for an system &amp; network administrator.</div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0"><a href="https://www.hostdog.eu/tags/netstat">netstat</a></li><li class="taxonomy-term-reference-1"><a href="https://www.hostdog.eu/tags/linux">linux</a></li><li class="taxonomy-term-reference-2"><a href="https://www.hostdog.eu/tags/administration">administration</a></li><li class="taxonomy-term-reference-3"><a href="https://www.hostdog.eu/tags/grep">grep</a></li><li class="taxonomy-term-reference-4"><a href="https://www.hostdog.eu/tags/awk">awk</a></li><li class="taxonomy-term-reference-5"><a href="https://www.hostdog.eu/tags/network">network</a></li></ul></div> Thu, 25 Apr 2013 12:05:57 +0000 ploupas 351 at https://www.hostdog.eu