Ubuntu - Apache2 - apache2: bad user name ${APACHE_RUN_USER}
在Ubuntu下sudo apt-get install apache2安装完Apache2以后,启动apache2的默认用户名是www-data, 属于www-data用户组
在shell中按如下输入
#apache2
会出现错误提示:
apache2: bad user name ${APACHE_RUN_USER}
解决方法:之前javaeye上有人的解决方法是直接改用户变量,apache2 启动会读取 /etc/apache2/apache2.conf 文件,里边用到了环境变量 APACHE_RUN_USER ;后者在 /etc/apache2/envars 里有定义 ,值为 www-data ,http://congfeng02.iteye.com/blog/435313 的方法是直接在 apache2.conf 的 user 那里用静态的值 www-data 。我在ubuntu 的论坛里找到了更好的方法以及发生该错误的原因 : http://ubuntuforums.org/showthread.php?t=804436 下面是这位仁兄的解释:
I believe this is because etc/init.d is not in your command path. Unlike
Windows, Linux does not look in the "current" directory for commands.
So, if you are in /etc/init.d you can type "sudo ./apache2 restart"
which will tell it to look in the current directory with the "./" The
script in /etc/init.d/apache2 explicitly reads in the environment
variables before calling /usr/sbin/apache2. /usr/sbin/ is in yoour
command path, so that is the one that runs when you just type "apache2
..."
他的意思是命令行的目录问题,具体是
-$ cd /etc/init.d/
-$ sudo apache2 -k restart 会出现错误 ,这种情况下环境变量还没有读取
-$ sudo /etc/init.d/apache2 -k restart
或者
-$ cd /etc/init.d/
-$ sudo ./apache2 -k restart 这两种命令都不会出现该错误
分享到:
相关推荐
shards-jdbc分库分表实例 dataSources: ds0: !... algorithmExpression: ds${user_id % 2} defaultTableStrategy: none: defaultKeyGenerator: type: SNOWFLAKE props: sql.show: true
气流审查Apache Airflow功能的迷你回顾快速气流命令行设置: $ python -m venv airflow_play$ source airflow_play/bin/activate$ pip install apache-airflow$ cd airflow_play/$ mkdir airflow_home$ export ...
更换ssl证书后,重启Apache失败。 查看Apache的error日志发现: 代码如下: [Fri May 20 18:07:23 2011] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration ...
Tomcat是由Apache软件基金会属下Jakarta项目开发的Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为Web服务器的一些特有功能,如Tomcat管理和控制...
Apache_Wicket_User_Guide_Reference_Documentation 英文版
支持的日志类型Apache,Nginx,Tengine,IIS支持的日志格式Apache1,$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent;2,$remote_addr - $remote_user [$time_local] "$request" $...
$ server_apache_config = '/etc/apache2/apache2.conf' ;$ apache_config_parser = new Apache_Config_Parser ( $ server_apache_config );$ apache_hosts = $ apache_config_parser -> getApacheHosts ();echo '...
Apache Sqoop Docker映像 注意:这是master分支-对于特定的Sqoop版本,请始终检查相关分支 用法 运行时,您必须在卷中提供JDBC jar: docker run -v /path/to/jdbc-jars:/jdbc -it dvoros/sqoop:latest MySQL导入...
Apache JMeter: A practical beginner's guide to automated testing and performance measurement for your websites Book Description: Learn to load-test your website, test its functional behaviour, and ...
重启apache:service httpd restart虽然重启成功,但却给出如下的提示信息:httpd: apr_sockaddr_info_get() failed for hoteelhttpd: Could not reliably determine the server’s fully qualified domain name, ...
Apache_OpenOffice_4.1.2_Linux_x86_install-rpm_zh-CN.tar.gz Apache_OpenOffice_4.1.7_Linux_x86-64_install-rpm_zh-CN.tar.gz windows安装包: Apache_OpenOffice_4.1.4_Win_x86_install_zh-CN.exe Apache_...
指示通过以下方式运行容器: docker run --rm \ -v ${DOCUMENT_ROOT}:/var/www/ \ -v ${SITES_ENABLED}:/etc/apache2/sites-enabled \ -p 80:80 \ -p 443:443 \ -e "DOMAINS=" \ -e "WEBMASTER_MAIL=" \ --name ...
适用于Apache:registered:Spark的.NET用于Apache Spark的.NET提供了用于使用C#和F#中的Apache Spark的高性能API。 借助这些.NET API,您可以访问Apache Spark最受欢迎的数据帧和SparkSQL方面,因为.NET forApache:...
为简单起见,如果您想使用pypache ,请将以下行添加到/etc/apache2/apache2.cfg : LogFormat "%h %l %u %t %r %>s %O | %{Referer}i | %{User-Agent}i" pypache 现在打开您的文件/etc/apache2/sites-enabled/...
适用于Apache:registered:Spark:trade_mark:的.NET .NET为Apache火花提供高性能的API使用从C#和F#。 使用这些.NET API,您可以访问Apache Spark最流行的Dataframe和SparkSQL方面(用于处理结构化数据),以及Spark...
2.拷贝mod_jk.conf和workers.properties文件至Apache目录的conf目录下 3.Apache目录下的conf目录的httpd.conf文件末行增加内容: include "conf/mod_jk.conf" Tomcat: 1.分别复制三个tomcat 2.配置conf/server....
复制代码 代码如下:<? function PMA_getenv($var_name) { if (isset($_SERVER[$var_name])) { return $_SERVER[$var_name];... } elseif (function_exists(‘apache_getenv’) && apache_getenv($var_name, tr
apache+Windows配置flv,mp4视频支持随意拖动 解压得到下面二个文件: mod_flvx.so mod_h264_streaming.so 把这两个文件放到,apache的modules目录中,然后查找httpd.conf这个文件,打开编辑,找到类似这样的...