<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Takahisa's Weblog &#187; linux</title>
	<atom:link href="http://takahisa.info/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://takahisa.info</link>
	<description>weblog of lifetips?</description>
	<lastBuildDate>Fri, 02 Sep 2011 18:27:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Something I always forget</title>
		<link>http://takahisa.info/2011/05/10/something-i-always-forget/</link>
		<comments>http://takahisa.info/2011/05/10/something-i-always-forget/#comments</comments>
		<pubDate>Tue, 10 May 2011 07:43:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=314</guid>
		<description><![CDATA[Spam folder for Maildir mkdir -p /etc/skel/Maildir/.Spam/{new,cur,tmp} chmod -R 700 /etc/skel/Maildir/.Spam]]></description>
			<content:encoded><![CDATA[<p>Spam folder for Maildir</p>
<p>mkdir -p /etc/skel/Maildir/.Spam/{new,cur,tmp}<br />
chmod -R 700 /etc/skel/Maildir/.Spam</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2011/05/10/something-i-always-forget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess redirect, dynamic page to static page</title>
		<link>http://takahisa.info/2011/04/25/htaccess-redirect-dynamic-page-to-static-page/</link>
		<comments>http://takahisa.info/2011/04/25/htaccess-redirect-dynamic-page-to-static-page/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 05:58:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=282</guid>
		<description><![CDATA[Old Address http://www.example.com/FS-APL/FS-Form/form.cgi?code=a12 New Address http://www.example.co.jp/newsletter.html RewriteCond %{QUERY_STRING} Code=a12 RewriteRule FS-APL/FS-Form/form.cgi http://www.example.co.jp/newsletter.html? [R=301,L]]]></description>
			<content:encoded><![CDATA[<p>Old Address http://www.example.com/FS-APL/FS-Form/form.cgi?code=a12</p>
<p>New Address http://www.example.co.jp/newsletter.html</p>
<p class="code">RewriteCond %{QUERY_STRING} Code=a12<br />
RewriteRule FS-APL/FS-Form/form.cgi http://www.example.co.jp/newsletter.html? [R=301,L]</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2011/04/25/htaccess-redirect-dynamic-page-to-static-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrieve email address from text using grep</title>
		<link>http://takahisa.info/2010/03/21/retrieve-email-address-from-text-using-grep/</link>
		<comments>http://takahisa.info/2010/03/21/retrieve-email-address-from-text-using-grep/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 20:40:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=264</guid>
		<description><![CDATA[grep -Eoh &#8216;[A-Za-z0-9\-\.\_]+@[A-Za-z0-9\-\_]+\.[A-Za-z0-9\-\.\_]+&#8217; filename]]></description>
			<content:encoded><![CDATA[<p>grep -Eoh &#8216;[A-Za-z0-9\-\.\_]+@[A-Za-z0-9\-\_]+\.[A-Za-z0-9\-\.\_]+&#8217; filename</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/21/retrieve-email-address-from-text-using-grep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>username@domain login name for email account with virtualmin and postfix</title>
		<link>http://takahisa.info/2010/03/20/usernamedomain-login-name-for-email-account-with-virtualmin-and-postfix/</link>
		<comments>http://takahisa.info/2010/03/20/usernamedomain-login-name-for-email-account-with-virtualmin-and-postfix/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 15:50:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[sasl]]></category>
		<category><![CDATA[virtualmin]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=261</guid>
		<description><![CDATA[For IMAP and POP3 authentication, all you have to do is change the &#8220;Format for usernames that include domain&#8221; in: Virtualmin > System Settings > Server Templates > Default Settings > Mail for Domain to be &#8220;user@domain&#8221;. However, Cyrus SASL, which is what handles the SMTP authentication, requires a special flag on it to handle [...]]]></description>
			<content:encoded><![CDATA[<p>For IMAP and POP3 authentication, all you have to do is change the &#8220;Format for usernames that include domain&#8221; in:</p>
<p>Virtualmin > System Settings > Server Templates > Default Settings > Mail for Domain</p>
<p>to be &#8220;user@domain&#8221;.</p>
<p>However, Cyrus SASL, which is what handles the SMTP authentication, requires a special flag on it to handle user@domain usernames, a -r in the settings. The magical file you need to edit is /etc/sysconfig/saslauthd. At the bottom you will see the following:</p>
<p>Additional flags to pass to saslauthd on the command line.<br />
See saslauthd(8) for the list of accepted flags. FLAGS=-r</p>
<p>Just make your FLAGS= like mine does. This will pass the -r to the sasl authentication daemon, and your user@domain authentication will work!</p>
<p>Let me know if you have any other questions.</p>
<p>Originally found at : http://blog.molski.nl/2009/10/07/virtualmin-and-userdomain-pop3smtp-login-style/</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/20/usernamedomain-login-name-for-email-account-with-virtualmin-and-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sftp chroot with openssh ERROR : fatal: bad ownership or modes for chroot directory</title>
		<link>http://takahisa.info/2010/03/18/sftp-chroot-with-openssh-error-fatal-bad-ownership-or-modes-for-chroot-directory/</link>
		<comments>http://takahisa.info/2010/03/18/sftp-chroot-with-openssh-error-fatal-bad-ownership-or-modes-for-chroot-directory/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 02:34:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[sftp]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=257</guid>
		<description><![CDATA[If you’re playing with the excellent new ChrootDirectory and internal-sftp options in recent OpenSSH releases (such as 5.1 which is in Ubuntu 8.10 Intrepid), you may have hit an error like: fatal: bad ownership or modes for chroot directory You may also have searched on Google for what to do about it and come away [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re playing with the excellent new ChrootDirectory and internal-sftp options in recent OpenSSH releases (such as 5.1 which is in Ubuntu 8.10 Intrepid), you may have hit an error like:</p>
<p>fatal: bad ownership or modes for chroot directory<br />
You may also have searched on Google for what to do about it and come away with very little useful information.</p>
<p>Well no more! I did the same thing and got bored of reading mailing list posts, so read the source code instead. The relevant section is in session.c:</p>
<p>    if (stat(component, &#038;st) != 0)<br />
      fatal(&#8220;%s: stat(\&#8221;%s\&#8221;): %s&#8221;, __func__,<br />
          component, strerror(errno));<br />
    if (st.st_uid != 0 || (st.st_mode &#038; 022) != 0)<br />
      fatal(&#8220;bad ownership or modes for chroot &#8221;<br />
          &#8220;directory %s\&#8221;%s\&#8221;",<br />
          cp == NULL ? &#8220;&#8221; : &#8220;component &#8220;, component);<br />
This is quite simple really, it’s stat()ing the directory specified for “ChrootDirectory” and all its parents up to / and checking that they are:</p>
<p>owned by root<br />
not group or other writable<br />
(it also checks they are actually directories, but I’m going to assume you’re not stupid enough to try and chroot into a file )<br />
Note my emphesis that these checks apply to the chroot directory itself and its parents and /, so if you are chrooting users into /srv/chroot/ then you need to ensure that /, /srv and /srv/chroot are owned by root and not writable by the group (even if it’s root, bizarrely) or other users.</p>
<p>Adopted from : http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/18/sftp-chroot-with-openssh-error-fatal-bad-ownership-or-modes-for-chroot-directory/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>mod_php and suphp at same time</title>
		<link>http://takahisa.info/2010/03/11/mod_php-and-suphp-at-same-time/</link>
		<comments>http://takahisa.info/2010/03/11/mod_php-and-suphp-at-same-time/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:21:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=245</guid>
		<description><![CDATA[/etc/suphp.conf [global] logfile=/var/log/httpd/suphp_log loglevel=warn webserver_user=apache docroot=/home env_path=/bin:/usr/bin umask=0077 min_uid=500 min_gid=500 ; Security options allow_file_group_writeable=false allow_file_others_writeable=false allow_directory_group_writeable=false allow_directory_others_writeable=false ;Check wheter script is within DOCUMENT_ROOT check_vhost_docroot=false ;Send minor error messages to browser errors_to_browser=true [handlers] ;Handler for php-scripts ;x-httpd-php=php:/usr/bin/php x-httpd-php=&#34;php:/usr/bin/php-cgi&#34; ;Handler for CGI-scripts x-suphp-cgi=execute:!self /etc/httpd/conf.d/su.php # This is the Apache server configuration file providing suPHP support. # It [...]]]></description>
			<content:encoded><![CDATA[<p>/etc/suphp.conf</p>
<p class="code">  [global]<br />
  logfile=/var/log/httpd/suphp_log<br />
  loglevel=warn<br />
  webserver_user=apache<br />
  docroot=/home<br />
  env_path=/bin:/usr/bin<br />
  umask=0077<br />
  min_uid=500<br />
  min_gid=500<br />
  ; Security options<br />
  allow_file_group_writeable=false<br />
  allow_file_others_writeable=false<br />
  allow_directory_group_writeable=false<br />
  allow_directory_others_writeable=false<br />
  ;Check wheter script is within DOCUMENT_ROOT<br />
  check_vhost_docroot=false<br />
  ;Send minor error messages to browser<br />
  errors_to_browser=true<br />
  [handlers]<br />
  ;Handler for php-scripts<br />
  ;x-httpd-php=php:/usr/bin/php<br />
  x-httpd-php=&quot;php:/usr/bin/php-cgi&quot;<br />
  ;Handler for CGI-scripts<br />
x-suphp-cgi=execute:!self</p>
<p>/etc/httpd/conf.d/su.php</p>
<p class="code"># This is the Apache server configuration file providing suPHP support.<br />
  # It contains the configuration directives to instruct the server how to<br />
  # serve php pages while switching to the user context before rendering.<br />
  LoadModule suphp_module modules/mod_suphp.so<br />
  # This option tells mod_suphp if a PHP-script requested on this server (or<br />
  # VirtualHost) should be run with the PHP-interpreter or returned to the<br />
  # browser &quot;as it is&quot;.<br />
  #suPHP_Engine on<br />
  # Disable php when suphp is used, to avoid having both.<br />
  #&lt;IfModule mod_php5.c&gt;<br />
  #php_admin_flag engine off<br />
  #&lt;/IfModule&gt;<br />
  #&lt;IfModule mod_php4.c&gt;<br />
  #php_admin_flag engine off<br />
  #&lt;/IfModule&gt;<br />
  # To use suPHP to parse PHP-Files<br />
  #AddHandler x-httpd-php .php<br />
  #AddHandler x-httpd-php .php .php4 .php3 .phtml<br />
  # This option tells mod_suphp which path to pass on to the PHP-interpreter<br />
  # (by setting the PHPRC environment variable).<br />
  # Do *NOT* refer to a file but to the directory the file resides in.<br />
  #<br />
  # E.g.: If you want to use &quot;/path/to/server/config/php.ini&quot;, use &quot;suPHP_Config<br />
  # /path/to/server/config&quot;.<br />
  #<br />
  # If you don&#8217;t use this option, PHP will use its compiled in default path.<br />
  # suPHP_ConfigPath /etc<br />
  # If you compiled suphp with setid-mode &quot;force&quot; or &quot;paranoid&quot;, you can<br />
  # specify the user- and groupname to run PHP-scripts with.<br />
  # Example: suPHP_UserGroup foouser bargroup<br />
  # suPHP_UserGroup apache apache<br />
  # This option tells mod_suphp to handle requests with the type &lt;mime-type&gt;.<br />
  # Please note this only works, if an action for the handler is specified<br />
  # in the suPHP configuration file.<br />
  #suPHP_AddHandler x-httpd-php<br />
  # This option tells mod_suphp to NOT handle requests with the type &lt;mime-type&gt;.<br />
# suPHP_RemoveHandler &lt;mime-type&gt;</p>
<p>Usege example</p>
<p class="code">&lt;VirtualHost 192.168.1.10:80&gt;<br />
  SuexecUserGroup &quot;#500&quot; &quot;#500&quot;<br />
  ServerName example.com<br />
  ServerAlias www.example.com<br />
  DocumentRoot /home/example.com/public_html<br />
  suPHP_Engine on<br />
  AddHandler x-httpd-php .php<br />
  AddHandler x-httpd-php .php .php4 .php3 .phtml<br />
  suPHP_AddHandler x-httpd-php<br />
  suPHP_UserGroup example.com example.com<br />
  &lt;Directory /home/example.com/public_html&gt;<br />
  allow from all<br />
  &lt;/Directory&gt;<br />
  DirectoryIndex index.htm index.html index.php<br />
  &lt;/VirtualHost&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/11/mod_php-and-suphp-at-same-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>suPHP parents directory is not own by defined user or root</title>
		<link>http://takahisa.info/2010/03/11/suphp-parents-directory-is-not-own-by-defined-user-or-root/</link>
		<comments>http://takahisa.info/2010/03/11/suphp-parents-directory-is-not-own-by-defined-user-or-root/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:11:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=242</guid>
		<description><![CDATA[root at server1:/root/suPHP/suphp-0.6.3/src# diff -u ./Application.cpp ./Application.cpp-dist &#8212; ./Application.cpp 2008-04-24 15:21:20.000000000 -0700 +++ ./Application.cpp-dist 2008-03-30 04:43:38.000000000 -0700 @@ -492,14 +492,12 @@ directory = directory.getParentDirectory(); UserInfo directoryOwner = directory.getUser(); -#ifndef OPT_USERGROUP_OWNER if (directoryOwner != owner &#038;&#038; !directoryOwner.isSuperUser()) { std::string error = &#8220;Directory &#8221; + directory.getPath() + &#8221; is not owned by &#8221; + owner.getUsername(); logger.logWarning(error); throw [...]]]></description>
			<content:encoded><![CDATA[<p>root at server1:/root/suPHP/suphp-0.6.3/src# diff -u ./Application.cpp<br />
./Application.cpp-dist<br />
&#8212; ./Application.cpp   2008-04-24 15:21:20.000000000 -0700<br />
+++ ./Application.cpp-dist      2008-03-30 04:43:38.000000000 -0700<br />
@@ -492,14 +492,12 @@<br />
         directory = directory.getParentDirectory();</p>
<p>         UserInfo directoryOwner = directory.getUser();<br />
-#ifndef OPT_USERGROUP_OWNER<br />
         if (directoryOwner != owner &#038;&#038; !directoryOwner.isSuperUser()) {<br />
             std::string error = &#8220;Directory &#8221; + directory.getPath()<br />
                 + &#8221; is not owned by &#8221; + owner.getUsername();<br />
             logger.logWarning(error);<br />
             throw SoftException(error, __FILE__, __LINE__);<br />
         }<br />
-#endif</p>
<p>         if (!directory.isSymlink()<br />
             &#038;&#038; !config.getAllowDirectoryGroupWriteable()</p>
<p>Originally found at https://lists.marsching.com/pipermail/suphp/2008-April/001831.html</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/11/suphp-parents-directory-is-not-own-by-defined-user-or-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install SSL certificate on postfix and dovecot</title>
		<link>http://takahisa.info/2010/03/11/install-ssl-certificate-on-postfix-and-dovecot/</link>
		<comments>http://takahisa.info/2010/03/11/install-ssl-certificate-on-postfix-and-dovecot/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:07:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=238</guid>
		<description><![CDATA[Make key file #openssl genrsa -des3 -out example.com.key 1024 Generating RSA private key, 1024 bit long modulus &#8230;&#8230;&#8230;&#8230;..++++++ ..++++++ e is 65537 (0&#215;10001) Enter pass phrase for example.com.key: Verifying &#8211; Enter pass phrase for example.com.key: # openssl req -new -key example.com.key -out example.com.csr Enter pass phrase for example.com.key: Country Name (2 letter code) [AU]: State [...]]]></description>
			<content:encoded><![CDATA[<p>Make key file</p>
<p class="code">#openssl genrsa -des3 -out example.com.key 1024<br />
  Generating RSA private key, 1024 bit long modulus<br />
  &#8230;&#8230;&#8230;&#8230;..++++++<br />
  ..++++++<br />
  e is 65537 (0&#215;10001)<br />
  Enter pass phrase for example.com.key:<br />
  Verifying &#8211; Enter pass phrase for example.com.key:<br />
  # openssl req -new -key example.com.key -out example.com.csr<br />
  Enter pass phrase for example.com.key:<br />
  Country Name (2 letter code) [AU]:<br />
  State or Province Name (full name) [Some-State]:<br />
  Locality Name (eg, city) []:<br />
  Organization Name (eg, company) [Internet Widgits Pty Ltd]:<br />
  Organizational Unit Name (eg, section) []:<br />
  Common Name (eg, YOUR name) []:<br />
  Email Address []:<br />
  A challenge password []:<br />
  An optional company name []:</p>
<p>Get CRT (GeoTrust, verisign etc)</p>
<p>Remove pass phrase</p>
<p class="code">  #openssl rsa -in example.com.key -out example.com.pem</p>
<p>edit /etc/postfix/main.cf</p>
<p class="code">smtpd_use_tls = yes<br />
  smtpd_tls_session_cache_timeout = 3600s<br />
  smtpd_tls_key_file = /etc/pki/tls/certs/example.com.pem<br />
  smtpd_tls_cert_file = /etc/pki/tls/certs/example.com.crt</p>
<p>edit /etc/dovecot.conf</p>
<p class="code">ssl_disable = no<br />
  ssl_cert_file = /etc/pki/tls/certs/example.com.crt<br />
  ssl_key_file = /etc/pki/tls/certs/example.com.pem</p>
<p>restart postfix and dovecot</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/11/install-ssl-certificate-on-postfix-and-dovecot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reinstall yum package</title>
		<link>http://takahisa.info/2009/06/10/reinstall-yum-package/</link>
		<comments>http://takahisa.info/2009/06/10/reinstall-yum-package/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 04:27:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=232</guid>
		<description><![CDATA[as you might know, yum does not provide re-install functionality, for re-installing yum installed application following methods may useful yum install yum-utils yumdownloader package rpm -Uvh &#8211;force downloadedpackages]]></description>
			<content:encoded><![CDATA[<p>as you might know, yum does not provide re-install functionality,</p>
<p>for re-installing yum installed application following methods may useful</p>
<p class="code"> yum install yum-utils<br />
  yumdownloader package<br />
  rpm -Uvh &#8211;force downloadedpackages</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2009/06/10/reinstall-yum-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>adding a startup script ubuntu</title>
		<link>http://takahisa.info/2009/03/14/adding-a-startup-script-ubuntu/</link>
		<comments>http://takahisa.info/2009/03/14/adding-a-startup-script-ubuntu/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 01:28:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=221</guid>
		<description><![CDATA[update-rc.d foo defaults you also need script be executable chmod +x foo]]></description>
			<content:encoded><![CDATA[<p>update-rc.d foo defaults</p>
<p>you also need script be executable<br />
chmod +x foo</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2009/03/14/adding-a-startup-script-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

