tag:blogger.com,1999:blog-76417625295700136132024-02-08T02:02:48.985+01:00Linux HelpfulSome informations, tutorials and howto about Linux Centos to make your life easieryG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-7641762529570013613.post-41668071944715046542013-01-22T23:52:00.000+01:002013-01-22T23:52:15.765+01:00Wordpress you are not allowed to edit this post<br />
Recently, I've met this error when I went create a new article on my Wordpress blog.<br />
I tried to disable all plugins and activate the wordpress default theme but not solved.<br />
Then I checked the php error log and I saw this error:<br />
<br />
<br />
<pre class="brush:js;'">WordPress database error Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause for the query
SELECT COUNT(*) FROM wp_em_events ...</pre>
<br />
<br />
<br />
I've searched few days to understand that problem was related with the ONLY_FULL_GROUP_BY sql mode.<br />
I had used the Percona tools web interface to generate my mysql config file and in effect this config file contains parameters for sql modes such as:<br />
<br />
<pre class="brush:js;'">sql_mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY</pre>
<br />
<br />
Solution for me was simply to disable the ONLY_FULL_GROUP_BY sql_mode by removing the parameter on the config line like this:<br />
<br />
<pre class="brush:js;'">sql_mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE</pre>
<br />
<br />
<br />
Save the config file and restart the MySQL/MariaDB/Percona server to validate the new config.<br />
<div>
<div>
Then, I've tried to write a new post on the wordpress blog but same issue again.</div>
<div>
Now, this error can be checked into the php error log file:</div>
</div>
<div>
<br /></div>
<div>
<div>
<pre class="brush:js;'">WordPress database error Incorrect datetime value: '0000-00-00 00:00:00' for column 'post_date_gmt' at row 1 for query INSERT INTO wp_posts </pre>
</div>
</div>
<div>
<br /></div>
<div>
Here, a quick search helped me to find that the NO_ZERO_DATE sql mode was the cause of this error thus I removed this sql mode into the config file again like this:</div>
<div>
<br /></div>
<div>
<pre class="brush:js;'">sql_mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_IN_DATE</pre>
</div>
<div>
<br /></div>
<div>
<div>
Saved and restart mysql server to validate.</div>
<div>
After these both edits I can now write articles on the blog, very glad because lot of time was lost for this bullshit !</div>
</div>
<br />yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com1tag:blogger.com,1999:blog-7641762529570013613.post-23477640111720580102012-12-12T10:33:00.002+01:002012-12-12T10:36:33.830+01:0015 Greatest Open Source Terminal Applications Of 2012<br />
<br />
Nice article on NixCraft:<br />
<br />
Linux on the desktop is making great progress. However, the real beauty of Linux and Unix like operating system lies beneath the surface at the command prompt. nixCraft picks his best open source terminal applications of 2012.<br />
<br />
Most of the following tools are packaged by all major Linux distributions and can be installed on *BSD or Apple OS X.<br />
<br />
Link: <a href="http://www.cyberciti.biz/open-source/best-terminal-applications-for-linux-unix-macosx/">http://www.cyberciti.biz/open-source/best-terminal-applications-for-linux-unix-macosx/</a><br />
yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-60260892695508258262012-12-12T10:31:00.000+01:002012-12-12T10:38:14.489+01:00FlexGet<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
FlexGet is a multipurpose automation tool for content like torrents, nzbs, podcasts, comics, series, movies, etc. It can use different kinds of sources like RSS-feeds, html pages, csv files, search engines and there are even plugins for sites that do not provide any kind of useful feeds.</div>
<div class="separator" style="clear: both; text-align: left;">
There are numerous plugins that allow utilizing FlexGet in interesting ways and more are being added continuously.</div>
<div class="separator" style="clear: both; text-align: left;">
FlexGet is extremely useful in conjunction with applications which have watch directory support or provide interface for external utilities like FlexGet.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Webpage: <a href="http://flexget.com/">http://flexget.com/</a></div>
<div class="separator" style="clear: both;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://flexget.com/chrome/site/FlexGet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://flexget.com/chrome/site/FlexGet.png" /></a></div>
yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-48729378065890630412012-09-06T08:53:00.001+02:002012-09-06T08:53:40.384+02:00Respect your Room: Low Frequency Absorption (Bass Traps) – AbletonOp<a href="http://www.abletonop.com/2012/09/respect-your-room-low-frequency-absorption-bass-traps/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+abletonop+%28AbletonOp%29">Respect your Room: Low Frequency Absorption (Bass Traps) – AbletonOp</a>: <br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-23781022344661866492012-09-03T16:21:00.001+02:002012-09-03T16:21:31.104+02:00Respect your Room: Broad Band Absorbtion – AbletonOp<a href="http://www.abletonop.com/2012/08/respect-your-room-broad-band-absorbtion/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+abletonop+%28AbletonOp%29">Respect your Room: Broad Band Absorbtion – AbletonOp</a>: <br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-25767487326064603642012-06-06T11:39:00.001+02:002012-06-06T11:39:13.056+02:00Linux / FreeBSD: PDFCrack A Command Line Password Recovery Tool For PDF Files<a href="http://www.cyberciti.biz/tips/linux-howto-crack-recover-pdf-file-password.html">Linux / FreeBSD: PDFCrack A Command Line Password Recovery Tool For PDF Files</a>: <br />
<br />
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-33227799803199678202012-05-17T19:34:00.003+02:002012-05-17T19:35:39.527+02:00Bandwidth monitor NG<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 15px;"></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Bandwidth Monitor NG is a small and simple console-based live network and disk io bandwidth monitor for Linux, BSD, Solaris, Mac OS X and others.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">So it is very useful to display current ethernet interfaces stats with this top like.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">RPM package is present into the EPEL repo or you can download sources from the source forge web page: <a href="http://sourceforge.net/projects/bwmng/">http://sourceforge.net/projects/bwmng/</a></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Here is the features list of bwm-ng:</span><br />
<br />
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">supports /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats /proc/partitions, IOKit, devstat and libstatgrab</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">unlimited number of interfaces/devices supported</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">interfaces/devices are added or removed dynamically from list</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">white-/blacklist of interfaces/devices</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">output of KB/s, Kb/s, packets, errors, average, max and total sum</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">output in curses, plain console, CSV or HTML</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">configfile</span></li>
</ul>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Short list of changes since 0.5 (for full list read <a href="http://www.gropp.org/bwm-ng/changelog">changelog</a>):</span><br />
<br />
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">curses2 output, a nice bar chart</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">disk input for bsd/macosx/linux/solaris</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">win32 network bandwidth support</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">moved to autotools</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">alot fixes</span></li>
</ul>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Website: <a href="http://www.gropp.org/?id=projects&sub=bwm-ng">http://www.gropp.org/?id=projects&sub=bwm-ng</a></span><br />
<br />
<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.gropp.org/bwm-ng.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="79" src="http://www.gropp.org/bwm-ng.png" width="320" /></a></div>
<div>
<br /></div>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-72135920344108800662012-01-28T03:32:00.002+01:002012-01-28T03:33:31.603+01:00Chive project<br />
Here is an interesting and beautiful alternative to the famous PhpMyAdmin that permits web-based MySQL administration in a very easy way.<br />
<br />
Chive is distributed by the fusonic austrian team and is actually in version 1.0.2<br />
The install is babyish, the chive interface is available in less of one minute ...<br />
The highlight of this project is syntax editors with colored accentuation for SQL queries.<br />
So try it and have fun !<br />
<br />
<a href="http://www.chive-project.com/">http://www.chive-project.com/</a>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.chive-project.com/style/images/logo-big.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.chive-project.com/style/images/logo-big.png" /></a></div>
<br />yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-44623493288760445612012-01-09T08:51:00.000+01:002012-01-09T08:52:57.374+01:00Mesurer la vitesse de chargement des pages des sites WebArticle très intéressant concernant les outils existants en ligne pour mesurer la vitesse de chargement des pages sur les sites Web.<br />
<br />
<a href="http://www.dsfc.net/internet/referencement-internet/vitesse-chargement-pages-sites-web/">Mesurer la vitesse de chargement des pages des sites Web</a>:
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-8399339043042386712011-12-26T10:14:00.000+01:002011-12-26T10:14:19.596+01:00PHP MySQLDump Browser<div>Very interesting project that permit users/system admins to browse through MySQL Database Backups (Dump Files).</div><a href="http://mattkendrick.com/development/php-mysqldump-browser/">PHP MySQLDump Browser</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-69488376076291338942011-12-16T12:36:00.000+01:002011-12-16T12:36:36.513+01:0010 essential MySQL tools for admins, toi aussi administre Mysql au top !<a href="http://gotofreedom.org/2011/08/10-essential-mysql-tools-for-admins-toi-aussi-administre-mysql-au-top/">10 essential MySQL tools for admins, toi aussi administre Mysql au top !</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-18553683679163338532011-12-15T18:50:00.000+01:002011-12-15T14:36:01.220+01:00WeatherSpectAnother cool tools for geeks: WeatherSpect. Distributed on Robobunny website (same as ASCIIQuarium).<br />
<br />
This program uses weather data supplied by the Weather::Underground module to create an ASCII animation that simulates the weather. There is also a large number of random creatures and objects that walk across this screen.<br />
Install the prerequisites if you haven't already done (for CentOS distro as usual):
<br />
<pre class="brush:js;'">cpan install Term::Animation
yum install -y perl-Curses
</pre>
Install WeatherSpect:
<br />
<pre class="brush:js;'">cd /downloads/
wget http://robobunny.com/projects/weatherspect/weatherspect.tar.gz
tar -xvzf weatherspect.tar.gz
cd weatherspect_v1.9/
chmod 755 weatherspect
cp weatherspect /usr/bin/
cd ~
</pre>
Generate config file:
<br />
<pre class="brush:js;'">[root@ygwane ~]$ weatherspect -c
Accepted formats for location:
Zipcode
City
City, State
State
City, Country
Country
Your Location: Apt, France
Temperature ( (C)elsius, (F)ahrenheit, (B)oth ) [B] C
Wind Speed ( (K)PH, (M)PH, (B)oth ) [B] K
Creating config file in /root/.weatherspect...
</pre>
It's possible to change your location (and some others features) by editing the config file /root/.weatherspect ... <br />
<br />
Now have fun ! (press 'q' for quit)
<br />
<pre class="brush:js;'">weatherspect
</pre>
We can have a weather report by pressing 'w' (press again 'w' to close the report)<br />
<br />
Screenshot:
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://robobunny.com/projects/weatherspect/weatherspect.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="452" src="http://robobunny.com/projects/weatherspect/weatherspect.png" width="565" /></a></div>
Website: <a href="http://robobunny.com/projects/weatherspect/html/">http://robobunny.com/projects/weatherspect/html/</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-44655380551463374552011-12-09T18:09:00.001+01:002011-12-10T11:56:26.620+01:00ASCIIQuariumFor all geeks who are searching funny and useless tools, I wanna show you the better one for me: ASCIIQuarium ...<br>
This is an ascii aquarium screensaver for Linux terminals that permits to: "Enjoy the mysteries of the sea from the safety of your own terminal!"<br><br>
First we have to install the prerequisites (for CentOS distro as usual):
<pre class="brush:js;'">
cpan install Term::Animation
yum install -y perl-Curses
</pre>
Then, we can install ASCIIQuarium:
<pre class="brush:js;'">
cd /downloads
wget http://www.robobunny.com/projects/asciiquarium/asciiquarium.tar.gz
tar -xvzf asciiquarium.tar.gz
cd asciiquarium_1.0/
chmod 755 asciiquarium
cp asciiquarium /usr/bin/
cd ~
</pre>
Woaw ! The sysadmins will be able to relax with this beautiful fish tank henceforth ...
<pre class="brush:js;'">
asciiquarium
</pre>
Screenshot:
<div class="separator" style="clear: both; text-align: center;">
<a href="http://robobunny.com/projects/asciiquarium/screenshot.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="452" width="565" src="http://robobunny.com/projects/asciiquarium/screenshot.png" /></a></div>
Website: <a href="http://robobunny.com/projects/asciiquarium/html/">http://robobunny.com/projects/asciiquarium/html/</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-86329145826834670592011-12-09T17:26:00.001+01:002011-12-09T18:01:18.173+01:00SpeedometerHere is an interesting project that permits to display and measure the rate of data across a network connection or data being stored in a file.
This tool is named <a href="http://excess.org/speedometer/">Speedometer</a>. He needs python 2.6 (or higher) to operate.<br>
We're gonna see how to install it and use it. It's really easy !<br><br>
For Debian based distros, simply launch:
<pre class="brush:js;'">
apt-get install speedometer
</pre>
For others distros (like us with CentOS), We first have to download and install <a href="http://excess.org/urwid/">Urwid</a>:
<pre class="brush:js;'">
cd /downloads
wget http://excess.org/urwid/urwid-1.0.1.tar.gz
tar -xvzf urwid-1.0.1.tar.gz
cd urwid-1.0.1
python setup.py install
</pre>
Then we can install Speedometer like this:
<pre class="brush:js;'">
cd /downloads
wget http://excess.org/speedometer/speedometer-2.8.tar.gz
tar -xvzf speedometer-2.8.tar.gz
cp speedometer.py /usr/local/bin/speedometer
chown root: /usr/local/bin/speedometer
chmod 755 /usr/local/bin/speedometer
</pre>
That's all !
Now, let's see the help command of this little tool:
<pre class="brush:js;'">
[root@localhost ~]$ speedometer
Usage: speedometer [options] tap [[-c] tap]...
Monitor network traffic or speed/progress of a file transfer. At least one
tap must be entered. -c starts a new column, otherwise taps are piled
vertically.
Taps:
-f filename [size] display download speed [with progress bar]
-r network-interface display bytes received on network-interface
-t network-interface display bytes transmitted on network-interface
-c start a new column for following tap arguments
Options:
-b use old blocky display instead of smoothed
display even when UTF-8 encoding is detected
(use this if you see strange characters)
-i interval-in-seconds eg. "5" or "0.25" default: "1"
-k (1|16|88|256) set the number of colors this terminal
supports (default 16)
-l use linear charts instead of logarithmic
you will VERY LIKELY want to set -m as well
-m chart-maximum set the maximum bytes/second displayed on
the chart (default 2^32)
-n chart-minimum set the minimum bytes/second displayed on
the chart (default 32)
-p use original plain-text display (one tap only)
-s use bits/s instead of bytes/s
-x exit when files reach their expected size
-z report zero size on files that don't exist
instead of waiting for them to be created
Note: -rx and -tx are accepted as aliases for -r and -t for compatibility
with earlier releases of speedometer. -f may be also omitted for similar
reasons.
Python Version: 2.7
Urwid >= 0.9.9.1 detected: yes UTF-8 encoding detected: yes
</pre>
To display live RX traffic on eth0 network interface, simply launch (press 'q' to quit):
<pre class="brush:js;'">
speedometer -rx eth0
</pre>
To display live TX traffic on eth0 network interface, launch:
<pre class="brush:js;'">
speedometer -tx eth0
</pre>
<br>
<b>Here's some usage examples given on Speedometer Web page:</b><br><br>
How long it will take for my 38MB transfer to finish?
<pre class="brush:js;'">
speedometer favorite_episode.rm $((38*1024*1024))
</pre>
How quickly is another transfer going?
<pre class="brush:js;'">
speedometer dl/big.avi
</pre>
How fast is this LAN?
<pre class="brush:js;'">
host-a$ cat /dev/zero | nc -l -p 12345
host-b$ nc host-a 12345 > /dev/null
host-b$ speedometer -rx eth0
</pre>
How fast is the upstream on this ADSL line? (start an upload first)
<pre class="brush:js;'">
speedometer -tx ppp0
</pre>
How fast can I write data to my filesystem? (with at least 1GB free)
<pre class="brush:js;'">
dd bs=1000000 count=1000 if=/dev/zero of=big_nothing &
speedometer big_nothing
</pre>
<b>To finish, let me show you some screenshots that we can see on Speedometer Web page:</b><br><br>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://excess.org/media/speedometer-transp1.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="330" width="496" src="http://excess.org/media/speedometer-transp1.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://excess.org/media/speedometer-light16.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="330" width="496" src="http://excess.org/media/speedometer-light16.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://excess.org/media/speedometer-256.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="330" width="496" src="http://excess.org/media/speedometer-256.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://excess.org/media/speedometer-mono.png" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="330" width="496" src="http://excess.org/media/speedometer-mono.png" /></a></div>
Link to Speedometer Web page: <a href="http://excess.org/speedometer/">http://excess.org/speedometer/</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com3tag:blogger.com,1999:blog-7641762529570013613.post-72060523539587291012011-11-30T09:29:00.000+01:002011-11-30T09:29:49.458+01:0010 PHP Tutorials For Beginners, Tips & Tricks<a href="http://www.wokay.com/technology/10-php-tutorials-for-beginners-tips-tricks-55986.html">10 PHP Tutorials For Beginners, Tips & Tricks</a>: <br><br><a style="font-size:13px" href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk">'via Blog this'</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-41971562604413882632011-11-15T15:00:00.001+01:002011-12-09T17:30:43.718+01:00Move MySQL datadirWe are going to see how to move MySQL datadir without loosing data. This is usefull when you meet a disk space problem or when you want to change your database server.<br><br>
Operation is very simple, we just have to create a new directory in which we are going to copy the old datadir content. MySQL must be stopped before the copy to be sure that nothing will be modified during the data copy. Then we have to edit the mysql config file to define the new datadir. Finally, restart MySQL server and check that everything is ok.
old mysql datadir: /var/lib/mysql
new mysql datadir: /opt/mysql/datadir
Here is the detail of commands:
<pre class="brush:js;'">
# create directory, chown, chmod it
mkdir /opt/mysql/datadir
chown mysql:mysql /opt/mysql/datadir
chmod 0755 /opt/mysql/datadir
# save my.cnf
cp /etc/my.cnf /etc/my.cnf.bak
# stop mysql
/etc/init.d/mysql.server stop
# change datadir in my.cnf
vim /etc/my.cnf
:%s?/var/lib/mysql?/opt/mysql/datadir?g
:wq
# copy old datadir to new datadir
cp -rp /var/lib/mysql/* /opt/mysql/datadir/
# start mysql
/etc/init.d/mysql.server start
</pre>
Now it's important to check that everything working fine, if all is ok we can remove the old datadir:
<pre class="brush:js;'">
rm -rf /var/lib/mysql
</pre>
Otherwise, we go back like this:
<pre class="brush:js;'">
/etc/init.d/mysql.server stop
mv /etc/my.cnf /etc/my.cnf2 && mv /etc/my.cnf.bak /etc/my.cnf
/etc/init.d/mysql.server start
</pre>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-80628036295877494422011-11-02T15:00:00.000+01:002011-11-02T15:48:16.317+01:00PHP Server MonitorPHP Server Monitor is a script that monitors the status of a server or service in a list on a given port. It comes with a web interface from which you can add a server or service, this interface is coupled to a MySQL database. We can also manage users will be alerted for each service by mail or SMS in case of failure. To check a site, the script will use cURL to interpret the HTTP code.<br>
<br>
<b>Features:</b><br>
* check if services (ie IMAP) are up and running on your servers<br>
* check if websites are available (ie no 404 Not found errors)<br>
* get email notifications if a server or website goes down<br>
* get sms (text message) notifications if a server or website goes down<br>
* add multiple users with email address and phone number<br>
* choose who receives the notifications for each server<br>
* easy to use interface<br>
* saves all errors in a log table<br>
* see response time from servers and websites<br>
* separate cronjob file<br>
<br>
<b>Install:</b><br>
<pre class="brush:js;'">
cd /downloads
wget http://downloads.sourceforge.net/.../phpservermon-2.0.1.zip...
unzip phpservermon-2.0.1.zip
mv phpservermon /var/www/html/
chown -R apache:apache /var/www/html/phpservermon
cd /var/www/html/phpservermon
mv config.inc.php.sample config.inc.php
vim config.inc.php
// Database information
// Prefix used for tables
define('SM_DB_PREFIX', 'monitor_');
// Database username
define('SM_DB_USER', 'root');
// Database password
define('SM_DB_PASS', 'yourpassword');
// Database name
define('SM_DB_NAME', 'phpservermon');
// Database host
define('SM_DB_HOST', 'localhost');
:wq
mysql -e "create database phpservermon;"
http://myserver/phpservermon/install.php
rm /var/www/html/phpservermon/install.php
</pre>
<br>
<b>Use:</b><br>
http://myserver/phpservermon<br>
<br>
To check services, we need to configure a cron job with provided script in project:<br>
<pre class="brush:js;'">
crontab -e
*/5 * * * * /usr/bin/php -q /var/www/html/phpservermon/cron/status.cron.php
:wq
</pre>
<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sourceforge.net/projects/phpservermon/screenshots/236714/182/137" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="137" width="182" src="http://sourceforge.net/projects/phpservermon/screenshots/236714/182/137" /></a></div>
<br>
<br>
Project page:<br>
<a href="http://sourceforge.net/projects/phpservermon/">http://sourceforge.net/projects/phpservermon/</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-82467725556985772882011-10-31T12:04:00.000+01:002011-10-31T12:04:35.626+01:00Test de montée en charge (benchmark) avec des logiciels libres | L'admin sous GNU / Linux - Blog Libre<a href="http://blog.admin-linux.org/administration/test-de-montee-en-charge-benchmark-avec-des-logiciels-libres">Test de montée en charge (benchmark) avec des logiciels libres | L'admin sous GNU / Linux - Blog Libre</a>: <br><br><a style="font-size:13px" href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk">'via Blog this'</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-20785659141714851112011-10-07T09:11:00.001+02:002011-10-07T09:13:10.370+02:00Blitz - Making load and performance testing a fun sport<a href="http://blitz.io/">Blitz - Making load and performance testing a fun sport</a>:
<a href="https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk" style="font-size: 13px;">'via Blog this'</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/dp8z4a9cvRI?feature=player_embedded' frameborder='0'></iframe></div>
<br />yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-90467758800641230872011-10-06T13:30:00.000+02:002011-10-26T13:13:10.190+02:00Bash: script compte à reboursVoici un petit script bash permettant d'afficher un compte à rebours dans le shell. On va utiliser une fonction pour ça: decompte.
On va afficher un décompte de 30 secondes avant de revenir sur le prompt.
<pre class="brush:js;'">
[root@localhost ~]# vim compte_a_rebours.sh
#!/bin/bash
# fonction rebours
# Affichage d'un compte à rebours
# Usage : rebours [nombre de secondes]
# Notes : le "echo -e" permet l'utilisation des caractères spéciaux
decompte() {
i=$1
echo " "
while [[ $i -ge 0 ]]
do
echo -e "\033[31m\r "$i" \c\033[0m"
sleep 1
i=$(expr $i - 1)
done
echo " - "
echo -e "\033[32mFin du decompte\033[0m"
}
# appel d'un compte à rebours de 5 secondes
decompte 30
exit
:wq
[root@localhost ~]# chmod 755 compte_a_rebours.sh
[root@localhost ~]# ./compte_a_rebours.sh
0 -
Fin du decompte
[root@localhost ~]#
</pre>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-1716366779190387632011-10-03T11:34:00.000+02:002011-10-26T13:14:39.451+02:00Apache benchmark with Siege<br />
Siege is an http load testing and benchmarking utility. It was designed to let web developers measure their code under duress, to see how it will stand up to load on the internet. Siege supports basic authentication, cookies, HTTP and HTTPS protocols. It lets its user hit a web server with a configurable number of simulated web browsers. Those browsers place the server "under siege."<br />
<br />
Siege can be installed with yum (2.66 version from rpmforge repo or 2.70 version from epel repo) or from sources that can be found on the project <a href="http://www.joedog.org/index/siege-home">website</a>. In our case, we will use rpm package from epel repo.<br />
<br />
Installation and initial configuration :
<br />
<pre class="brush:js;'">[root@localhost ~]# yum install siege -y
[root@localhost ~]# siege.config
New configuration template added to /root/.siegerc
Run siege -C to view the current settings in that file
[root@localhost ~]# siege -C
CURRENT SIEGE CONFIGURATION
JoeDog/1.00 [en] (X11; I; Siege 2.70)
Edit the resource file to change the settings.
----------------------------------------------
version: 2.70
verbose: true
debug: false
protocol: HTTP/1.1
connection: close
concurrent users: 15
time to run: n/a
repetitions: n/a
socket timeout: 30
delay: 1 sec
internet simulation: false
benchmark mode: false
failures until abort: 1024
named URL: none
URLs file: /usr/etc/urls.txt
logging: true
log file: /var/siege.log
resource file: /root/.siegerc
allow redirects: true
allow zero byte data: true
allow chunked encoding: true
proxy auth:
www auth:</pre>
Available options:
<br />
<pre class="brush:js;'">[root@localhost ~]# siege -h
SIEGE 2.70
Usage: siege [options]
siege [options] URL
siege -g URL
Options:
-V, --version VERSION, prints the version number.
-h, --help HELP, prints this section.
-C, --config CONFIGURATION, show the current config.
-v, --verbose VERBOSE, prints notification to screen.
-g, --get GET, pull down HTTP headers and display the
transaction. Great for application debugging.
-c, --concurrent=NUM CONCURRENT users, default is 10
-i, --internet INTERNET user simulation, hits URLs randomly.
-b, --benchmark BENCHMARK: no delays between requests.
-t, --time=NUMm TIMED testing where "m" is modifier S, M, or H
ex: --time=1H, one hour test.
-r, --reps=NUM REPS, number of times to run the test.
-f, --file=FILE FILE, select a specific URLS FILE.
-R, --rc=FILE RC, specify an siegerc file
-l, --log[=FILE] LOG to FILE. If FILE is not specified, the
default is used: PREFIX/var/siege.log
-m, --mark="text" MARK, mark the log file with a string.
-d, --delay=NUM Time DELAY, random delay before each requst
between 1 and NUM. (NOT COUNTED IN STATS)
-H, --header="text" Add a header to request (can be many)
-A, --user-agent="text" Sets User-Agent in request
Copyright (C) 2010 by Jeffrey Fulmer, et al.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.</pre>
Testing:
<br />
<pre class="brush:js;'">[root@localhost ~]# siege -b -c 10 -r 3 http://nuxadmin.blogspot.com
** SIEGE 2.70
** Preparing 10 concurrent users for battle
The server is now under siege...
HTTP/1.1 200 1.04 secs: 95476 bytes ==> /
HTTP/1.1 200 1.17 secs: 95476 bytes ==> /
HTTP/1.1 200 1.19 secs: 95476 bytes ==> /
HTTP/1.1 200 1.56 secs: 95476 bytes ==> /
HTTP/1.1 200 1.80 secs: 95476 bytes ==> /
HTTP/1.1 200 0.79 secs: 95476 bytes ==> /
HTTP/1.1 200 1.85 secs: 95476 bytes ==> /
HTTP/1.1 200 2.07 secs: 95476 bytes ==> /
HTTP/1.1 200 1.12 secs: 95476 bytes ==> /
HTTP/1.1 200 0.81 secs: 95476 bytes ==> /
HTTP/1.1 200 2.78 secs: 95476 bytes ==> /
HTTP/1.1 200 1.07 secs: 95476 bytes ==> /
HTTP/1.1 200 0.85 secs: 95476 bytes ==> /
HTTP/1.1 200 2.93 secs: 95476 bytes ==> /
HTTP/1.1 200 1.15 secs: 95476 bytes ==> /
HTTP/1.1 200 0.91 secs: 95476 bytes ==> /
HTTP/1.1 200 2.16 secs: 95476 bytes ==> /
HTTP/1.1 200 1.68 secs: 95476 bytes ==> /
HTTP/1.1 200 1.31 secs: 95476 bytes ==> /
HTTP/1.1 200 0.78 secs: 95476 bytes ==> /
HTTP/1.1 200 1.20 secs: 95476 bytes ==> /
HTTP/1.1 200 1.37 secs: 95476 bytes ==> /
HTTP/1.1 200 2.00 secs: 95476 bytes ==> /
HTTP/1.1 200 1.45 secs: 95476 bytes ==> /
HTTP/1.1 200 1.36 secs: 95476 bytes ==> /
HTTP/1.1 200 0.61 secs: 95476 bytes ==> /
HTTP/1.1 200 0.58 secs: 95476 bytes ==> /
HTTP/1.1 200 5.55 secs: 95476 bytes ==> /
HTTP/1.1 200 0.49 secs: 95476 bytes ==> /
HTTP/1.1 200 0.47 secs: 95476 bytes ==> /
done. Transactions: 30 hits
Availability: 100.00 %
Elapsed time: 6.52 secs<
Data transferred: 2.73 MB
Response time: 1.47 secs
Transaction rate: 4.60 trans/sec
Throughput: 0.42 MB/sec
Concurrency: 6.76
Successful transactions: 30
Failed transactions: 0
Longest transaction: 5.55
Shortest transaction: 0.47
FILE: /var/siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change
the directive 'show-logfile' to false
</pre>
Another test:
<br />
<pre class="brush:js;'">[root@localhost ~]# siege -c 30 -i -t 30s -d 5 http://nuxadmin.blogspot.com
...
Lifting the server siege... done. Transactions: 167 hits
Availability: 100.00 %
Elapsed time: 29.59 secs
Data transferred: 15.21 MB
Response time: 2.48 secs
Transaction rate: 5.64 trans/sec
Throughput: 0.51 MB/sec
Concurrency: 13.99
Successful transactions: 167
Failed transactions: 0
Longest transaction: 6.84
Shortest transaction: 0.78
...
</pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.joedog.org/inc/html/default/images/pommie-sm.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.joedog.org/inc/html/default/images/pommie-sm.gif" /></a></div>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-15911858344871666172011-08-14T14:36:00.001+02:002011-08-14T14:36:53.881+02:00Hack Wii 4.3 sans jeuxLa célèbre team Twiizers vient de rendre disponible son tout nouveau projet dénommé LetterBomb et devance Giantpune qui a visiblement un peu trop attendu pour distribuer son outil nommé Mailbox Bomb.<br />
LetterBomb permet donc de hacker la console Nintendo Wii fonctionnant avec le firmware 4.3 sans avoir besoin d'exploiter les failles des célèbres jeux nécessaires jusqu'à présent.<br />
Les profiteurs qui vendaient un Lego Indiana Jones à 150 € sur Ebay vont devoir se trouver un autre business car la côte de ces jeux qui permettent le hack risquent de baisser rapidement !<br />
<br />
Pour récupérer LetterBomb, il suffit de se rendre sur le site <a href="http://please.hackmii.com/">http://please.hackmii.com/</a> et indiquer l'adresse MAC de sa console.<br />
On se retrouve alors avec une archive nommée LetterBomb.zip qu'il faudra dézipper à la racine d'une carte SD (comme d'habitude: maximum 2Go, formatée en FAT32).<br />
Il suffit ensuite d'insérer la carte SD dans la Wii puis de consulter ses mails et lire le message 'LetterBomb' ceci va lancer HackMii à partir duquel on pourra installer BootMii et l'Homebrew Channel.<br />
La Wii est désormais hackée et il ne reste plus qu'à installer le homebrew USB Loader GX pour pouvoir lancer ses backups depuis un sotckage USB.<br />
<br />
Source: <a href="http://hackmii.com/2011/08/letterbomb/">http://hackmii.com/2011/08/letterbomb/</a>yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-65935536262706860372011-08-02T12:01:00.000+02:002011-10-07T19:09:17.402+02:0010 essential MySQL tools for adminsI found this very interesting article about MySQL tools on networkworld yesterday, it describes the following tools:<br />
<br />
mk-query-digest<br />
mydumper<br />
xtrabackup and xtrabackup-manager<br />
tcprstat<br />
mk-table-checksum<br />
stalk and collect<br />
mycheckpoint<br />
shard-query<br />
mk-archiver<br />
oak-security-audit<br />
<br />
Here is the link:<br />
<div>
<a href="http://www.networkworld.com/news/2011/080111-10-essential-mysql-tools-for.html?source=NWWNLE_nlt_network_systems_2011-08-01">10 essential MySQL tools for admins</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.mysql.fr/common/logos/logo-mysql-110x57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.mysql.fr/common/logos/logo-mysql-110x57.png" /></a></div>
<br /></div>
yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-14478606990041236052011-07-27T10:19:00.000+02:002011-10-07T19:09:41.468+02:00MySQL-MHA: HA replication toolA new MySQL project about high availability is proposed by Yoshinori Matsunobu. This project permits to automating master failover and slave promotion within short downtime.<br />
<br />
This is the first time that we can see a serious MySQL failover project into replication environment. I haven't tested it yet but lot of people speak about MySQL-MHA on the web actually. Yoshinori Matsunobu is associate with SkySQL for that they provide the commercial support.<br />
<br />
MySQL-MHA brings a lot of advantages such as:<br />
<br />
<ul>
<li>Automated master monitoring and failover</li>
<li>Interactive (manual) Master Failover</li>
<li>Non-interactive master failover</li>
<li>Online switching master to a different host</li>
</ul>
<br />
Every informations and descriptions can be found on the <a href="http://code.google.com/p/mysql-master-ha/">google code web page of MySQL-MHA</a>.<br />
You can know more about Yoshinori Matsunobu on <a href="http://yoshinorimatsunobu.blogspot.com/">his blog</a>.<br />
<br />
Project is released few days ago and I think that it will no need to wait for a long time to seeing this marvelous tools into your MySQL production replication environment.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.mysql.fr/common/logos/logo-mysql-110x57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.mysql.fr/common/logos/logo-mysql-110x57.png" /></a></div>
<br />yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0tag:blogger.com,1999:blog-7641762529570013613.post-59463517810805050752011-07-25T19:18:00.003+02:002011-10-26T13:16:27.607+02:00Cobbler installation server<b>INTRODUCTION</b><br />
Cobbler is an installation server that permits to install easily and automatically operating systems, virtualized or not with PXE. We will describe installation, configuration and use into this howto.<br />
For this howto we use a CentOS 5 x86_64 distro.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://fedorahosted.org/cobbler/attachment/wiki/UserDocs/logo.png?format=raw" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://fedorahosted.org/cobbler/attachment/wiki/UserDocs/logo.png?format=raw" /></a></div>
<br />
<b>INSTALLATION</b><br />
First thing to do is to configure DHCP server. In our case, Cobbler server is not on the same machine that DHCP server, so we have to register the PXE class for Cobbler server on DHCP server.<br />
Here is the part of dhcpd.conf config file regarding Cobbler service. After configuration, we have to restart the DHCP service to validate changes:<br />
<pre class="brush:js;'">vi /etc/dhcp/dhcpd.conf
host cobbler
{
option host-name "cobbler";
ddns-hostname "cobbler";
hardware ethernet 00:00:00:00:00:00; #MAC address of cobbler server
fixed-address 192.168.0.XX; #IP of Cobbler server
allow booting;
allow bootp;
class "PXE" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.0.XX; #IP of Cobbler server
filename "pxelinux.0";
}
}
:wq
/etc/init.d/dhcpd restart
</pre>
Next, an easy yum command permits to install the Cobbler service on the server:<br />
<pre class="brush:js;'">yum install PyYAML cobbler cobbler-web
</pre>
Installation is now finished.<br />
<br />
<br />
<b>CONFIGURATION</b><br />
For configuration, we will initially adjust cobbler parameters, we have to define an encrypted password that will be the root password for the machine installed with PXE and we define IP address for cobbler server.<br />
We begin by creating the encrypted password using htpasswd:<br />
<pre class="brush:js;'">/usr/bin/htpasswd -c /home/htpasswd root
New password: [cobbler]
Re-type new password: [cobbler]
Adding password for user root
cat /home/htpasswd
root:xH.KydRoK8CyQ
</pre>
The password to use in the config file of Cobbler server is located after 'root', now we can edit the config file of Cobbler server:<br />
<pre class="brush:js;'">vi /etc/cobbler/settings
default_password_crypted: xH.KydRoK8CyQ
next_server: 192.168.0.XX #IP of Cobbler server
server: 192.168.0.XX #IP of Cobbler server
:wq
</pre>
Then we will install the services needed to run cobbler:<br />
<pre class="brush:js;'">yum install tftp tftp-server xinetd
/etc/init.d/xinetd start
/etc/init.d/cobblerd start
chkconfig xinetd on
chkconfig cobblerd on
</pre>
Now we will monitor the proper Cobbler configuration and adjust the parameters as will be shown:<br />
<pre class="brush:js;'">cobbler check
/etc/init.d/httpd start
vi /etc/xinetd.d/rsync
<span class="Apple-tab-span" style="white-space: pre;"> </span>disable = no
:wq
yum install cman
cobbler get-loaders
yum install debmirror
vi /etc/debmirror.conf
<span class="Apple-tab-span" style="white-space: pre;"> </span># @dists="sid";
<span class="Apple-tab-span" style="white-space: pre;"> </span># @arches="i386";
:wq
/etc/init.d/cobblerd restart
cobbler sync
cobbler check
</pre>
Cobbler is now properly configured. The next step is to import the ISO distribution that we want to make it available via PXE. In our case we will use CentOS and import can not be done with the netinstall ISO and ISO DVD includes too many packages that do not serve us.<br />
We have so customized CentOS using CD1 of CentOS. A Howto was written on this blog about customization of CentOS, you can find it here: <a href="http://nuxadmin.blogspot.com/2011/03/customize-centos.html">Customize CentOS</a><br />
We are going to use this custom ISO file for the import into Cobbler server.<br />
First, we must download this ISO file locally (on Cobbler server) then we gonna mount it and import it.<br />
<pre class="brush:js;'">mount -t auto -o loop /downloads/CentOS-5.5-x86_64-core.iso /mnt/
cobbler import --path=/mnt --name=Centos5 –arch=x86_64
cobbler sync
cobbler list
distros:
Centos5-x86_64
Centos5-xen-x86_64
profiles:
Centos5-x86_64
Centos5-xen-x86_64
systems:
repos:
images:
</pre>
We can see in this list (distros and profiles) that CentOS ISO was added to Cobbler server. Now we have to create local repository. We could use the official repo CentOS but be aware that the cobbler will grab all the packages locally from the repo.<br />
This operation takes time and a lot of disk space. Knowing that we have no need of all packages available on the official CentOS repo we will create a local repo with little packets which will occupy little disk space but more importantly to make the installation via PXE even faster.<br />
So to create the local repo, we have to install a virtual machine using the custom CentOS ISO created previously (howto on the blog) and then we're gonna download all installed packages locally (on the virtual machine) for create the local repository.<br />
I don't detail the installation of a VM from customized CentOS ISO (I assume you know how to do this).<br />
To download installed packages, we're gonna use a method described previously on this blog too (here is the article: <a href="http://nuxadmin.blogspot.com/2011/01/download-rpm-packages-with-yum.html">Download RPM packages with yum</a>): with yumdownloader program<br />
<pre class="brush:js;'">mkdir /tmp/rpm
yum update -y
yum install yum-utils -y
rm -rf /root/rpm.log &&rpm -qa > rpm.log
for i in $(cat /root/rpm.log) ; do yumdownloader $i --destdir=/tmp/rpm ; done
</pre>
Then, we declare this local repo on the Cobbler server. To do this we copy every rpm packages into /tmp/rpm directory's on the VM to /tmp/rpm on the Cobbler server:<br />
<pre class="brush:js;'"># Copy packages from VM to Cobbler server
scp -r /tmp/rpm/* user@IP_COBBLER:/tmp/rpm/
# Declare Cobbler local repo
cobbler repo add --mirror=/tmp/rpm/ --name=centos5-local
cobbler reposync
</pre>
We can see now the cobbler local repo:<br />
<pre class="brush:js;'">cobbler list
repos:
centos5-local
</pre>
Then we will edit the default kickstart file, this file permits to automate CentOS install:<br />
<pre class="brush:js;'">cd /var/lib/cobbler/kickstarts/
mv sample.ks sample.ks_bak
vi sample.ks
auth --useshadow --enablemd5
bootloader --location=mbr
clearpart --all --initlabel
text
firewall --disabled
firstboot --disable
keyboard fr-pc
lang fr_FR.UTF-8
url --url=$tree
$yum_repo_stanza
$SNIPPET('network_config')
reboot
rootpw --iscrypted $default_password_crypted
selinux --disabled
skipx
timezone --utc Europe/Paris
install
zerombr
autopart
%pre
$SNIPPET('log_ks_pre')
$kickstart_start
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%packages
$SNIPPET('func_install_if_enabled')
%post
$SNIPPET('log_ks_post')
$yum_config_stanza
$SNIPPET('post_install_kernel_options')
$SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
$SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
$SNIPPET('post_anamon')
$kickstart_done
:wq
</pre>
The Cobbler configuration is now finished, we can test the Cobbler service. We create a new VM without boot media, we must activate network/PXE in the boot sequence. Then we start this new VM that will ask an IP address to DHCP server and ask PXE for install support.<br />
<br />
<br />
<b>COBBLER WEB</b><br />
We will now install the web interface allows the administration of the cobbler and then configure:<br />
<pre class="brush:js;'">yum install cobbler-web
vi /etc/cobbler/modules.conf
[authentication]
module = authn_configfile
[authorization]
module = authz_allowall
:wq
htdigest -c /etc/cobbler/users.digest "Cobbler"cobbler
# Type cobbler twice when asking password to have login/password: cobbler/cobbler
/etc/init.d/cobblerd restart
/etc/init.d/httpd restart
</pre>
You can get on the interface with a browser to the URL: http://192.168.0.X/cobbler_web (where X must be replace with your Cobbler IP)<br />
Login: cobbler<br />
Password: cobbler<br />
<br />
On this web interface, you can do everything that you can do from command line interface (CLI).<br />
<br />
<br />
<b>KOAN</b><br />
Koan is a small program that adds to cobbler and interacts with it for reinstallation and virtualization management. Koan means: kickstart over a network, thus we can use it on a client server to calling cobbler server.<br />
In our case, we will mainly use it for deploying virtual machines. It can be installed via yum, but a more current version is available from the EPEL repo.<br />
Be careful about kernel used in CentOS custom ISO. In my experience, I met problems with some kernels on Xen systems using koan.<br />
<br />
To get koan and install it:<br />
<pre class="brush:js;'">cd /downloads
wget http://download.fedora.redhat.com/pub/epel/5/x86_64/koan-2.0.9-1.el5.noarch.rpm
rpm -i koan-2.0.9-1.el5.noarch.rpm
</pre>
Here is an example of koan command to install CentOS virtual machine on Xen system (kernel 2.6.18-194.el5)<br />
<pre class="brush:js;'">koan --virt --profile=centxenvm-xen-x86_64 --server=192.168.0.98 --virt-type=auto --nogfx --virt-name=centos –virt-path=/home/xen/centos/
</pre>
I don't specify the method used to deploy a new VM with koan because I had to customize a lot of thing before that the VM works... It's DIY and I'm not quite happy with it in order to describe it !<br />
<br />
This howto is ended, I hope that you can apply it in your workspace and that you understand how having a Cobbler server working perfectly. I use a CentOS environment but I think that other distros are supported with this system. Contact me if you need more help with Cobbler.yG1http://www.blogger.com/profile/07826275220066626825noreply@blogger.com0