tag:blogger.com,1999:blog-29176494920343251882023-11-16T03:57:21.738-08:00Carlos Gomez Technical DocsCarlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-2917649492034325188.post-59268017851848395502013-05-01T20:10:00.001-07:002013-05-01T20:19:17.676-07:00Using GPG on linux<div xmlns="http://www.w3.org/1999/xhtml">
Creating a new private and public key<br />
<br />
#gpg --gen-key<br />
<br />
On Red Hat 6 , it will require to have full access to the terminal that your using. You can avoid that generating a key in batch mode.<br />
<br />
#cat file.txt<br />
%echo Generating a default key<br />
Key-Type: default<br />
Subkey-Type: default<br />
Name-Real: Name<br />
Name-Comment: Comments<br />
Name-Email: email<br />
Expire-Date: 0<br />
Passphrase: changeme<br />
# Do a commit here, so that we can later print "done" :-)<br />
%commit<br />
%echo done<br />
<br />
#gpg --gen-key --batch file.txt<br />
<br />
After all this, server normally requires some entropy to generate the key, so you can avoid that using a second terminal an running the following.<br />
<br />
#rngd -r /dev/urandon</div>
Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-82482005363022375872010-11-23T11:35:00.001-08:002010-11-23T11:35:08.659-08:00Rollback application deployments with yum and RPM<p>In many cases, you will require to have a software repository or YUM repo set up on your network so you can have package management on your Linux network. The regular process is to update the new package on the new environment, test it or rollback the changes.</p> <p>Using yum in combination with RPMs as package management tool is a great strategy since consistency and best practices can be applied. When a package is updated via YUM , several RPMs packages can be installed or a single package can be updated using the option –U with rpm.</p> <p><strong>#yum update</strong></p> <p>or </p> <p><strong>#rpm –Uvh foo.rpm </strong></p> <p>If you enable the repackaging option , every time you install an update the old package is sent to /var/spool/repackage dir on RPM form. With RPMs , you will need to use the option –-repackage:</p> <p><strong># rpm -Uvh --repackage foo.rpm</strong></p> <p>With YUM, you can enable it on /etc/yum.conf adding the following line:</p> <p><em>tsflags=repackage</em></p> <p>and /etc/rpm/macros.up2date  file needs to have the following line:</p> <p><em>%_repackage_all_erasures 1 </em></p> <p>Finally, if you require to rollback changes you  will have to use the rpm command.</p> <p><strong># rpm -Uvh --rollback '2 hours ago' </strong></p> <p>Restore will be based on packages 2 hours ago.</p> <p>I hope you enjoy it.</p> Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-52711411723905923302010-03-04T13:20:00.000-08:002010-03-04T14:01:37.623-08:00Web Load Testing with OpenSource Tools (Linux)There are many commercial tools that can help you to estimate the load on your web servers, however there are also several opensource tools that can help you to estimate the load on the servers.<br /><br />After my research, I found the following tools:<br /><br /><ol><li><a href="http://openwebload.sourceforge.net/">Openload</a></li><li><a href="http://freshmeat.net/projects/httperf/">httperf</a></li><li><a href="http://httpd.apache.org/docs/2.2/programs/ab.html">ab</a></li><li><a href="http://joedog.org/index/siege-home">siege</a></li></ol>These tools are really nice and they have a lot of options to perform testing however I was a little disappointed when I tried to use POST methods. Moreover, they only use the server IP to create connections to the server, and the reports where very limited. If I wanted to simulate different connections with different IPs I had to create scripts. So I decided to check curl to start to generate scripts.<br /><br /><a href="http://curl.haxx.se/">Curl </a> is a very powerful command line tool that can create HTTP or HTTPS connections. Moreover it supports POST methods and cookies.<br /><br />Example:<br /><br /><span style="font-weight: bold;">#curl -c cookie.txt -d "login=user&password=password" http://webserver/login.php</span><br /><br />This command will pass login/password (POST DATA) to the form and it will store the cookie on cookie.txt file. Then you can use the cookie to access restricted pages.<br /><br />Example:<br /><br /><span style="font-weight: bold;">#curl -b cookie.txt http://webserver/search.php</span><br /><br />Great tool, do not you think? ...well let's google to find somebody that has worked scripting with curl.<br /><br />Voila ...I found a tool that it is great for create load testing = <a href="http://curl-loader.sourceforge.net/">CURL-LOADER</a><br /><br />This tool has all the features that I need for testing:<br /><ul><li>Multiple clients.</li><li>Multiple IPs.</li><li>Post Method available.</li><li>Complete sequence of page access.</li><li>Reports per client and totals</li></ul>Basically you would have to download the latest file from <a href="http://sourceforge.net/projects/curl-loader/files/">http://sourceforge.net/projects/curl-loader/files/</a> then make sure you have GCC compiler, Openssl and Openssl development installed.<br /><br />Then do<br /><span style="font-weight: bold;">$tar zxfv curl-loader-<version>.tar.gz</span><br /><span style="font-weight: bold;">$cd curl-loader-<version></span><br /><br /><span style="font-weight: bold;">$make optimize=1 debug=0</span><br /><span style="font-weight: bold;">#make install </span><br /><br />The format to use this tool is basically:<br /><br /><span style="font-weight: bold;">#curl-loader -f script.conf</span><br /><br />Where script.conf is the file that contains the parameter for the load testing.<br />Some examples can be found on the following directory:<br /><br /><span style="font-weight: bold;">#cd /usr/share/doc/curl-loader/conf-examples/</span><br /><br />However I can show you the following example:<br /><br /><span style="font-weight: bold;"># cat script.conf</span><br /><span style="font-style: italic;">########### GENERAL SECTION ###################</span><br /><span style="font-style: italic;">#</span><br /><span style="font-style: italic;">BATCH_NAME=script-results</span><br /><span style="font-style: italic;">CLIENTS_NUM_MAX=255</span><br /><span style="font-style: italic;">CLIENTS_RAMPUP_INC=2</span><br /><span style="font-style: italic;">INTERFACE=eth0</span><br /><span style="font-style: italic;">NETMASK=22</span><br /><span style="font-style: italic;">IP_ADDR_MIN=10.100.0.0</span><br /><span style="font-style: italic;">IP_ADDR_MAX=10.100.0.254</span><br /><span style="font-style: italic;">IP_SHARED_NUM=255</span><br /><span style="font-style: italic;">URLS_NUM=4</span><br /><span style="font-style: italic;">CYCLES_NUM= 200</span><br /><br /><span style="font-style: italic;">########### URLs SECTION #######################</span><br /><br /><span style="font-style: italic;">### Login URL - cycling</span><br /><br /><span style="font-style: italic;"># GET-part</span><br /><span style="font-style: italic;">#</span><br /><span style="font-style: italic;">URL=http://webserver/login.php</span><br /><span style="font-style: italic;">URL_SHORT_NAME="Login-GET"</span><br /><span style="font-style: italic;">REQUEST_TYPE=GET</span><br /><span style="font-style: italic;">TIMER_URL_COMPLETION = 5000</span><br /><span style="font-style: italic;">TIMER_AFTER_URL_SLEEP =1000</span><br /><br /><span style="font-style: italic;"># POST-part</span><br /><span style="font-style: italic;">#</span><br /><span style="font-style: italic;">URL=""</span><br /><span style="font-style: italic;">URL_SHORT_NAME="Login-POST"</span><br /><span style="font-style: italic;">URL_USE_CURRENT=1</span><br /><span style="font-style: italic;">USERNAME= user</span><br /><span style="font-style: italic;">PASSWORD= pass</span><br /><span style="font-style: italic;">REQUEST_TYPE=POST</span><br /><span style="font-style: italic;">FORM_USAGE_TYPE= SINGLE_USER</span><br /><span style="font-style: italic;">FORM_STRING= username=%s&password=%s</span><br /><span style="font-style: italic;">TIMER_URL_COMPLETION = 4000</span><br /><span style="font-style: italic;">TIMER_AFTER_URL_SLEEP =1000</span><br /><br /><span style="font-style: italic;">### Cycling URL</span><br /><span style="font-style: italic;">#</span><br /><span style="font-style: italic;">URL=http://webserver/search.php?action=search&keyword=test</span><br /><span style="font-style: italic;">URL_SHORT_NAME="Service List"</span><br /><span style="font-style: italic;">REQUEST_TYPE=GET</span><br /><span style="font-style: italic;">TIMER_URL_COMPLETION = 5000</span><br /><span style="font-style: italic;">TIMER_AFTER_URL_SLEEP =1000</span><br /><br /><span style="font-style: italic;">### Logoff URL - cycling, uses GET and cookies to logoff.</span><br /><span style="font-style: italic;">#</span><br /><span style="font-style: italic;">URL=http://webserver/logout.php</span><br /><span style="font-style: italic;">URL_SHORT_NAME="Logoff"</span><br /><span style="font-style: italic;">REQUEST_TYPE=GET</span><br /><span style="font-style: italic;">TIMER_URL_COMPLETION = 0</span><br /><span style="font-style: italic;">TIMER_AFTER_URL_SLEEP =1000</span><br /><br />A quick explanation is the following:<br /><br />1- Results will be stored on files according to the BATCH_NAME.<br />2- The machine will be using 255 shared IPs. Two clients will be starting every second with max number 255.<br />3- Each client will go through 4 pages: Login page, Post user and pass, run a search, then logout.<br /><br /><br />Enjoy it!!!Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com5tag:blogger.com,1999:blog-2917649492034325188.post-25489913164669675702010-02-25T07:54:00.000-08:002013-07-31T19:32:01.662-07:00Creating SSL certificates for ApacheFirst we need to understand the concepts of how SSL works.<br />
<div>
When a client app (browser) makes a connection to the server (Web Server) via SSL (normally port 443), the initial communication creates the encrypted channel. This process is done as follows:</div>
<div>
<br /></div>
<div>
1- Server provides a certificate file (signed by a CA) to the client.</div>
<div>
2- Client verifies the certificate file with the root CA (Certificate Authority). For external services, we can use Verisign, and for internal services we can create our own CA server.</div>
<div>
3- Client also verifies that the lookup Name matches the CN (Common Name) f the certificate.</div>
<div>
4- Client accepts the connection or sends a warning if the requirements are not met.</div>
<div>
5- Client starts to encrypt traffic using the Certificate file. </div>
<div>
6- Server decrypts the data using the Private Key.</div>
<div>
<br /></div>
<div>
Basically, whoever has the certificate file can encrypt data but no decrypt. The only one that can decrypt the data is the private key, so make sure you store your private key on a safe place.</div>
<div>
<br /></div>
<div>
<b>Getting Certificate Files</b></div>
<div>
<b><br /></b></div>
<div>
1- First generate the Private key</div>
<div>
<br /></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 13px; line-height: 20px;"><em><b>#openssl genrsa -out server.key 2048</b></em></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 13px; line-height: 20px;"><em><b><br /></b></em></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">2- Generate the request for a Certificate. This file must be sent to the CA ( Verisign or Internal CA) so it can be signed.</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">This request does not contain the private key but it will help the CA to signed it using their own private key.</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><em><b># openssl req -new -key server.key -out server.csr</b></em></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><em><b><br /></b></em></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">Then you will be ask several questions and the most important one is the Common Name. The Common Name must match the exact name to access the server that requests the certificate (CRT file).</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">When you buy certificates from Verisign they have a website where you post CSR, then they will send you a certificate file. For Microsoft CA, you will have to submit the CSR file as a base64 encoded PKCS #10, then Microsoft CA will return a CER file that will need to be converted to a certificate.</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">Microsoft CA conversion CER to CRT file.</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><em><b># openssl x509 -in server.cer -inform d -out server.crt</b></em></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><em><br /></em></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">Finally add to your apache configuration for SSL the following configuration:</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"></span></span><br />
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">SSLCertificateFile /path/to/ssl/certificate/server.crt</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">SSLCertificateKeyFile /path/to/ssl/key/server.key</span></span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><em><br /></em></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><em><b>Note: </b>Make sure your key file are stored in a secure location.</em></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><em><br /></em></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;">Enjoy it !!!!</span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 100%;"><span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div>
<b><br /></b></div>
<div>
<br /></div>
Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-83116364638494638342010-02-23T13:04:00.000-08:002010-03-22T14:15:25.079-07:00MySQL Cluster 7 Set up with UbuntuIf you are accessing this page, it is possible that you want to figure out how difficult is to create a MySQL Cluster. I can tell you that the installation process is not that complicated, the most complicated part is to try to move current databases to this environment , since MySQL cluster engine (NDB) has some differences with other engines (MyISAM, InoDB, ..)<div><br /></div><div>First, we need to understand that MySQL uses different storage engines. Each storage engine has their own advantage and disadvantage. However, NDB is the only engine that according to MySQL can guarantee HA. </div><div><br /></div><div>Different MySQL configurations can guarantee some degree of HA. The most popular options are the following:</div><div><br /></div><div>1- Master - Slave Replication : If your Master Server is down you can promote the Slave to master. This configuration is considered active - passive . Moreover, some data can be lost. </div><div><br /></div><div>2- Master - Master Replication (Asynchronous) : This configuration is great for HA however you would have to have some considerations to avoid conflict. This configuration is considered active - active.</div><div><br /></div><div>3- <a href="http://www.mysql.com/drbd">MySQL HA with DRBD</a>: DRBD is a process that keep two server file system in sync. The synchronization process is at data block level, so database corruption can be seen. This configuration is active - passive. </div><div><br /></div><div>4- MySQL Cluster: Basically, MySQL introduces a new storage engine that can help to maintain redundancy and HA. </div><div><br /></div><div><b>MySQL Cluster</b></div><div><b><br /></b></div><div>First, we need to recognize the different processes and facts for MySQL Cluster.</div><div><br /></div><div>The NDB engine stores Indexes and Data on memory by default. However, if you define a tablespace on disk, Data can be stored on disk.</div><div><br /></div><div><br /></div><div>1- ndbd or ndbmt : Single or Multi thread process for data nodes. This process reserves the memory and stores the data on memory. (Data Nodes)</div><div><br /></div><div>2- ndb_mgmd : This process provides the configuration file to all nodes (Data Nodes and MySQL Nodes). </div><div><br /></div><div>3- Mysqld (API): This process provides all the storage engine available plus access to the NDB engine. </div><div><br /></div><div><b>Starting the Set UP</b></div><div><b><br /></b></div><div>Although you can run MySQL cluster in one machine , it does not make sense to install it since you do not have any redundancy. I suggest a basic setup of 5 nodes ( 2 data nodes, 2 mysql nodes and 1 management). Also the following specs will help you to get the HW.</div><div><br /></div><div>1- Data Nodes: </div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>- A lot of memory. Index and Data are mainly stored in memory.</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>- Disk space. If you store Data tables on disk.</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>- CPU. Data nodes are not CPU intensive. Moreover , if you use multiple cpu, you should use<span class="Apple-tab-span" style="white-space: pre;"> </span> ndbmtd process.</div><div><br /></div><div>2- MySQL Nodes: </div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>- CPU. These Nodes are CPU intensive.</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>- Memory. As required.<br />3- Management Node.<br /> - Any small machine can perform this task.<br /><br />Moreover, it is suggested to have a different subnet for data communication between the data and sql nodes (security and traffic). According to this, sql nodes must have two interfaces, one for access from external apps and one for data communications to data nodes (NDB).<br /><br />datanode01 192.168.0.1<br />datanode02 192.168.0.2<br /><br />sqlnode01 192.168.0.3 172.1616.1<br />sqlnode02 192.168.0.4 172.16.16.2<br /><br />mnode01 192.168.0.5<br /><br /><span style="font-weight: bold;">Installing Mysql Cluster.</span><br /><br />You are probably tempted to install Mysql using apt-get , however the repos do not contain the latest version of Mysql, so I suggest you to use the binary installation of MySQL. Go to MySQL website and chose the Linux Generic Download, then arch 32 or 64 and finally the mirror.<br /><br /><span style="font-weight: bold;"># wget http://www.mysql.com/get/Downloads/MySQL-Cluster-7.0/mysql-cluster-gpl-7.0.13-linux-x86_64-glibc23.tar.gz/from/http://mysql.he.net/</span><br /><br /><span style="font-weight: bold;"># tar xzvf mysql-cluster-gpl-7.0.13-linux-x86_64-glibc23.tar.gz</span><br /><br />Then<br /><span style="font-weight: bold;"># cd mysql-cluster-gpl-7.0.13-linux-x86_64-glibc23</span><br /><br />Read the INSTALL-BINARY file ...so you can install it.<br /><br />shell> groupadd mysql<br />shell> useradd -g mysql mysql<br />shell> cd /usr/local<br />shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s full-path-to-mysql-VERSION-OS mysql<br />shell> cd mysql<br />shell> chown -R mysql .<br />shell> chgrp -R mysql .<br />shell> scripts/mysql_install_db --user=mysql<br />shell> chown -R root .<br />shell> chown -R mysql data<br /><br />Wait ...This is the basic installation for all the nodes and we do not want to have mysqld running on all the nodes, only sql nodes.<br /><br />This command will be executed on sql nodes when all configuration files are ready:<br /><br />shell> bin/mysqld_safe --user=mysql &<br /><br /><br /><span style="font-weight: bold;">Setting Up Management Node.</span><br /><br />Copy the template configuration file for management node.<br /><br /><span style="font-weight: bold;">#cp /usr/local/mysql/support-files/ndb-config-2-node.ini /usr/local/mysql/config.in</span>i<br /><br />This configuration contains pretty basic stuff that you would have to tweak for your cluster.<br />However, I can suggest you a couple of changes depending on the amount of memory that you have available.<br />Remember mysql cluster stores tables on memory, so if we have more memory available adjust the values.<br />For example, I have 32GB of memory on each data node.<br /><br />DataMemory=25634M<br />IndexMemory=3205M<br /><br />There are more changes that you can tweak so you can improve the behaviour of the cluster or you can try this website to help you configure the cluster.<a href="http://www.severalnines.com/config/"> http://www.severalnines.com/config/</a><br /><br />Modify the IP for the management node.<br /><br /><span style="font-style: italic;">[ndb_mgmd]</span> <span style="font-style: italic;">Id=1</span> <span style="font-style: italic;">HostName= 192.168.0.5</span><br /><br /><br />Then modify the IPs for data nodes under [ndbd]<br /><br /><span style="font-style: italic;">[ndbd]</span> <span style="font-style: italic;">Id= 2</span> <span style="font-style: italic;">HostName= 192.168.0.1</span> <span style="font-style: italic;">[ndbd]</span> <span style="font-style: italic;">Id= 3</span> <span style="font-style: italic;">HostName= 192.168.0.2</span><br />Then the IPs for sql nodes under [mysqld]<br /><br /><span style="font-style: italic;">[mysqld]</span> <span style="font-style: italic;">Id= 4</span> <span style="font-style: italic;">HostName= 192.168.0.3</span> <span style="font-style: italic;">[mysqld]</span> <span style="font-style: italic;">Id= 5</span> <span style="font-style: italic;">HostName= 192.168.0.4</span><br />Save the file.<br /><br />Create the mysql-cluster directory.<br /><br /><span style="font-weight: bold;"># mkdir /var/lib/mysql-cluster</span><br /><br />then Start the management node.<br /><br /><span style="font-weight: bold;"># /usr/local/mysql/bin/ndb_mgmd -f /usr/local/mysql/config.ini</span><br /><br />If we wan to check the cluster use the following command.<br /><br /><span style="font-weight: bold;"># /usr/local/mysql/bin/ndb_mgm</span> <span style="font-weight: bold;">-- NDB Cluster -- Management Client --</span> <span style="font-weight: bold;">ndb_mgm> show</span><br /><br /><span style="font-weight: bold;"></span><br /><span style="font-weight: bold;">Setting Up Data node</span><br /><br />(I assume you have installed MySQL Binary)<br /><br />Basically we need to tell the ndbd daemon to use configuration from management node.<br /><br />Create configuration file on /etc/mysql/<br /><br /><span style="font-weight: bold;">#mkdir /etc/mysql</span><br /><span style="font-weight: bold;">#vi /etc/mysql/my.cnf</span><br /><br />[mysqld]<br />ndbcluster<br /># IP address of the cluster management node<br />ndb-connectstring=192.168.0.5<br /><br />[MYSQL_CLUSTER]<br />ndb-connectstring=192.168.0.5<br /><br />Because it is the first time we are going to start ndbd daemon we need to initialize it.<br /><br /><span style="font-weight: bold;"># /usr/local/mysql/bin/ndbd --initial</span><br /><br />After both data nodes are up, you can check the status on the management node using the show command.<br /><br />If you want to stop a data node , you can run the following command on the management node:<br /><br /><span style="font-weight: bold;">ndb_mgm> 2 stop<span style="font-weight: bold;"><span style="font-weight: bold;"><br /><br /></span></span></span><span>It will stop the datanode with ID=2 (see management node configuration)</span><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"></span><br /><br /><br />Setting Up SQL Node or API.<br /><br /></span></span></span>(I assume you have installed MySQL Binary)<br /><br />Create a my.cnf file.<br /><br /><span style="font-weight: bold;">#vi /etc/my.cnf</span><br /><br />[mysqld]<br />ndbcluster<br /># IP address of the cluster management node<br />ndb-connectstring=192.168.0.5<br />[mysql_cluster]<br /># IP address of the cluster management node<br />ndb-connectstring=192.168.0.5<br /><br />Finally start the SQL nodes.<br /><br /><span style="font-weight: bold;"># /usr/local/mysql/support-files/mysql.server start</span><br /><br />After all the nodes are running you can monitor the nodes from the management nodes.<br /><br />Note: Remember that you must create tables with ENGINE=NDB so they can be running on the cluster.<br /><br />Enjoy it ...<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com2tag:blogger.com,1999:blog-2917649492034325188.post-85394259725850817462010-02-10T07:32:00.000-08:002010-02-10T08:01:07.440-08:00Linux Hard Drive Performance measurementsMany people trust vendor specs, moreover they trust hard drive speed, disk controller speed and so on. However, reality is that you will never get those specs when you set up the hardware. Why? Vendors test their hardware on special environments, with specific combination of hardware.<div><br /></div><div>I was trying to set up a server with fast access to hard drives so I did a little research of how to test different configuration of hard drives. These are my findings:</div><div><br /></div><div>Note: All these tests should be executed several times. The real results are affected by hard drive cache, controller cache, and operative system cache.</div><div><br /></div><div><div>1- (Read Speed) hdparm -t /dev/sda</div><div>This is a very well known command that It can give you the max read speed (sequential).</div><div><br /></div><div>2- (Write Speed) dd count=1k bs=10M if=/dev/zero of=/data/test.img </div><div>This is another well known command that It can give you an average of writes.</div><div>This command creates a 10G file and measure the speed.</div><div><br /></div><div>3- (Write speed) This people <a href="http://www.nlanr.net/Dskwtst/"> http://www.nlanr.net/Dskwtst/</a> created a C program that logs write speed. </div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"></span><b>#wget http://www.nlanr.net/Dskwtst/Software/dskwtst.c</b></div><div><b>#gcc -O2 dskwtst.c -o dskwtst</b><span class="Apple-tab-span" style="white-space:pre"><b> </b></span></div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"></span>(Compiling probably you would get an error)</div><div><br /></div><div><i>dskwtst.c: In function âmainâ:</i></div><div><i>dskwtst.c:32: warning: incompatible implicit declaration of built-in function âexitâ</i></div><div><br /></div><div>This error is only a warning so it should not affect results.</div><div><br /></div><div><br /></div><div><b>#./dskwtst > /data/ouputfile 2> ./log</b></div><div><b><br /></b></div><div>The command will create a file on /data/ and it will send the results to log.</div><div><br /></div><div>4- (Random access)This guy <a href="http://www.linuxinsight.com/how_fast_is_your_disk.html">http://www.linuxinsight.com/how_fast_is_your_disk.html</a> created a C program that can measure the seek time of the hard drive.</div><div><br /></div><div><b>#wget http://www.linuxinsight.com/files/seeker.c</b></div><div><b>#gcc -O2 seeker.c -o seeker</b></div><div><b>#./seeker /dev/sda</b></div><div><b><br /></b></div><div><b><br /></b></div><div>Enjoy it ...</div><div><br /></div></div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com3tag:blogger.com,1999:blog-2917649492034325188.post-6276981536153928182010-02-09T12:26:00.000-08:002010-02-09T12:35:35.699-08:00Postfix relaying emails with GMAIL SMTP (Centos 5.3)I was tired of maintaining my email server so I decide to move everything to <a href="http://www.google.com/a/">Google app</a>. They can host your mail server up to 50 accounts for free, isnt it great?. So I have moved all my domains to Google apps and everything was working perfect, however I missed an issue RELAY emails!!<div>So I relaxed and I figured out how to relay emails using an Google app (GMAIL) account.</div><div><br /></div><div>After reading a lot of post, I realized that everybody was missing a part of the problem. </div><div>Some people shows you how to create client certificates for postfix when you do not need them.</div><div>Some people tell you to get the root CA certificates when you already have them. </div><div>However the most important part is to have all the required packages to make it work.</div><div><br /></div><div>For Centos 5.3 </div><div><br /></div><div><div>Verify package installed</div><div><br /></div><div><b># rpm -qa |grep postfix</b></div><div><b>postfix-2.3.3-2.1.el5_2</b></div><div><b><br /></b></div><div><b># rpm -qa |grep sasl</b></div><div><b>cyrus-sasl-lib-2.1.22-5.el5</b></div><div><b>cyrus-sasl-2.1.22-5.el5</b></div><div><b>cyrus-sasl-plain-2.1.22-5.el5</b></div><div><b><br /></b></div><div><b># rpm -qa |grep openssl</b></div><div><b>openssl-perl-0.9.8e-12.el5_4.1</b></div><div><b>openssl-devel-0.9.8e-12.el5_4.1</b></div><div><b>xmlsec1-openssl-1.2.9-8.1.1</b></div><div><b>openssl-0.9.8e-12.el5_4.1</b></div><div><b>openssl097a-0.9.7a-9.el5_2.1</b></div><div><b><br /></b></div><div><div>Copy root CA certificates. Postfix needs to know the location of root CA. </div><div><br /></div><div><b># cp /etc/pki/tls/certs/ca-bundle.crt /etc/postfix/cacert.pem</b></div><div><br /></div><div>Create file that stores GMAIL user and password.</div><div><br /></div><div><b># vi /etc/postfix/sasl_passwd</b></div><div><br /></div><div>smtp.gmail.com user@domain:password</div><div><br /></div><div><b>#postmap /etc/postfix/sasl_passw</b>d</div><div><br /></div><div><br /></div><div>Edit /etc/postfix/main.cf</div><div><br /></div><div><i># Relay all e-mail via GMail.</i></div><div><i>relayhost = [smtp.gmail.com]:587</i></div><div><i><br /></i></div><div><i># SASL authentication</i></div><div><i>smtp_sasl_auth_enable=yes</i></div><div><i>smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd</i></div><div><i>smtp_sasl_security_options =</i></div><div><i>smtp_sasl_tls_security_options = noanonymous</i></div><div><i>smtp_sasl_mechanism_filter = login</i></div><div><i><br /></i></div><div><i># TLS</i></div><div><i>smtp_tls_eccert_file =</i></div><div><i>smtp_tls_eckey_file =</i></div><div><i>smtp_use_tls = yes</i></div><div><i>smtp_enforce_tls = no</i></div><div><i>smtp_tls_CAfile = /etc/postfix/cacert.pem</i></div><div><i>smtpd_tls_received_header = yes</i></div><div><i>tls_random_source = dev:/dev/urandom</i></div><div><br /></div><div><br /></div><div>Finally, restart postfix.</div><div><br /></div><div><br /></div><div>Enjoy it ...</div><div><br /></div></div></div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com1tag:blogger.com,1999:blog-2917649492034325188.post-82477296353105232842010-02-01T10:15:00.000-08:002010-02-02T11:16:13.130-08:00Installing Ubuntu from USB driveI am not a very big Fan of Ubuntu, however Ubuntu has a lot of acceptance in the Opensource Community. So I decided that I would have to give a try. <div><br /></div><div>On this Blog, I will present an installation method that it is very helpful for many System Admin.</div><div>Let's review the installation methods first:</div><div><br /></div><div>1- Installing from CD. You will have to download the ISO image from Ubuntu, have a ISO burner software, a CD , and a CD drive. Today, many servers do not bring CD unit since they are a waste of space and hardware.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>When you Installing from CD, you can have two options:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Installing all packages from CD</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Installing all packages from Repositories. (You need DHCP, Repository, and network enable)</div><div><br /></div><div>2- Installing from Network. This method is great however Ubuntu is not very good at this. You will need DHCP, TFTP, and Repository. Moreover, you will need to write down the MAC address of the server so you can configure DHCP and create a autoconfiguration file.</div><div><br /></div><div>3- Installing from USB. This method is a variation of the CD, however Ubuntu is not straight forward with this installation method. There are many tutorials and blogs about installing Ubuntu and other Linux flavors, using USB drives, however they do not specify the complications during the installation process. To make an USB drive bootable is a very simple process, however making the installation from USB for Ubuntu is not.</div><div><br /></div><div>My problem: I have a HP server with RAID controller (1 Logical Volume), no network connection, and no CD drive. I need to install Ubuntu 9.10 (Although it works for other versions too). I have my Laptop running with Windows (Creating a USB installer on Linux is a simpler process)</div><div><br /></div><div><div>1- First get syslinux for Windows. </div><div><a href="http://reilly.homeip.net/folding/usb.html">http://reilly.homeip.net/folding/usb.html</a></div><div><br /></div><div><br /></div><div>2- Download Ubuntu 9.10 </div><div><br /></div><div>3- Open ubuntu.iso file and copy <b>isolinux</b> dir from ISO to / USB.</div><div>There are many options to do that. You can mount the ISO as Virtual CD using <a href="http://poweriso.com/">http://poweriso.com/</a> or you can use an Zip software to grab that directory.</div><div><br /></div><div>4- Rename directory isolinux to syslinux .</div><div>On isolinux dir, you can find isolinux.cfg, rename it to syslinux.cfg.</div><div><br /></div><div>5- Create a directory named <b>install </b>on / USB drive.</div><div><br /></div><div>6- Get vmlinuz and initrd.gz files for hd-media.</div><div><br /></div><div><a href="http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-amd64/current/images/hd-media/">http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-amd64/current/images/hd-media</a>/</div><div><br /></div><div>7- Copy vmlinuz and initrd.gz files to /install USB drive. </div><div><br /></div><div>8- Run syslinux.exe -m Drive: (USB Drive letter)</div><div><br /></div><div>9- Copy ISO image for Karmic-amd64 on USB</div><div><br /></div><div>10- Boot from USB ( I assume that you know how to set up the BIOS to boot from USB)</div><div><br /></div><div>11- Follow the installation process. </div><div><br /></div><div>12- Before the end, when the installation has ended, you will have to make some modifications to grub. If you miss this part the server will not boot since the grub is looking for the USB Drive.</div><div><br /></div><div>Press alt-F2. </div><div><br /></div><div>On The command line:</div><div><br /></div><div><b># chroot /target </b></div><div><b><br /></b></div><div>/target is the mounted root partition.</div><div><br /></div><div><b>#vi /boot/grub/device.map</b></div><div><br /></div><div>Delete the entry for (hd0) that set to USB</div><div>Modify (hd1) to (hd0) on your boot drive</div><div><br /></div><div>Finally, set grub on the hard drive.</div><div> </div><div><b># grub-install <device></b></div><div><b><br /></b></div><div><b>#exit</b></div><div><br /></div><div><br /></div><div>Then Boot server.</div><div><br /></div><div>All done.</div></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-63162688471830963062010-01-18T11:18:00.000-08:002010-01-22T09:00:00.054-08:00Trixbox installation on Centos 5.3 (My journey)I have been using <a href="http://www.trixbox.org/">Trixbox</a> for a while and I think it is time to have documented how to install it without CD using a VPS.<br /><br />First, Trixbox is a set of tools that help you to maintain <a href="http://www.asterisk.org/">Asterisk.</a><br />Asterisk is opensource PBX software. It allows you to have VOIP extensions using your network connections. For my case, I have deployed 5 extensions in 5 different location in 3 countries with no long distance charge. Moreover, I can use my VOIP extension anywhere as long as I have Internet connection.<br /><br />I started to use Trixbox at home using virtual machine running on Citrix Xen, however with time you realize that your phone system needs to be reliable and keeping it at home makes that task complicated (power outage, hardware problems). So I decided to move it to a data center.<br />Trixbox installation at home was pretty simple task since you can get de ISO image and burn a CD. But the big question was how I can install it on server running Centos 5.3 (32 bits)*<br /><br /><span style="font-weight: bold;">Note</span>: I have installed Trixbox on Centos 5.3 (64bit), however Trixbox was designed to work on 32bit so you will probably have some issues with libraries since the path on Trixbox has bee set up to /usr/lib instead of /usr/lib64.<br /><br /><span style="font-weight: bold;">Choosing Hosting provider</span>. My current installation is running with <a href="http://www.godaddy.com/">Godaddy </a>, the service has been excellent and the price is ok ($30 a month for 256Mb, 20GB server) however I found a hosting provider <a href="http://rackunlimited.com/vps.html">RackUnlimited</a> that can provide you the same for only $8 a month. At this point, I have a server with RackUnlimited and I am going to show the process of installing Trixbox.<br /><br />Installation Process<br /><br />1- Login on the server and make sure you have all the basic tools that you need. RackUlimited provide me with a very slim version Centos 5.3 so I had to install some packages.<br /><br /><span style="font-weight: bold;"># yum -y install vim-minimal sudo postfix</span><br /><br />Also I like to install webmin ...so I grabbed the RPM form webmin.com and I installed it.<br /><br />2- Install essentials packages for Trixbox.<br /><br /><span style="font-weight: bold;">#yum -y install mysql mysql-server mysql-devel</span><br /><br />MySQL database<br /><br /><span style="font-weight: bold;">#yum -y install httpd memcached php php-pear php-mysql</span><br /><span style="font-weight: bold;"># pear install DB</span><br /><br />Apache Server and PHP packages<br /><br />Now we I have server with a LAMP enviroments<br /><br />3- Add the Trixbox repo<br /><br /><span style="font-weight: bold;">#vi /etc/yum.repos.d/trixbox.repo</span><br /><br /><span style="font-style: italic;">[trixbox]</span><br /><span style="font-style: italic;">name=trixbox RPM Repository for CentOS and RHEL</span><br /><span style="font-style: italic;">baseurl=http://yum.trixbox.org/centos/$releasever/RPMS/</span><br /><span style="font-style: italic;">gpgcheck=0</span><br /><span style="font-style: italic;">enabled=1</span><br /><br /><span style="font-weight: bold;"> #yum clean all<br /><span style="font-weight: bold;"></span></span><br />4- Install asterisk<br /><br /><span style="font-weight: bold;">#yum install asterisk</span><br /><span style="font-weight: bold;">#mkdir /etc/asterisk </span><br /><span style="font-weight: bold;">#cp /etc/asterisk-1.4.21.2_samples/ /etc/asterisk</span><br /><br />5- Start all services.<br /><br /><span style="font-weight: bold;">#/etc/init.d/mysql start</span><br /><span style="font-weight: bold;">#/etc/init.d/httpd start</span><br /><span style="font-weight: bold;">#/etc/init.d/memcached start</span><br /><span style="font-weight: bold;">#/etc/ini.d/asterisk start</span><br /><br />6- Install Trixbox scripts.<br /><br /><span style="font-weight: bold;">#yum install tbm-pbxconfig</span><br /><br />7- Create Databases and users.<br /><br /><span style="font-weight: bold;">#mysqladmin create asterisk</span><br /><span style="font-weight: bold;">#mysqladmin create asteriskcdrdb</span><br /><span style="font-weight: bold;">#mysql asterisk < /usr/src/tbm-pbxconfig/SQL/newinstall.sql</span><br /><span style="font-weight: bold;">#mysql asteriskcdrdb < /usr/src/tbm-pbxconfig/SQL/cdr_mysql_table.sql</span><br /><br /><span style="font-weight: bold;">#mysql</span><br /><br /><span style="font-weight: bold;">mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';</span><br /><span style="font-weight: bold;">Query OK, 0 rows affected (0.02 sec)</span><br /><br /><span style="font-weight: bold;">mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';</span><br /><span style="font-weight: bold;">Query OK, 0 rows affected (0.00 sec)</span><br /><br /><span style="font-weight: bold;">mysql> flush privileges;</span><br /><span style="font-weight: bold;">Query OK, 0 rows affected (0.00 sec)</span><br /><br />8- Install all Trixbox packages<br /><br /><span style="font-weight: bold;">#yum groupinstall Trixboxcore</span><br /><br />9- Installing the amportal<br /><br /><span style="font-weight: bold;">#/usr/src/tbm-pbxconfig/install_amp</span><br /><br />Accept the default values.<br /><br />After this is done restart MySQL, Apache, memcached , and amportal.<br /><br />10- Authentication for web interface<br /><br /><span style="font-weight: bold;">#mkdir -p /usr/local/apache/passwd/</span><br /><span style="font-weight: bold;">#touch /usr/local/apache/passwd/wwwpasswd</span><br /><span style="font-weight: bold;">#passwd-maint</span><br /><br />user: maint<br />pass: ******<br /><br />Finally you can access the Web interface.<br /><br /><span style="font-weight: bold;">http://serverip/</span><br /><br /><span style="font-weight: bold;">Note:</span><br />Time on Xen VMs is restricted by Dom0, so if you want to change the time in your VM you will have to do the following.<br /><br />#echo 1 > /proc/sys/xen/independent_wallclock<br /><br />to leave it perm do the following<br /><br />#vi /etc/sysctl.conf<br />add<br />xen.independent_wallclock = 1<br /><br />Change the timezone<br /><br />#cp /usr/share/zoneinfo/America/New_York /etc/localtime<br /><br />However you can install yo modify the time zone<br /><br />#yum -y install system-config-date<br />#system-config-date<br /><br /><span style="font-weight: bold;">Adding G729 Codec .....<br /><span style="font-weight: bold;"><br /></span></span>G729 is a voice compression protocol designed by Digium.G729 is capable of using very little bandwidth with good voice quality (8K). You can buy a license for this codec from Digium or use a free version (free version is not considered very stable).<br /><span style="font-weight: bold;"><span style="font-weight: bold;"><br /><span style="font-weight: bold;"></span></span></span>This guy made a pretty good job showing how to use G729.<br /><a href="http://nigglingaspirations.blogspot.com/2009/10/installing-free-g729-codec-on-trixbox.html">http://nigglingaspirations.blogspot.com/2009/10/installing-free-g729-codec-on-trixbox.html</a><br /><span style="font-weight: bold;"><span style="font-weight: bold;"><span style="font-weight: bold;"></span></span><br /></span><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;"></span>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com7tag:blogger.com,1999:blog-2917649492034325188.post-1644030009517749122010-01-13T13:31:00.000-08:002010-01-14T11:01:25.272-08:00Citrix Xen Server: Virtual Appliances repositoriesI consider Citrix Xen a great product with a lot of advantages compared to VMWare. However, one big disadvantage is the lack of a Virtual Appliance repo.<br /><br />There are some sites that can provide you with appliances ready to work but they are very VMWare oriented. Example:<br /><br /><a href="http://www.jumpbox.com/">http://www.jumpbox.com</a><br /><br />Although Jumpbox has some support for Citrix Xen and other virtualization platforms, I suggest to create a place where we can start to build our own Virtual appliances for Citrix Xen.<br /><br />My first donation is the following.<br /><br />Centos 5.3 64 bit with Xentools installed<br />user:root pass:root<br /><br />You can get it from : <a href="ftp://ftp.carlosgomez.net/">ftp://ftp.carlosgomez.net/</a><br /><br />user:ftp01 pass:ftp01<br /><br />filename: <span style="font-weight: bold;">centos53-64.rar</span><br /><br />OR<br />you can try <a href="http://www.filebox.com/jlspdob2rn8k">http://www.filebox.com/jlspdob2rn8k</a><br /><br />Enjoy it ...Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-61172509553606126352010-01-13T10:05:00.000-08:002010-01-13T10:18:00.156-08:00MySQL: Changing data directory on Ubuntu 9.04<span style="font-size:100%;"><span style="font-family:arial;">You would think it is a pretty easy task to go to the /etc/mysql/my.cnf file and change the datadir to the new directory, then restart MySQL. However, MySQL will fail every time you restart it. There are a couple of considerations to make when you do this change:</span><br /><br /><span style="font-family:arial;">1- Make a copy of all databases to the new directory.</span><br /><span style="font-family:arial;">2- Change the dat</span><code style="font-family: arial;"></code><span style="font-family:arial;">adir configuration on <span style="font-weight: bold;">/etc/mysql.my.cnf<br /></span><span>3- Change /etc/apparmor.d/usr.sbin.mysqld so the old data dir is no longer there.<br />4- Reload Apparmor daemon.<br />5- Verify ownership and pem on new data dir.<br />6- Restart MySQL<br /><br />You can follow this blog <a href="http://blog.taragana.com/index.php/archive/how-to-move-the-mysql-data-directory-in-ubuntu/">http://blog.taragana.com/index.php/archive/how-to-move-the-mysql-data-directory-in-ubuntu/</a> for more detailed instructions.<br /><br />Enjoy it...<br /></span></span></span>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com1tag:blogger.com,1999:blog-2917649492034325188.post-33042090889239629812010-01-08T12:11:00.000-08:002010-01-08T12:19:41.858-08:00Citrix Xen Server: Installing Citrix Xen from USB driveGreat, we need to add a new server to the pool of Citrix Xen and we do not want to use the CD.<br />Follow these instructions an you can install Citrxi Xen using a USB drive.<br /><br /><a href="http://www.thegenerationv.com/2009/08/howto-put-xenserver-iso-installer-on.html">http://www.thegenerationv.com/2009/08/howto-put-xenserver-iso-installer-on.html</a><br /><br />After installed you can join the server to the pool, however you have to make sure that the Linux pack has been installed.<br /><br />You will receive a message saying different version so the server can not be added it.<br /><br />If you do not have the linux pack installed , create a USB drive with the Linux Pack ISO, then plug in it to the server.<br /><br />#mount /dev/sdX1 /mnt<br /><br />Make sure what /dev/sdX the server assigned to the USB. (you can check that using dmesg)<br /><br />then do<br /><br />#cd /mnt<br />#./install.sh<br /><br />Done, now you can join the server to the pool.Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-33561636660489335052010-01-05T09:19:00.000-08:002010-01-05T09:31:13.471-08:00Citrix Xen Server: Changing the pool masterCurrently, these changes can not be performed from XenCenter so you will have to use the command line.<br /><br />First, you have a pool of Citrix Xen servers and you want to change the pool master.To control a pool of servers, you would need to connect to the pool master server. Citrix Xen Server populates the management database among all the servers, however only one is the master server.<br /><br />Go to the slave server that you want to use as pool master.<br /><br />Disable HA.<br /><pre class="bash" style="font-family: monospace; font-weight: bold;">#xe pool-ha-disable</pre>List UUID for all the hosts<br /><pre class="bash" style="font-family: monospace;"><span style="font-weight: bold;">#xe host-list</span><br /><br />Promote slave<br /><br /><span style="font-weight: bold;"># xe pool-designate-new-master host-uuid=<uuid></span><br /><br />Easy right!!!<br /><br />If the pool master is down , use the following commands.<br /><br /><span style="font-weight: bold;">#xe pool-emergency-transition-to-maste</span>r<br /><br />then re-establish connectio to the slaves.<br /><br /><span style="font-weight: bold;"># xe pool-recover-slaves</span><br /><br /></pre>Enjoy it ...Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com1tag:blogger.com,1999:blog-2917649492034325188.post-36377241787084235252009-12-15T11:00:00.000-08:002009-12-15T11:19:54.435-08:00Citrix XenServer 5.5 command line (Storage issue)The reality is that you can always do more from command line. Citrix XenCenter is very powerful however sometimes you are going to find issues that only can be resolved from command line.<div><br /></div><div>I am going to show an example of a situation when you start to use command line. </div><div>First you have to understand that Citrix Xen defines each component with an uuid on its database. Each component on your system have an uuid</div><div>1- Host</div><div>2- VM</div><div>3- Storage</div><div>4- Pool and so on</div><div><br /></div><div>Example:</div><div><br /></div><div><div><b>[root@xenserver01 ~]#</b></div><div><div><b>[root@xenserver01 ~]# xe host-list</b></div><div><b>uuid ( RO) : d5003241-d252-4bc7-9485-2fa5838e09f3</b></div><div><b> name-label ( RW): xenserver01</b></div><div><b> name-description ( RO): Default install of XenServer</b></div><div><b><br /></b></div><div><b>[root@xenserver01 ~]#</b></div><div><br /></div></div></div><div><br /></div><div>My problem: I took out one of the hard drive from xenserver01, I restart the server and Xencenter is showing my storage resource no available. I try to delete the SR however Xencenter is not allowing me to perform this operation. The resource stays red on my Xencenter console.</div><div><br /></div><div>To resolve it, basically go command line and do the following:</div><div><div><b><br /></b></div><div><b>[root@xenserver01 ~]# xe sr-list</b></div><div><br /></div></div><div>This command will list all the SR you have on your system.</div><div><br /></div><div><div><b>uuid ( RO) : 8311c845-beaf-b0ff-008a-2f03d256ebf5</b></div><div><b> name-label ( RW): Local Disk2</b></div><div><b> name-description ( RW):</b></div><div><b> host ( RO): xenserver01</b></div><div><b> type ( RO): lvm</b></div><div><b> content-type ( RO): user</b></div><div><b><br /></b></div><div>Make sure you copy the uuid for the resource you want to work on. This case , we copy 8311c845-beaf-b0ff-008a-2f03d256ebf5 .</div><div><br /></div><div>Then run the following command to delete it from Citrix Xen Database.</div><div><br /></div><div><b>#xe sr-forget uuid= 8311c845-beaf-b0ff-008a-2f03d256ebf5</b></div><div><b><br /></b></div><div>Now resource has been forgot from Citrix Xen database. </div><div><br /></div><div>The same way you can use other commands so try :</div><div><br /></div><div><b>#xe help --all</b></div><div><b><br /></b></div><div>This command will show you all available command. Moreover, the xe command allows you to use TAB for auto completion .</div><div><br /></div><div><br /></div></div><div> </div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-49277081795960876612009-12-15T07:31:00.000-08:002009-12-15T07:42:58.740-08:00Problems changing LDAP password from Ubuntu 9.04<span class="Apple-style-span" style="font-size: medium;">You would think that the default LDAP Ubuntu configuration (client) would be able to change your password, but it is not. </span><a href="http://blog.carlosgomez.net/2009/10/setting-up-ldap-client-for-ubuntu-904.html"><span class="Apple-style-span" style="font-size: medium;">http://blog.carlosgomez.net/2009/10/setting-up-ldap-client-for-ubuntu-904.html</span></a><div><span class="Apple-style-span" style="font-size: medium;"><br /></span></div><div><span class="Apple-style-span" style="font-size: medium;">If you are a user and you want to change your password you will get this results.</span></div><div><span class="Apple-style-span" style="font-size: medium;"><br /></span></div><div><b><span class="Apple-style-span" style="font-size: medium;">#passwd </span></b></div><div><b><span class="Apple-style-span" style="font-size: medium;">password:******</span></b></div><div><span class="Apple-style-span" style="font-family: Tahoma, Arial, sans-serif; "><b><span class="Apple-style-span" style="font-size: medium;">passwd: Authentication information cannot be recovered<br />passwd: password unchanged</span></b></span></div><div><span class="Apple-style-span" style="font-family: Tahoma, Arial, sans-serif; "><b><span class="Apple-style-span" style="font-size: medium;"><br /></span></b></span></div><div><span class="Apple-style-span" style="font-family:Tahoma, Arial, sans-serif;"><span class="Apple-style-span" style="font-size: medium;">The fix .....</span></span></div><div><span class="Apple-style-span" style="font-family:Tahoma, Arial, sans-serif;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:Tahoma, Arial, sans-serif;"><span class="Apple-style-span" style="font-size: medium;">Edit /etc/pam.d/common-passwd file. Look for use_authok and delete it. Save the file and done.</span></span></div><div><span class="Apple-style-span" style="font-family:Tahoma, Arial, sans-serif;"><span class="Apple-style-span" style="font-size: medium;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:Tahoma, Arial, sans-serif;"><span class="Apple-style-span" style="font-size: medium;">I do not know if this is a bug or not ...but I can tell you that users should be able to change password.</span></span></div><div><span class="Apple-style-span" style="font-family:Tahoma, Arial, sans-serif;"><span class="Apple-style-span" style="font-size: small;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:Tahoma, Arial, sans-serif;"><span class="Apple-style-span" style="font-size: small;"><br /></span></span></div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-14546533545215713642009-12-09T08:35:00.000-08:002009-12-10T10:49:08.996-08:00Quick tip: Deploying command on multiple servers (easy script)When you maintain hundreds of server, A good sysadmin starts to design scripts that make his life easier. Let me show you what I do.<br /><br />First make sure you have a file with a the list of server names or IPs.<br /><br /><span style="font-weight: bold;">#cat server.list</span><br /><span style="font-weight: bold;">1.1.1.1</span><br /><span style="font-weight: bold;">2.2.2.2</span><br /><span style="font-weight: bold;">3.3.3.3</span><br /><br />Second make sure you have setup ssh keys from your machine (user root) to all the machines on the list. This is the only part that can be complicated, however if you have deployed machines using a Kickstart server you can make sure that all the server on pools use the same auth keys on root directory.<br /><br />Now you can create the script.<br /><br /><span style="font-weight: bold;">#!/bin/sh</span><br /><span style="font-weight: bold;">for i in `cat $1`</span><br /><span style="font-weight: bold;">do</span><br /><span style="font-weight: bold;">ssh -o ConnectTimeout=10 -o BatchMode=yes $i $2;</span><br /><span style="font-weight: bold;">done</span><br /><br />Very simple right. I will call it run.sh.<br /><br />Let me explain it really quick.<br />The script will take every line of file (IP or name) and it will ssh to that machine so it can run $2 (command).<br />The Option ConnectTimeout will guarantee that the ssh will try to connect for 10 seconds.<br />Batchmode will guarantee that no password will be asked so the ssh connection will pass.<br /><br /><br />Then you can use it ....<br /><br /><br /><b>#./run.sh server.list "/etc/init.d/apache restart"</b><br /><br />Very helpful to restart apache on a Web server Farm.<div><br /></div><div>Let's add something else to the script. </div><div><br /></div><div>The script performs commands sequentially meaning that it has to wait until the command finishes to continue with the next server. But if you want to perform the command at the same time in all the servers we need to add the flag -f to the ssh command.</div><div><br /></div><div>Change </div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold; ">ssh -o ConnectTimeout=10 -o BatchMode=yes $i $2;</span></div><div><b><br /></b></div><div>to</div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold; ">ssh -f -o ConnectTimeout=10 -o BatchMode=yes $i $2;</span></div><div><br /></div><div>Done <br /><br />Enjoy it....</div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-1730902370232831782009-12-09T07:19:00.000-08:002009-12-09T07:34:15.221-08:00Quick tip: Scanning scsi bus (Linux) to add new hard drive on VMware and Citrix XenProbably this is not a hot topic, however I regularly go through the trouble of adding more disk space to VMs on any of the VM environments (VMWare and Citrix Xen). You would think it should not be different however it is quite different depending on the Hypervisor or Linux flavor.<br /><br />For Citrix Xen, it is very simple you only create the disk and attached to the VM and finally you can run fdisk and create partitions. It is like magic, however as soon as you add the disk you can detached until you poweroff the VM.<br /><br />For VMWare, it is not that simple you can create the disk and added to the VM , however the VM is not detecting the new disk, that's because the VM requires to scan de scsi bus to detect new devices.<br /><br />There are different ways to do that however that depends of the Linux OS that you are running.<br /><br />For Red Hat, or Centos, you can force the scan, this blog can show you how <a href="http://misterd77.blogspot.com/2007/12/how-to-scan-scsi-bus-with-26-kernel.html">http://misterd77.blogspot.com/2007/12/how-to-scan-scsi-bus-with-26-kernel.html</a><br /><br />For Ubuntu , forcing the scan using the procedures for Centos does not work ...so I decided to take a look and I have found this utility that can help you <a href="http://www.garloff.de/kurt/linux/scsidev/">http://www.garloff.de/kurt/linux/scsidev/<br /></a><br />This rescan utility it is also valid for any type of linux OS so try it ...Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-1396083788015981352009-12-08T09:30:00.000-08:002009-12-08T09:34:30.356-08:00Quick Tip: Getting DELL asset tag info from linux serverThis is a pretty helpful command to get info from hardware.<br /><br /><span style="font-weight:bold;">#dmidecode -s system-serial-number</span><div><span style="font-weight:bold;"><br /></span></div><div><span style="font-weight:bold;"><br /></span><br /></div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-27637825446873097482009-12-02T14:19:00.001-08:002009-12-02T14:24:29.569-08:00Opensource Storage Solution: FreeNAS and Openfiler<p>After dealing with both products, I came out with the following conclusion</p><br /><p><a href="http://www.freenas.org/">FreeNAS</a> is a great product for HOME. It can be installed in a very small machine, contains all protocols (CIFS,NFS,FTP,ISCSI) used by commercial products plus a media server and bittorrent. Basically,the FreeNAS media server allows you to stream music and video in your local network. so you can play them with any media server client (PS3,PC). It is not commercial supported.</p><br /><p><a href="http://www.openfiler.com/">OpenFiler</a> is also a great product. It requires a machine with more RAM and disk space.It has all protocol used by commercial products however it lacks of media server and bittorrent.It is commercial supported. So I suggest you to go Openfiler for businesses.</p>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-74647570019024643872009-11-25T08:39:00.000-08:002009-11-25T08:39:49.201-08:00Configuration management: Netdirector with Ubuntu 9/04 (64bit)<b><i>" Research time ..."</i></b><br />
I was almost ready to deploy puppet when I realized that puppet does not have any GUI interface. Well there is one <b>puppetshow </b>but I started to test it and I noticed that it is still in development. So I decided to check if there are another tools to do configuration management and I found <a href="http://www.netdirector.org/">Netdirector</a>. My first impression was very good because they have a pretty good website and they offer commercial services.Moreover, I noticed that the application is java based for server and client. Here I show you how to make a quick installation and how to deploy the agent.<br />
<br />
First let get the binary for Linux (32 or 64 bit) . My case is 64 bit.<br />
<br />
<br />
<b># wget </b><a href="http://sourceforge.net/projects/netdirector/files/GPL%20NetDirector%20Server%20Manager/3.2.3/netdirector.tar.bz2/download"><b>http://sourceforge.net/projects/netdirector/files/GPL%20NetDirector%20Server%20Manager/3.2.3/netdirector.tar.bz2/download</b></a><br />
<br />
Uncompress the file.<br />
<br />
<b># tar jxvf netdirector.tar.bz2</b><br />
<br />
Make sure you have all the required packages installed.<br />
<br />
<b># apt-get install sun-java6-jre postgresql libpg-java</b><br />
<br />
You can notice that I am installing postgresql database because the default installation support this database. If you want to use MySQL you would have to research a little bit so you can attached netdirector to you MySQL database.<br />
<br />
<b>#cd netdirector/netdirector/dists/netdirector/main/binary-amd64</b><br />
<br />
Install the package.<br />
<b># dpkg -i netdirector_3.2.2+tomcat_5.5.27-psql7-all.deb</b><br />
<br />
Now you can access the application on http://serverip:8080/netdirector<br />
user admin<br />
pass admin<br />
<br />
Do not forget to create an user and role. The GUI for users contains more info and you can create group of servers.<br />
<br />
<b><span class="Apple-style-span" style="font-size: x-large;">Installing the netdirector agent (Client)</span></b><br />
<br />
Get the binary file.<br />
<b># wget </b><b><a href="http://sourceforge.net/projects/netdirector/files/NetDirector%20Server%20Agent/Netdirector%20Agent%203.1%20Stable/netdirectoragent-3.1-linux-installer.bin/download">http://sourceforge.net/projects/netdirector/files/NetDirector%20Server%20Agent/Netdirector%20Agent%203.1%20Stable/netdirectoragent-3.1-linux-installer.bin/download</a></b><br />
<br />
Now if you try to install the binary and you are using 64bit Ubuntu, nothing is going to happen. The reason is that the binary requires some 32bit libraries. To avoid this problem install the following package.<br />
<br />
<b>#apt-get install ia32-libs</b><br />
<b><br />
</b><br />
Then install the package using text mode and follow instructions.<br />
<br />
<b># ./netdirectoragent-3.1-linux-installer.bin --mode text</b><br />
<b><br />
</b><br />
After installing the agent you can go to the web interface and add the server.<br />
<br />
Enjoy it ...Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-29796990504568017312009-11-19T13:07:00.000-08:002010-10-07T10:52:06.312-07:00Installing Groundwork 6 (Nagios) on Ubuntu 9.04 64bits<div><b><i>"Research time .."</i></b></div>Yes , yes ...you probably try to figure out why Ubuntu. I prefer other linux distros like Red Hat, Centos or SUSE, however sometimes you can face developers that like Ubuntu and you can not do anything... so I decided to base many of blogs on installations for Ubuntu 9.04 (Current version). Moreover, 32bits installations for current servers do not make sense since most of the new servers have 64bit support and more that 2GB of memory.<br />
<div><br />
</div><div>I have installed Groundworks on Centos with no problem at all , however ...if you try to install Groundworks (64bit) on Ubuntu 9.04, you will find one issue. </div><div></div><div>First, make sure you have Ubuntu upgraded</div><div><br />
</div><div><b>#apt-get upgrade</b></div><div><br />
</div><div>then get the Groundworks binary</div><div><br />
</div><div><b># wget </b><a href="https://sourceforge.net/projects/gwmos/files/GW%20Monitor%20Community%20Edition/6.0%20%28stable%29/groundwork-6.0-br120-gw440-linux-64-installer.bin/download"><b>https://sourceforge.net/projects/gwmos/files/GW%20Monitor%20Community%20Edition/6.0%20%28stable%29/groundwork-6.0-br120-gw440-linux-64-installer.bin/download</b></a></div><div><div><br />
</div><div><b># chmod +x groundwork-6.0-br120-gw440-linux-64-installer.bin</b></div><div><br />
</div><div>Now wait ....you would think that you can just run the binary file to install ..however you will get an error with the agent.bin file. The problem is that agent.bin was created dynamically linked to 32 bit libraries ...so you Ubuntu 64 bit does not contain these libraries. For this specific version of Groundworks, I suggest to install 32 bit libraries.</div><div><br />
</div><div><b># apt-get install libc6-i386</b></div><div><br />
</div><div>Then you can install Groundworks .....This bug has already been reported <a href="http://www.groundworkopensource.com:8080/browse/GWCE-17">http://www.groundworkopensource.com:8080/browse/GWCE-17</a></div><div>So newer versions probably will have it fixed.</div><div><br />
</div><div>Enjoy it ....</div></div>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-29971779555273151512009-11-18T13:53:00.000-08:002009-11-18T13:53:53.680-08:00Installing vmware tools on Ubuntu 9.04<i><b>" Research time ..."</b></i><br />
<span style="font-family: Arial; font-size: small;"><span style="background-color: white; font-size: 13px;">Ubuntu is not a OS supported by VMware so installing vmware tools on Ubuntu is not a easy task. </span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="background-color: white; font-size: 13px;">First You can select to install vmware tools , then mount the cdrom drive on the Ubuntu VM, then copy the tar file to your local hard drive, untar the file, and finallly run ./vmware-install.pl.....WAIT ...WRONG .....it does not work.</span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"><br />
</span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;">First ...First ...you have to make sure you have gcc and make installed ...</span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"><br />
</span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;">#apt-get install gcc make</span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"><br />
</span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;">Then ....the modules will not compile so you will see some errors. You can google and find the patches so then you can compile. Finally you would think all this trouble to get vmware tools installed on Ubuntu .....</span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;">However, you can grab this script <span style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: Arial; font-size: 13px;"><span style="font-family: Tahoma, Arial, Helvetica; font-size: 12px; line-height: 20px;"><a href="http://chrysaor.info/scripts/ubuntu904vmtools.sh">http://chrysaor.info/scripts/ubuntu904vmtools.sh</a> and executed on your VM and you will get every done . </span></span></span></span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"><span style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: Arial; font-size: 13px;"><span style="font-family: Tahoma, Arial, Helvetica; font-size: 12px; line-height: 20px;">Thanks to <a href="http://chrysaor.info/">http://chrysaor.info/</a>, this guy is providing Debian, openbsd, and Ubuntu images with vmware tool installed.</span></span></span></span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"><span style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: Arial; font-size: 13px;"><span style="font-family: Tahoma, Arial, Helvetica; font-size: 12px; line-height: 20px;"><br />
</span></span></span></span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"><span style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: Arial; font-size: 13px;"><span style="font-family: Tahoma, Arial, Helvetica; font-size: 12px; line-height: 20px;">Enjoy it....</span></span></span></span></span>Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com1tag:blogger.com,1999:blog-2917649492034325188.post-15089982302750789072009-11-17T10:01:00.000-08:002009-11-18T11:33:17.031-08:00Installing Cacti on Ubuntu 9.04<i><b>" Research time ..." </b></i><br />
<br />
<a href="http://www.cacti.net/">Cacti</a> is a network graphic solution based on RRDTools. Installing Cacti on Ubuntu 9.04 is a very easy task.<br />
<br />
Firts you will need a Ubuntu Server with all the basic installation.<br />
<br />
Make sure you have LAMP stack installed.<br />
<br />
#tasksel install lamp-server<br />
<br />
Then install Cacti package.<br />
<br />
#apt-get install cacti cacti-spine<br />
<br />
This process will install Cacti 0.8.7b. After the install you can access the installation pages on <a href="http://server/cacti/%20">http://server/cacti/ </a>. Follow the instructions and the installation will be finished.....???<br />
<br />
Access <a href="http://server/cacti/">http://server/cacti/</a> using user: admin and password: admin<br />
Cacti will ask you to change password so then you can access.<br />
<br />
<b>PROBLEMS, PROBLEMS!!!</b><br />
1- No able to add network devices with SNMP.<br />
2- Thunbnails are not working.<br />
<br />
Ubuntu 9.04 repos will install rrdtool 1.3.1, however Cacti 0.8.7b seems to support only up to rrdtool 1.2.X.<br />
In that case, it will be better to get the latest version of Cacti 0.8.7e and install it.<br />
<br />
<br />
Get the package <a href="http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz">http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz</a><br />
<br />
Enjoy it..Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-59880000801109483892009-11-11T14:04:00.000-08:002009-11-11T14:04:27.731-08:00Quick Install: MediaWiki on Ubuntu 9.04 <i><b>" Research time!!" </b></i><br />
<br />
MediaWiki is an opensource project that allows you to keep your documentation updated. You probably can find a bunch of Wiki projects out there, however it is the most complete. This process shows you how to install MediaWiki on Ubuntu. <br />
<br />
Requirements:<br />
Ubuntu server , basic installation.<br />
<br />
<b>#tasksel install lamp-server</b><br />
<br />
<b># apt-get install mediawiki</b><br />
<br />
The installation is going to ask you about mysql password.<br />
<br />
Additional Packages<br />
<br />
<b>#apt-get install imagemagick mediawiki-math php5-gd</b><br />
<br />
<br />
Uncomment from /etc/mediawiki/apache.conf <br />
<br />
Alias /mediawiki /var/lib/mediawiki<br />
<br />
<br />
Restart apache<br />
<br />
<br />
go to your browser <br />
<br />
http://mediawikiserver/mediawiki/<br />
<br />
Follow steps<br />
<br />
<b>#mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki/LocalSettings.php<br />
#chmod 600 /etc/mediawiki/LocalSettings.php<br />
#rm -Rf /var/lib/mediawiki/config<br />
</b><br />
<br />
<span style="font-size: large;"><b>Logo change</b></span><br />
<br />
# cp logo.png /var/lib/mediawiki/skins/common/images/wiki.png<br />
<br />
User administrator<br />
<br />
user: WikiSysop pass: <defined on="" setup=""><br />
<br />
Make sure to setup your relay for SMTP.<br />
<br />
<b><span style="font-size: large;">Installing extensions</span></b><br />
<br />
# apt-get install mediawiki-extensions mediawiki-semediawiki<br />
<br />
Extension available on <br />
/etc/mediawiki-extensions/extensions-available<br />
<br />
Enable LDAP authetication<br />
<br />
# mwenext LdapAuthentication.php</defined><br />
<br />
add this to Localsettings.php<br />
<br />
# LDAP CONFIGURATION<br />
$wgAuth = new LdapAuthenticationPlugin();<br />
$wgLDAPDomainNames = array("LDAPDEV");<br />
$wgLDAPServerNames = array("LDAPDEV"=>"ldap.example.local");<br />
<br />
$wgLDAPUseLocal = true;<br />
<br />
$wgLDAPEncryptionType = array("LDAPDEV"=>"clear");<br />
<br />
$wgLDAPBaseDNs = array("LDAPDEV"=>"dc=example,dc=local");<br />
$wgLDAPSearchAttributes = array("LDAPDEV"=>"uid");<br />
<br />
<br />
$wgLDAPDebug = 3; //for debugging LDAP<br />
$wgShowExceptionDetails = true; //for debugging MediaWiki<br />
<br />
$wgGroupPermissions['*']['createaccount'] = false;<br />
$wgGroupPermissions['*']['read'] = true;<br />
$wgGroupPermissions['*']['edit'] = false;<br />
$wgGroupPermissions['*']['createpage'] = false;<br />
$wgGroupPermissions['*']['createtalk'] = false;<br />
<br />
<br />
<br />
<br />
Enjoy it ....Carlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0tag:blogger.com,1999:blog-2917649492034325188.post-20907728335161987922009-11-10T08:06:00.000-08:002009-11-17T06:28:59.050-08:00Quick tip: Disk Usage on linux<i><b>" Research time !!"</b></i><br />
<br />
I can not imagine how many times a disk of a linux server gets filled up ( I would say it is common with virtual machine since we normally size the disk to fit only the OS). Moreover, system administrators need to find out what happened to get that disk filled up. A good and powerful tool is du command so I will show you how to use it.<br />
<br />
#du -hs *<br />
<br />
It will show you the disk usage on that directory.<br />
<br />
#du -s *|sort -n<br />
<br />
It will sort the output so you can see the largest directory or file on the bottom ...<br />
<br />
With only this two commands you can easily find the largest directory or file.<br />
<br />
<br />
Enjoy itCarlos Gomezhttp://www.blogger.com/profile/11596955117925135894noreply@blogger.com0