<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[apache2: bad user name ${APACHE_RUN_USER} 解决,树莓派raspberry Pi下的apache2也有这个问题，由apachectl来启动。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Web服务器]]></category>
<pubDate>Tue, 12 May 2015 15:42:47 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：用树莓派修改进程数后，想重启后出现问题及解决。<br/><br/> apache2: bad user name $&#123;APACHE_RUN_USER&#125; 解决<br/><br/>开工后，发现有个虚拟机的apache没起来，调用apache2 -k start 后，提示如下内容：<br/><br/>apache2: bad user name $&#123;APACHE_RUN_USER&#125; <br/><br/> <br/><br/>apache 启动时，是由读取 /etc/apache2/apache2.conf 读取了运行 User<br/><br/>而运行的user环境变量定义在/etc/apache2/envvars <br/><br/>而不是使用默认的登录账户启动，因此apache提供了<br/>apache2ctl 工具来使用，调用<br/><br/>apache2ctl -k start <br/><br/>即可<br/>______________________________________________________________________________________<br/><br/>pkill -9 apache<br/>/usr/sbin/apache2 -k start<br/>apache2: bad user name $&#123;APACHE_RUN_USER&#125;<br/>/usr/sbin/apachectl -k start <br/>apache2: Could not reliably determine the server&#039;s fully qualified domain name, using 127.0.1.1 for ServerName<br/>启动成功！<br/><br/><br/>vi +178 /etc/apache2/apache2.conf<br/># These need to be set in /etc/apache2/envvars<br/>User $&#123;APACHE_RUN_USER&#125;<br/>Group $&#123;APACHE_RUN_GROUP&#125;<br/><br/><br/>root@raspberrypi:/var/lock# /usr/sbin/apache2ctl -k start <br/>Syntax error on line 178 of /etc/apache2/apache2.conf:<br/>Error:&#92;tApache has not been designed to serve pages while&#92;n&#92;trunning as root.&nbsp;&nbsp;There are known race conditions that&#92;n&#92;twill allow any local user to read any file on the system.&#92;n&#92;tIf you still desire to serve pages as root then&#92;n&#92;tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable&#92;n&#92;tand then rebuild the server.&#92;n&#92;tIt is strongly suggested that you instead modify the User&#92;n&#92;tdirective in your httpd.conf file to list a non-root&#92;n&#92;tuser.&#92;n<br/>Action &#039;-k start&#039; failed.<br/><br/>ls -lart /var/lock/apache2 <br/>total 0<br/>drwxr-xr-x 2 root root 40 Aug 18 07:26 .<br/>drwxrwxrwt 3 root root 60 Aug 18 07:26 ..<br/><br/><br/> useradd -m www //它将创建用户的主目录即使不存在，不创建用户主目录<br/><br/> vi&nbsp;&nbsp;/etc/apache2/envvars<br/>export APACHE_RUN_USER=www<br/>export APACHE_RUN_GROUP=www<br/><br/>成功了：<br/>root@raspberrypi:/var/lock# /usr/sbin/apache2ctl -k start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>apache2: Could not reliably determine the server&#039;s fully qualified domain name, using 127.0.1.1 for ServerName<br/><br/>root@raspberrypi:/var/lock# ls -lart<br/>drwxr-xr-x&nbsp;&nbsp;2 www&nbsp;&nbsp;root&nbsp;&nbsp;40 Aug 18 07:33 apache2<br/><br/><br/>调用apache2 -k start 后，提示如下内容：<br/><br/>apache2: bad user name $&#123;APACHE_RUN_USER&#125;&nbsp;&nbsp;<br/><br/>apache 启动时，是由读取 /etc/apache2/apache2.conf 读取了运行 User<br/><br/>而运行的user环境变量定义在/etc/apache2/envvars <br/><br/>而不是使用默认的登录账户启动，因此apache提供了<br/>apache2ctl 工具来使用，调用<br/><br/>apache2ctl -k start <br/><br/>即可~<br/><br/>来自：http://www.cnblogs.com/amaoxiaozhu/p/4311201.html<br/><br/>root@raspberrypi:/# find . -name apache2ctl<br/>/usr/sbin/apache2ctl l -k restart <br/><br/> /usr/sbin/apache2ctl -k restart&nbsp;&nbsp; <br/>apache2: Could not reliably determine the server&#039;s fully qualified domain name, using 127.0.1.1 for ServerName
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] apache2: bad user name ${APACHE_RUN_USER} 解决,树莓派raspberry Pi下的apache2也有这个问题，由apachectl来启动。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>