<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>想当摄影师的程序员 &#187; apache</title>
	<atom:link href="http://blog.iworm.net/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.iworm.net</link>
	<description>争取不惑之年成为一名自由摄影师</description>
	<lastBuildDate>Tue, 10 Jan 2012 04:09:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.5/cn/</creativeCommons:license>
		<item>
		<title>Apache访问home目录错误的解决办法</title>
		<link>http://blog.iworm.net/2011/03/13/apache%e8%ae%bf%e9%97%aehome%e7%9b%ae%e5%bd%95%e9%94%99%e8%af%af%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95/</link>
		<comments>http://blog.iworm.net/2011/03/13/apache%e8%ae%bf%e9%97%aehome%e7%9b%ae%e5%bd%95%e9%94%99%e8%af%af%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 10:49:53 +0000</pubDate>
		<dc:creator>iworm</dc:creator>
				<category><![CDATA[操作系统]]></category>
		<category><![CDATA[403]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.iworm.net/?p=789</guid>
		<description><![CDATA[一些废话。。。 最近把台式机的系统由XP换成了Fedora，想看看它跟Ubuntu有哪里不一样。 大致看下来，就是少数几个配置文件存放的地方不一样，比如Ubuntu/Debian里apache就叫apache，而在Fedora里叫httpd这个更通用的名字。 Ubuntu/Debian配置文件在/etc/apache/而Fedora在/etc/httpd里。 还有就是yum和apt-get的区别了。yum可真够慢的，而且有些依赖还解决不了，需要人肉解决。 安装Apache+PHP+MySQL也不麻烦，一个yum就搞定。 背景描述 因为我会开发一些web程序，这些程序都在/home/roger下，所以我需要将/var/www/html变成符号链接（Symbolic Link），这样切换项目的时候很方便，直接把需要的项目引用改名成html即可。 比如： cgi-bin error html icons proj_a proj_b proj_c proj_d SELinux关闭之前 但是我发现启动Apache的时候会报一个错误：意思是主目录不能是个链接目录。搜索了一下，发现是SELinux的问题，把SELinux关闭即可。可以google一下如何关闭。 SELinux关闭之后 现在Apache服务起来了，但是访问http://localhost会报403错误。Apache的error_log为： [Sun Mar 06 12:50:14 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/html &#8230; <a href="http://blog.iworm.net/2011/03/13/apache%e8%ae%bf%e9%97%aehome%e7%9b%ae%e5%bd%95%e9%94%99%e8%af%af%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>一些废话。。。</strong></p>
<p style="padding-left: 30px;"><span style="color: #808080;">最近把台式机的系统由XP换成了Fedora，想看看它跟Ubuntu有哪里不一样。</span><br />
<span style="color: #808080;"> 大致看下来，就是少数几个配置文件存放的地方不一样，比如Ubuntu/Debian里apache就叫apache，而在Fedora里叫httpd这个更通用的名字。</span><br />
<span style="color: #808080;"> Ubuntu/Debian配置文件在/etc/apache/而Fedora在/etc/httpd里。</span><br />
<span style="color: #808080;"> 还有就是yum和apt-get的区别了。yum可真够慢的，而且有些依赖还解决不了，需要人肉解决。</span></p>
<p style="padding-left: 30px;"><span style="color: #808080;">安装Apache+PHP+MySQL也不麻烦，一个yum就搞定。</span></p>
<p><strong>背景描述</strong></p>
<p>因为我会开发一些web程序，这些程序都在/home/roger下，所以我需要将/var/www/html变成符号链接（Symbolic Link），这样切换项目的时候很方便，直接把需要的项目引用改名成html即可。</p>
<p>比如：</p>
<blockquote><p><span style="color: #3366ff;">cgi-bin  error</span> <span style="color: #00ffff;"> html</span> <span style="color: #3366ff;"> icons</span> <span style="color: #00ffff;"> proj_a  proj_b  proj_c  proj_d</span></p></blockquote>
<p><strong>SELinux关闭之前</strong></p>
<p>但是我发现启动Apache的时候会报一个错误：意思是主目录不能是个链接目录。搜索了一下，发现是SELinux的问题，把SELinux关闭即可。可以google一下如何关闭。</p>
<p><strong>SELinux关闭之后</strong></p>
<p>现在Apache服务起来了，但是访问http://localhost会报403错误。Apache的error_log为：<br />
[Sun Mar 06 12:50:14 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/html</p>
<p><strong>初步判断</strong></p>
<p>一看是符号链接问题，我就开始尝试去掉符号链接，在/var/www/建立一个叫html的目录，发现错误消失了，感觉像是权限问题。但是我已经把需要apache访问的这些文件权限设置到777了，还是不行。</p>
<p><strong>进一步尝试</strong></p>
<p>接下来一步步做排除，首先把主目录设置到了用户目录下，还是报403错误，一查日志，发现错误描述变为：<br />
[Sun Mar 13 10:08:10 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /website/sina.php denied</p>
<p>错误号13表示文件系统的权限不正确，由于我对linux也是个半瓶醋，所以继续google。</p>
<p><strong>转机</strong></p>
<p>找到一个人说用namei -m /home/roger/website/sina.php查看每一级目录的权限。</p>
<pre style="font-family:courier new;font-size:12px">dr-xr-xr-x /
drwxr-xr-x home
drwx------ roger
drwxrwxr-x website
-rw-r--r-- sina.php</pre>
<p>哈哈，看到问题了吧，是roger这个目录对非owner都没权限，改一下这个目录的权限为711即可。</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.iworm.net%2F2011%2F03%2F13%2Fapache%25e8%25ae%25bf%25e9%2597%25aehome%25e7%259b%25ae%25e5%25bd%2595%25e9%2594%2599%25e8%25af%25af%25e7%259a%2584%25e8%25a7%25a3%25e5%2586%25b3%25e5%258a%259e%25e6%25b3%2595%2F&amp;title=Apache%E8%AE%BF%E9%97%AEhome%E7%9B%AE%E5%BD%95%E9%94%99%E8%AF%AF%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95" id="wpa2a_2"><img src="http://blog.iworm.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.iworm.net/2011/03/13/apache%e8%ae%bf%e9%97%aehome%e7%9b%ae%e5%bd%95%e9%94%99%e8%af%af%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.5/cn/</creativeCommons:license>
	</item>
		<item>
		<title>Ubuntu中完全删除Apache2的办法</title>
		<link>http://blog.iworm.net/2007/12/26/ubuntu%e4%b8%ad%e5%ae%8c%e5%85%a8%e5%88%a0%e9%99%a4apache2%e7%9a%84%e5%8a%9e%e6%b3%95/</link>
		<comments>http://blog.iworm.net/2007/12/26/ubuntu%e4%b8%ad%e5%ae%8c%e5%85%a8%e5%88%a0%e9%99%a4apache2%e7%9a%84%e5%8a%9e%e6%b3%95/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 16:14:41 +0000</pubDate>
		<dc:creator>iworm</dc:creator>
				<category><![CDATA[操作系统]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[XAMPP]]></category>

		<guid isPermaLink="false">http://iworm.net/2007/12/26/ubuntu%e4%b8%ad%e5%ae%8c%e5%85%a8%e5%88%a0%e9%99%a4apache2%e7%9a%84%e5%8a%9e%e6%b3%95/</guid>
		<description><![CDATA[Ubuntu安装Apache2很简单，只需要sudo apt-get install apache2 但是我使用sudo apt-get remove apache2之后，说只能释放零点几k的空间，而且删除之后仍然能访问到apache服务器，可见没删掉。 后来我看到apt-get 还有个参数是autoremove，即sudo apt-get autoremove 这下就删掉了，释放了37M空间。 自己安装LAMP麻烦，推荐安装XAMPP，装好之后LAMP都有了，而且PHP还带有很多常用的库，Apache也是带SSL的，还有FTP服务。]]></description>
			<content:encoded><![CDATA[<p>Ubuntu安装Apache2很简单，只需要sudo apt-get install apache2</p>
<p>但是我使用sudo apt-get remove apache2之后，说只能释放零点几k的空间，而且删除之后仍然能访问到apache服务器，可见没删掉。</p>
<p>后来我看到apt-get 还有个参数是autoremove，即sudo apt-get autoremove</p>
<p>这下就删掉了，释放了37M空间。</p>
<p>自己安装LAMP麻烦，推荐安装<a href="http://www.apachefriends.org/en/xampp.html" target="_blank">XAMPP</a>，装好之后LAMP都有了，而且PHP还带有很多常用的库，Apache也是带SSL的，还有FTP服务。</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.iworm.net%2F2007%2F12%2F26%2Fubuntu%25e4%25b8%25ad%25e5%25ae%258c%25e5%2585%25a8%25e5%2588%25a0%25e9%2599%25a4apache2%25e7%259a%2584%25e5%258a%259e%25e6%25b3%2595%2F&amp;title=Ubuntu%E4%B8%AD%E5%AE%8C%E5%85%A8%E5%88%A0%E9%99%A4Apache2%E7%9A%84%E5%8A%9E%E6%B3%95" id="wpa2a_4"><img src="http://blog.iworm.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.iworm.net/2007/12/26/ubuntu%e4%b8%ad%e5%ae%8c%e5%85%a8%e5%88%a0%e9%99%a4apache2%e7%9a%84%e5%8a%9e%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.5/cn/</creativeCommons:license>
	</item>
	</channel>
</rss>

