<?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>I want to be free &#187; server</title>
	<atom:link href="http://i1t2b3.com/category/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://i1t2b3.com</link>
	<description>Any fool can make things bigger and more complex</description>
	<lastBuildDate>Wed, 28 Jul 2010 14:34:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3921</generator>
		<item>
		<title>Cannot upload a big file?</title>
		<link>http://i1t2b3.com/2010/03/25/cannot-upload-a-big-file/</link>
		<comments>http://i1t2b3.com/2010/03/25/cannot-upload-a-big-file/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 14:43:02 +0000</pubDate>
		<dc:creator>Skakunov Alexander</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://i1t2b3.com/?p=588</guid>
		<description><![CDATA[If you want to work with big files uploads (photos, videos, CSV data dumps) you might need to prepare your PHP server for this &#8212; increase the values of these variables in your php.ini: upload_max_filesize = 512M post_max_size = 512M memory_limit = 512M The same should be done if you try to upload SQL dumps [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to work with big files uploads (photos, videos, CSV data dumps) you might need to prepare your PHP server for this &mdash; increase the values of these variables in your <code>php.ini</code>:</p>
<pre><code>upload_max_filesize = 512M
post_max_size = 512M
memory_limit = 512M
</code></pre>
<p>The same should be done if you try to upload SQL dumps by phpMyAdmin and get a correspondent error message.</p>
]]></content:encoded>
			<wfw:commentRss>http://i1t2b3.com/2010/03/25/cannot-upload-a-big-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the file access permissions for files and folders</title>
		<link>http://i1t2b3.com/2009/07/09/file-access-permissions-files-n-folders/</link>
		<comments>http://i1t2b3.com/2009/07/09/file-access-permissions-files-n-folders/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 11:33:44 +0000</pubDate>
		<dc:creator>Skakunov Alexander</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://i1t2b3.com/?p=452</guid>
		<description><![CDATA[You have a web application hosted on a server and you want to set file access permissions by chmod command, different for files and folders. Why different? A folder must have &#8216;x&#8217; (access) flag: drwxr-xr-x At the same time a file shouldn&#8217;t have it (otherwise it would be executable): rw-r--r-- How can you set it [...]]]></description>
			<content:encoded><![CDATA[<p>You have a web application hosted on a server and you want to set file access permissions by <code>chmod</code> command, different for files and folders.</p>
<p>Why different? A folder must have &#8216;x&#8217; (access) flag:</p>
<pre><code>drwxr-xr-x</code></pre>
<p>At the same time a file shouldn&#8217;t have it (otherwise it would be executable):</p>
<pre><code>rw-r--r--</code></pre>
<p>How can you set it up for all nested files/folders in your application folder?</p>
<p>You can solve this task by setting common persmissions for all files and folders (step 1) and then make folders accessable (step 2), recursively:</p>
<pre><code>chmod -R 644 .
chmod -R a+X .</code></pre>
<p>But <code>chmod</code> allows you to set up only access flag for folders, you cannot set one persmission for folders and another for files. </p>
<p>Here is a script written by my collegue Anton [vojtoshik] Voitovych to solve this task.</p>
<p>Copy it and save to a file (I saved it in <code>/bin/rchmod</code> &mdash; thus it&#8217;s accessable for all users of my system):</p>
<pre><code>#!/bin/bash

files=&quot;0644&quot;;
directories=&quot;0755&quot;;

path=$1;
shift;

while getopts &quot;d:f:&quot; OPTION
do
case $OPTION in
f) files=&quot;$OPTARG&quot; ;;
d) directories=&quot;$OPTARG&quot; ;;
esac
done

if [ &quot;$path&quot; != '' ]; then
    find &quot;$path&quot; -type d ! -name &quot;.&quot; -exec chmod &quot;$directories&quot; {} \;
    find &quot;$path&quot; -type f -exec chmod &quot;$files&quot; {} \;
else
    echo &quot;Usage: rchmod &lt;path_to_directory&gt; [-d &lt;directories mode&gt;] [-f &lt;files mode&gt;]&quot;;
    echo -ne \\n;
fi</code></pre>
<p>OK, now make it executable:</p>
<pre><code>chmod 755 rchmod</code></pre>
<p>How to use it.</p>
<p>1. You are in your application folder and want to set 755 (<code>drwxr-xr-x</code>) mode for folders and 644 (<code>rw-r--r--</code>) mode for files which is the default:</p>
<pre><code>rchmod .</code></pre>
<p>2. You want to set <code>123</code> permissions only for folders in a particular folder::</p>
<pre><code>rchmod /some/path/to/folder -d 123</code></pre>
<p>3. You want to set <code>123</code> permissions for folders and <code>456</code> permission for files in a particular folder::</p>
<pre><code>rchmod /some/path/to/folder -d 123 -f 456</code></pre>
<p>Note: don&#8217;t forget that every time after that command run you should make some folders writable (<code>wp-content/uploads</code>, <code>cache</code>, <code>temp</code> &mdash; what else you have in your webapp).</p>
]]></content:encoded>
			<wfw:commentRss>http://i1t2b3.com/2009/07/09/file-access-permissions-files-n-folders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
