<?xml version="1.0" encoding="ISO-8859-1"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en-US">
	<title>A blog by a system administrator and programmer.</title>
	<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php" />
	<modified>2012-02-23T03:50:56Z</modified>
	<author>
		<name>Freddy Chu</name>
	</author>
	<copyright>Copyright 2012, Freddy Chu</copyright>
	<generator url="http://www.sourceforge.net/projects/sphpblog" version="0.5.1">SPHPBLOG</generator>
	<entry>
		<title>java OutOfMemoryError Cont.</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry111117-210002" />
		<content type="text/html" mode="escaped"><![CDATA[If you still face the problem of<br /><br /><strong>java.lang.OutOfMemoryError: PermGen space</strong><br /><br />Event you have increase the -XX:MaxPermSize.<br /><br />You can try the following jvm args.<br /><br /><blockquote>-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled</blockquote><br /><br />Usually only java web container like tomcat / jboss / jetty with many contexts will need that flag.<br /><br />But remember enabling this will decrease the performance. Use with care.<br /><br />P.S. java 1.6 seems do not support CMSPermGenSweepingEnabled.]]></content>
		<id>http://www.tux.hk/index.php?entry=entry111117-210002</id>
		<issued>2011-11-17T00:00:00Z</issued>
		<modified>2011-11-17T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Java Out of Memory problems</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry110918-143121" />
		<content type="text/html" mode="escaped"><![CDATA[<h3>Java heap</h3><br />java.lang.OutOfMemoryError: Java heap<br /><br />Just simply apply -Xmx will fix the issue. But notice that one thing there have max. value for difference os.<br />e.g. <br />32bit Windows around 2G<br />32bit Linux around 2.5G<br />64bit I only tried to use 4G, the limit seems much higher than 32bit systems.<br /><br /><br /><h3>PermGen space</h3><br />java.lang.OutOfMemoryError: PermGen space<br /><br /><a href="http://blogs.oracle.com/jonthecollector/entry/presenting_the_permanent_generation" target="_blank" >Presenting the Permanent Generation</a><br /><br />By my understanding, PermGen space is for loading classes specifications. Usually you will not able to see this exception. Expecte that you have many lib need to be load and use.<br />Using Jboss with more than 1 big web application may hit this. You can change this limit by using -XX:PermSize and -XX:MaxPermSize<br />e.g.<br /><blockquote>-XX:PermSize=128m<br />-XX:MaxPermSize=128m</blockquote><br /><br /><br /><h3>GC overhead limit exceeded</h3><br />I think this is most uncommon exception that will be hitted<br />java.lang.OutOfMemoryError: GC overhead limit exceeded<br /><br /><blockquote>Excessive GC Time and OutOfMemoryError<br />The parallel collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.</blockquote><br /><br /><a href="http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.oom" target="_blank" >source</a><br /><br />The best way is to solve the coding problem. It is believed that the code have genereated too many trivial object. Especially in loops, if that is the case rather reuse the object than new an object. <br /><br />If you really don&#039;t want to change the code or you cannot found the problem you can try the following way. Hopefully it will solve the issue, but not the best way and may require a long time to finish.<br /><br />JVM have 3 difference garbage collectors you can try switching between them.<br /><br /><b>serial collector</b><br />single processor<br />jvm flag: -XX:+UseSerialGC<br /><br /><b>parallel collector</b><br />high throughput sometimes with pause<br />jvm flag: -XX:+UseParallelGC<br /><br /><b>concurrent collector</b><br />low lag time &amp; moderate throughput<br />jvm flag: -XX:+UseConcMarkSweepGC -XX:+UseParNewGC<br />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry110918-143121</id>
		<issued>2011-09-18T00:00:00Z</issued>
		<modified>2011-09-18T00:00:00Z</modified>
	</entry>
	<entry>
		<title>my Apache production checklist</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry110220-162335" />
		<content type="text/html" mode="escaped"><![CDATA[<h3>Apache (httpd)</h3><br /><br /><b>Lower KeepAliveTimeout</b><br />Default usually around 15 but I will choose from 5-10 but remember do not set the value too low as it will cause tcp overhead<br /><br /><b>Reduce extra dns lookup for log</b><br />HostnameLookups off<br /><br /><b>Disable directory listing</b><br />Remove &quot;Indexes&quot; from Options<br /><br /><b>Disable .htaccess files</b><br />Reduce file IO to search and access permission files, put all access control into your apache configuration files<br />just simply comment out all AccessFileName lines<br /><br /><b>Make sure Apache is not run by root</b><br />remember to check the &quot;User&quot; and &quot;Group&quot; in configure file<br /><br /><b>Hide system information</b><br /><blockquote>ServerTokens Prod<br />ServerSignature off</blockquote><br />If you really want to hide the name of Apache, you will need to modify the source code and compile for yourself. I believe it is not a necessary step as there still have many ways to discover your web server easily.<br /><br /><b>Disable weak cipher</b><br /><blockquote>SSLProtocol -ALL +SSLv3 +TLSv1<br />SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXPORT</blockquote><br /><br /><b>Limit the use of mod_status</b><br />If you really need that better change the Location to non default links and make sure it is protected by source host or any authentication<br /><br /><b>Turn on FollowSymLinks but disable SymLinksIfOwnerMatch</b><br />which reduce disk IO to check the file type but make sure that nobody put links in your server that point to your private files<br /><blockquote>Options FollowSymLinks</blockquote><br />remove &quot;SymLinksIfOwnerMatch&quot; from Options<br /><br /><b>Enable compress module (if application do not implement compression.)</b><br /><blockquote>&lt;Location /&gt;<br /># Insert filter<br />SetOutputFilter DEFLATE<br /><br /># Netscape 4.x has some problems...<br />BrowserMatch ^Mozilla/4 gzip-only-text/html<br /><br /># Netscape 4.06-4.08 have some more problems<br />BrowserMatch ^Mozilla/4\.0[678] no-gzip<br /><br /># MSIE masquerades as Netscape, but it is fine<br /># BrowserMatch \bMSIE !no-gzip !gzip-only-text/html<br /><br /># NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48<br /># the above regex won&#039;t work. You can use the following<br /># workaround to get the desired effect:<br />BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html<br /><br /># Don&#039;t compress images<br />SetEnvIfNoCase Request_URI \<br />\.(?:gif|jpe?g|png)$ no-gzip dont-vary<br /><br /># Make sure proxies don&#039;t deliver the wrong content<br />Header append Vary User-Agent env=!dont-vary<br />&lt;/Location&gt;</blockquote><br /><br /><b>Disable all useless Apache modules</b><br />in some OS the default config files include many useless moduels<br />e.g.<br /><blockquote>ldap_module<br />proxy_ajp_module<br />proxy_balancer_module<br />proxy_connect_module<br />proxy_ftp_module<br />proxy_http_module<br />proxy_module<br />speling_module</blockquote><br /><br /><b>install some protection modules (optional)</b><br /><a href="http://www.modsecurity.org/" target="_blank" >mod_securitye</a><br /><a href="http://www.zdziarski.com/blog/?page_id=442" target="_blank" >mod_evasive</a><br /><br /><br /><h3>OS</h3><br /><b>Disable access time update</b><br />Set noatime to your web document root if your OS support<br />e.g. <br /><blockquote>/dev/md0        /var/www           ext3    defaults,noatime        0       0</blockquote><br /><br /><b>Tune network options of the OS</b><br /><blockquote>net.core.netdev_max_backlog = 3000<br />net.core.rmem_default = 16777216<br />net.core.rmem_max = 16777216<br />net.core.wmem_default = 16777216<br />net.core.wmem_max = 16777216<br />net.ipv4.tcp_rmem = 4096 87380 16777216<br />net.ipv4.tcp_wmem = 4096 65536 16777216</blockquote><br />Here is just some examples by my experience.<br /><br /><b>Check disk usage</b><br />Make sure there is enough space for log file and don&#039;t forget to check the log rotation config.<br /><br /><br /><h3>PHP</h3><br /><b>Change the session name</b><br />session.name = SESSION<br />It is my habit that do not use default session name<br /><br /><b>hiding php version information X-Powered-By</b><br />expose_php = Off<br /><br /><b>Deploy php accelerator</b><br />List of accelerators<br /><a href="http://pecl.php.net/package/APC" target="_blank" >Alternative PHP Cache</a><br /><a href="http://eaccelerator.net/" target="_blank" >eaccelerator</a><br /><a href="http://www.php-accelerator.co.uk/" target="_blank" >ionCube PHP Accelerator</a><br /><a href="http://xcache.lighttpd.net/" target="_blank" >XCache</a><br /><a href="http://www.zend.com/products/server/" target="_blank" >Zend Accelerator</a><br /><a href="http://www.iis.net/expand/WinCacheForPHP" target="_blank" >Windows Cache Extension for PHP</a>]]></content>
		<id>http://www.tux.hk/index.php?entry=entry110220-162335</id>
		<issued>2011-02-20T00:00:00Z</issued>
		<modified>2011-02-20T00:00:00Z</modified>
	</entry>
	<entry>
		<title>file_get_contents getting mad?</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry100420-202003" />
		<content type="text/html" mode="escaped"><![CDATA[My blog is died for awhile after php upgrade to 5.2.13. It is full of error about putting a non-array into rsort.<br /><br />The root cause of the problem is due to the this blog store entries in file base, some of the file listing is serialized array. If you copy those content and try to unserialize it, it is perfect no error.<br /><br />It really make me shocked as i expected the problem is come from  serialization algorithm but it is not. It really cost me some time to figure out that the problem is from file_get_contents. It is really tricky, it won&#039;t show on command line mode but only happens in php modules of apache.<br /><br />The REAL reason of unserializable is because <strong><em>file_get_contents add slashes into the output string</em></strong>. I have really no idea why i happens...<br /><br />So I use the most <strong>DIRTY</strong> way to fix that ... add a stripslashes after call file_get_contents. <br /><br />If anybody know the reasons please let me know :( <br /><br />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry100420-202003</id>
		<issued>2010-04-20T00:00:00Z</issued>
		<modified>2010-04-20T00:00:00Z</modified>
	</entry>
	<entry>
		<title>undefined symbol: dav_register_provider</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry100412-172421" />
		<content type="text/html" mode="escaped"><![CDATA[It has been a long time that i haven&#039;t update my apache... <br /><br />It is very easy to do with Gentoo but this time it give me an error. :(<br /><br /><code>/usr/lib/apache2/modules/mod_dav_svn.so: undefined symbol: dav_register_provider</code><br /><br />After googled awhile ... i found that is related to dav of apache, at that time i really don&#039;t know why there exist such problem. As my svn server have been up for at least 5 years. It never get such problem.<br /><br />Finally it works after I load the dav before svn module.<br /><br /><code>LoadModule dav_module modules/mod_dav.so<br />LoadModule dav_fs_module modules/mod_dav_fs.so<br />LoadModule dav_lock_module modules/mod_dav_lock.so<br />DavLockDB &quot;/var/lib/dav/lockdb&quot;</code><br /><br />if you are using the same OS as me and you have compiled apache with dav options. Just add &quot;-DDAV&quot; to APACHE2_OPTS in /etc/conf.d/apache2<br /> <br />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry100412-172421</id>
		<issued>2010-04-12T00:00:00Z</issued>
		<modified>2010-04-12T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Too many CLOSE_WAIT</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry090521-111844" />
		<content type="text/html" mode="escaped"><![CDATA[Currently I found that jetty / tomcat on Linux will have many CLOSE_WAIT on busy system especially your network is not in good condition.<br /><br />These CLOSE_WAIT will disappear untill you stop the server. These CLOSE_WAIT will use up all of you tcp connection and hang up your web server. Many people claimed that is the bug of jvm. Although I have tried most java ver., the problem still exist.<br /><br />Here is another dirty way to fix that issue... although it is not the best solution........<br />add the following lines to /etc/sysctl.conf<br /><blockquote>net.ipv4.tcp_fin_timeout = 30<br />net.ipv4.tcp_keepalive_intvl = 2<br />net.ipv4.tcp_keepalive_probes = 2<br />net.ipv4.tcp_keepalive_time = 1800</blockquote><br /><br />And then execute<br /><blockquote>sysctl -p</blockquote><br />or do a reboot<br />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry090521-111844</id>
		<issued>2009-05-21T00:00:00Z</issued>
		<modified>2009-05-21T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Jetty disable weak cipher</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry090416-140738" />
		<content type="text/html" mode="escaped"><![CDATA[inorder to disable weak SSL cipher in jetty you can add the xml below into SslSocketConnector<br /><br /><br /><blockquote><pre>&lt;Set name=&quot;ExcludeCipherSuites&quot;&gt;<br />  &lt;Array type=&quot;java.lang.String&quot;&gt;<br />    &lt;Item&gt;SSL_RSA_WITH_DES_CBC_SHA&lt;/Item&gt;<br />    &lt;Item&gt;SSL_DHE_RSA_WITH_DES_CBC_SHA&lt;/Item&gt;<br />    &lt;Item&gt;SSL_DHE_DSS_WITH_DES_CBC_SHA&lt;/Item&gt;<br />    &lt;Item&gt;SSL_RSA_EXPORT_WITH_RC4_40_MD5&lt;/Item&gt;<br />    &lt;Item&gt;SSL_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;/Item&gt;<br />    &lt;Item&gt;SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;/Item&gt;<br />    &lt;Item&gt;SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA&lt;/Item&gt;<br />  &lt;/Array&gt;<br />&lt;/Set&gt;</pre></blockquote><br />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry090416-140738</id>
		<issued>2009-04-16T00:00:00Z</issued>
		<modified>2009-04-16T00:00:00Z</modified>
	</entry>
	<entry>
		<title>java.io.IOException: Too many open files</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry081025-000654" />
		<content type="text/html" mode="escaped"><![CDATA[Yesterday I have face a funny java exception on my Linux server.<br /><br /><blockquote>java.io.IOException: Too many open files         at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)         at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)         at org.mortbay.jetty.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConnector.java:75)         at org.mortbay.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:475)         at org.mortbay.io.nio.SelectorManager.doSelect(SelectorManager.java:166)         at org.mortbay.jetty.nio.SelectChannelConnector.accept(SelectChannelConnector.java:124)         at org.mortbay.jetty.AbstractConnector$Acceptor.run(AbstractConnector.java:537) </blockquote><br /><br />It have cost me few minutes to figure out what is that problem. <br /><br />At first i think it is caused by sysctl<br />but i found <br /><blockquote>fs.file-max = 65535</blockquote><br />and my lsof -nn | wc -l is only around 10xx so i know that is not the problem.<br /><br />After that i think about ulimit, if you are careless you may fake by default result the command ulimit&#039;s output. <strong>unlimited</strong><br /><br />When you execute ulimit -a you will see the whole story.<br /><br /><pre>#ulimit -a<br />core file size          (blocks, -c) 0<br />data seg size           (kbytes, -d) unlimited<br />max nice                        (-e) 0<br />file size               (blocks, -f) unlimited<br />pending signals                 (-i) 16370<br />max locked memory       (kbytes, -l) 32<br />max memory size         (kbytes, -m) unlimited<br />open files                      (-n) 1024<br />pipe size            (512 bytes, -p) 8<br />POSIX message queues     (bytes, -q) 819200<br />max rt priority                 (-r) 0<br />stack size              (kbytes, -s) 10240<br />cpu time               (seconds, -t) unlimited<br />max user processes              (-u) 16370<br />virtual memory          (kbytes, -v) unlimited<br />file locks                      (-x) unlimited</pre><br /><br />Now you know the point is there ... most Linux default openfile per user is limited to 1024. So you must edit the file /etc/security/limits.conf<br /><br />add those 2 lines below to override the default limit.<br /><br /><blockquote>* soft nofile 65536 <br />* hard nofile 65536 </blockquote>]]></content>
		<id>http://www.tux.hk/index.php?entry=entry081025-000654</id>
		<issued>2008-10-24T00:00:00Z</issued>
		<modified>2008-10-24T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Oracle moving index to another table space</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry080408-170443" />
		<content type="text/html" mode="escaped"><![CDATA[These days I am super busy. Nearly no time to write my blog. :(<br /><br />There is so many people asking me how to move the index after created. As you know if you use plsql developer&#039;s GUI it will drop the constraint and add again with index. I don&#039;t know why it work like that but there is some simple solution.<br /><br /><b>ALTER INDEX &lt;INDEX_NAME&gt; REBUILD TABLESPACE &lt;TALESPACE_NAME&gt;</b><br /><br />Here also show you a simple procedure to move all index of a table from one tablespace to another tablespace.<br /><br /><pre><br />create or replace procedure MOVE_INDEX_BETWEEN_TABLESPACE(from_ts   in string,<br />                                                          to_ts     in string,<br />                                                          tablename in string) is<br />  cursor index_names is<br />    select user_indexes.index_name<br />      from user_indexes<br />     where user_indexes.table_name like upper(tablename)<br />       and user_indexes.tablespace_name = upper(from_ts);<br />  index_name user_indexes.index_name%type;<br />begin<br />  open index_names;<br />  loop<br />    fetch index_names<br />      into index_name;<br />    exit when index_names%notfound;<br />    if index_name is not null and to_ts is not null then<br />      EXECUTE IMMEDIATE &#039;ALTER INDEX &#039; || index_name ||<br />                        &#039; REBUILD TABLE_SPACE &#039; || to_ts;<br />    end if;<br />  end loop;<br />end MOVE_INDEX_BETWEEN_TABLESPACE;<br /></pre>]]></content>
		<id>http://www.tux.hk/index.php?entry=entry080408-170443</id>
		<issued>2008-04-08T00:00:00Z</issued>
		<modified>2008-04-08T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Happy lunar new year~~</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry080210-110100" />
		<content type="text/html" mode="escaped"><![CDATA[This year I am lucky that I can have a good location to take photos. :D<br /><br /><a href="javascript:openpopup('images/024.jpg',1920,1080,false);"><img src="images/thumb/480_270_024.png" border="0" alt="" /></a><br /><br />For more photos please go to my gallery.<br /><br /><b><a href="http://www.tux.hk/gallery/index.php/Fireworks2008" target="_blank" >Fireworks 2008</a></b><br /><br />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry080210-110100</id>
		<issued>2008-02-10T00:00:00Z</issued>
		<modified>2008-02-10T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Java disk usage</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry080111-115615" />
		<content type="text/html" mode="escaped"><![CDATA[It have been a long time for me to found a way to check the disk usage in Java.<br /><br />Finially i get the solutions. It is in Java 6.0. <b>java.io.File</b><br /><br />There is 2 functions. <br /><br /><blockquote>getTotalSpace() --- Returns the size of the partition named by this abstract pathname.<br />getUsableSpace() --- Returns the number of bytes available to this virtual machine on the partition named by this abstract pathname.</blockquote><br /><br />If your application is limited to use versions before 6.0. Then you can only keep using external commands. <br />Runtime.getRuntime().exec(commands);<br />e.g.<br />Linux/Unix: df<br />Windows: fsutil volume diskfree c:<br /><br />Alternative solutions for system independent solutions is to setup a snmp on the server you want to check and use java snmp client to query the result. That will be quite complex.<br /><br />Useful links:<br /><a href="http://www.snmp4j.org" target="_blank" >snmp4j</a> <br /><a href="http://net-snmp.sourceforge.net" target="_blank" >netsnmp</a> ]]></content>
		<id>http://www.tux.hk/index.php?entry=entry080111-115615</id>
		<issued>2008-01-11T00:00:00Z</issued>
		<modified>2008-01-11T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Happy New Year 2008</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry080101-181530" />
		<content type="text/html" mode="escaped"><![CDATA[Happy New Year to All :D<br /><br /><img src="images/thumb/480_360_sunrise.png" border="0" alt="" />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry080101-181530</id>
		<issued>2008-01-01T00:00:00Z</issued>
		<modified>2008-01-01T00:00:00Z</modified>
	</entry>
	<entry>
		<title>compile error of subversion</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry071220-182716" />
		<content type="text/html" mode="escaped"><![CDATA[This problem usually exist in solaris 5.7<br /><br /><blockquote>libtool[4766]: : is not an identifier<br />make: *** [subversion/svn/svn] <b>Segmentation Fault.</b> (core dumped)</blockquote><br /><br />Many people suggested to compile it as static link, then the problem will be solved. I have tried but without success. So that i start debug the compile code, lastly i found the problem is caused by ksh.<br /><br /><b>Solution:</b><br /><br /><blockquote>1. do configure as usual<br />2. replace all ksh to bash or sh in Makefiles and libtool<br />3. make</blockquote><br /><br />P.S. becareful of compile neon, db4, openssl, expat, apr, apr-util for solaris. It seems that gcc &lt; 3.0 have some bugs in solaris system, you better compile them with shared flags]]></content>
		<id>http://www.tux.hk/index.php?entry=entry071220-182716</id>
		<issued>2007-12-20T00:00:00Z</issued>
		<modified>2007-12-20T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Compiler error in Solaris</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry071210-223600" />
		<content type="text/html" mode="escaped"><![CDATA[These days I have facing an error during compile DB4 in solaris 5.7.<br /><br />when I am doing configure It shows <br /><blockquote>configure: error: C compiler cannot create executables</blockquote><br /><br />Here is the error in config.log. <br /><blockquote>configure:3855: found /usr/ucb/cc<br />configure:3866: result: cc<br />configure:3902: checking for C compiler version<br />configure:3909: cc --version &gt;&amp;5<br />/usr/ucb/cc:  language optional software package not installed<br />configure:3912: $? = 1<br />configure:3919: cc -v &gt;&amp;5<br />/usr/ucb/cc:  language optional software package not installed<br />configure:3922: $? = 1<br />configure:3929: cc -V &gt;&amp;5<br />/usr/ucb/cc:  language optional software package not installed<br />configure:3932: $? = 1<br />configure:3955: checking for C compiler default output file name<br />configure:3982: cc -O  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS   conftest.c  &gt;&amp;5<br />/usr/ucb/cc:  language optional software package not installed</blockquote><br /><br />I have googled for sometime but seems no any solutions. &gt;&quot;&lt;<br /><br />But suddently I think about tricky way. <B>Changed the compiler</B><br /><br />so that i export CC=gcc<br /><br />It works lucky.<br /><br />Do anybody know another way?]]></content>
		<id>http://www.tux.hk/index.php?entry=entry071210-223600</id>
		<issued>2007-12-10T00:00:00Z</issued>
		<modified>2007-12-10T00:00:00Z</modified>
	</entry>
	<entry>
		<title>syslog-ng concurrent  connections exceeded</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry071119-105947" />
		<content type="text/html" mode="escaped"><![CDATA[These days I get a very funny warning in the syslog.<br /><br /><blockquote>syslog-ng[4484]: Number of allowed concurrent connections exceeded; num=&#039;10&#039;, max=&#039;10&#039;</blockquote><br /><br />I have googled it for a while, it seems is the default values of syslog-ng limited the concurrent connections of any stream device to 10.<br /><br />It can simply sloved by increase the limit.<br /><br />in syslog-ng.conf<br /><br /><blockquote><code>unix-stream(&quot;/dev/log&quot; max-connections(20));</code></blockquote><br />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry071119-105947</id>
		<issued>2007-11-19T00:00:00Z</issued>
		<modified>2007-11-19T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Simple MySQL Replication HOWTO</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry071101-181005" />
		<content type="text/html" mode="escaped"><![CDATA[<h3>Requirements:</h3><br /><br />* Slave server should be newer version than the master server. It is adviced that both servers are in same version<br />* Network port 3306 of both server should be avaliable<br />* log-bin is enabled<br /><br /><br /><h3>Procedure</h3><br /><br />1. edit my.cnf to add log-bin and server-id, server-id should be unique and from 1 to 2^32 - 1.<br /><blockquote>[mysqld]<br />server-id = 1<br />log-bin</blockquote><br /><br />2. restart the mysql server both server if you have do many modification in step 1<br /><br />3. create replicate user, if you are using MySQL before 4.0.2 replace &quot;REPLICATION SLAVE&quot; by &quot;FILE&quot;<br /><blockquote>GRANT REPLICATION SLAVE ON *.* TO &#039;Username&#039;@&#039;Host&#039; IDENTIFIED BY &#039;password&#039;;</blockquote><br /><br />4. lock all tables on master server<br /><br /><blockquote>mysql&gt; FLUSH TABLES WITH READ LOCK;</blockquote><br /><br />5. Copy all mysql files to the slave server<br /><br />6. At master server run show master status, remember the file and position info<br /><br /><blockquote>mysql&gt; SHOW MASTER STATUS;<br />+--------------+----------+--------------+------------------+<br />| File         | Position | Binlog_do_db | Binlog_ignore_db |<br />+--------------+----------+--------------+------------------+<br />| log-bin.002 | 189      |              |                  |<br />+--------------+----------+--------------+------------------+</blockquote><br /><br />7. At slave server run change master to use the account create in step 3 and info in step 6<br /><blockquote>CHANGE MASTER TO<br />MASTER_HOST=&#039;master_server_ip&#039;,<br />MASTER_USER=&#039;slave_user_name&#039;,<br />MASTER_PASSWORD=&#039;slave_password&#039;,<br />MASTER_LOG_FILE=&#039;file_in_step_7&#039;,MASTER_LOG_POS=position_in_step_7;</blockquote><br /><br />8. run Slave start<br /><br />9. unlock tables on master server<br /><br /><blockquote>mysql&gt;UNLOCK TABLES;</blockquote><br /><br /><br />Now you will have a replicate MySQL server, just test to modify any records. :D]]></content>
		<id>http://www.tux.hk/index.php?entry=entry071101-181005</id>
		<issued>2007-11-01T00:00:00Z</issued>
		<modified>2007-11-01T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Mysql problems</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry071027-180526" />
		<content type="text/html" mode="escaped"><![CDATA[<strong>Get Error 1033 &quot;Incorrect information in file xxxx.frm&quot; when run REPAIR</strong><br /><br />* Found a backup frm file if you can and overwrite the existing one<br />* If you do not have frm backup, you may need to find the original &quot;create table&quot; statement<br /><blockquote><br />1. Backup those table&#039;s frm, MYI, MYD first<br />2. use the original create table statement to create a new table with another name<br />3. overwrite the table&#039;s frm with the new table&#039;s frm<br />4. run REPAIR TABLE again<br /><br /></blockquote><br /><br /><strong>mysqldump: Got error: 1105: not found (Errcode: 24) when using LOCK TABLES</strong><br /><br />* this happens usually caused by open_files_limit too low<br />* edit my.cnf at [mysqld]&quot; part<br /><blockquote><br />[mysqld]<br />  open_files_limit = 8192<br /><br /></blockquote><br />* restart mysql server]]></content>
		<id>http://www.tux.hk/index.php?entry=entry071027-180526</id>
		<issued>2007-10-27T00:00:00Z</issued>
		<modified>2007-10-27T00:00:00Z</modified>
	</entry>
	<entry>
		<title>About my blog</title>
		<link rel="alternate" type="text/html" href="http://www.tux.hk/index.php?entry=entry071025-214145" />
		<content type="text/html" mode="escaped"><![CDATA[It has been a long time that i want to have my own blog, but<br /><br /><br /><center>I am really <strong>lazy</strong>....</center><br /><br /><br />I spent most of my in <strong>World of Warcraft</strong> in the past. I think i have spent almost around 2 years in the game. It is a good timing to leave the virtual world and put more time on work and study. :D<br /><br />This blog is mainly about Unix servers and programming problems.<br /><br />I will keep update it when i solve any interesting problems.<br /><br /><img src="images/thumb/480_320_img_1266.png" border="0" alt="" />]]></content>
		<id>http://www.tux.hk/index.php?entry=entry071025-214145</id>
		<issued>2007-10-25T00:00:00Z</issued>
		<modified>2007-10-25T00:00:00Z</modified>
	</entry>
</feed>

