Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: apache2: bad user name ${APACHE_RUN_USER}

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Beans
    5

    apache2: bad user name ${APACHE_RUN_USER}

    I am having this problem both on Ubuntu server 8.04 with LAMP, and ubuntu destkop 8.04 with Apache2. I am not having the problem with Debian4 on the same PC.

    I just installed a fresh copy of ubuntu server 8.04 on my pc, with LAMP and Samba enabled. Now it seems to work, but whenever i try to restart apache i get this error:
    Code:
    jeroen@jeroen-desktop:/etc/apache2$ apache2 -k restart
    apache2: bad user name ${APACHE_RUN_USER}
    .
    The APACHE_RUN_USER var correctly refers to www-data in my /envvars file (i didnt touch that file or anything).
    If you google this error, you get the advice to replace the 'User' and 'Group' variable in the config file by:
    User www-data
    Group www-data

    However, when i do this, i get these errors:
    Code:
    jeroen@jeroen-desktop:/etc/apache2$ apache2 -k restart
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    httpd not running, trying to start
    (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    There are probably also ways to fix that, but why doesnt it work out of the box, like it should? What did i do wrong? Is there an easy way to fix this?
    Last edited by jeroenisblij; May 23rd, 2008 at 09:57 AM.

  2. #2
    Join Date
    Dec 2005
    Location
    The Netherlands
    Beans
    682
    Distro
    Ubuntu Development Release

    Re: apache2: bad user name ${APACHE_RUN_USER}

    The cause of the problem is that user and group are pulled from environment.

    # These need to be set in /etc/apache2/envvars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}

    To fix this problem, You can statically define user and group in your apache.conf

    User www-data
    Group www-data
    Hello, all my posts come without warranty

  3. #3
    Join Date
    Jul 2007
    Beans
    5

    Re: apache2: bad user name ${APACHE_RUN_USER}

    i tried to explain in my post that i get other errors when i do that. Why are user and group not on my environment? How can i add them?
    Last edited by jeroenisblij; May 23rd, 2008 at 10:14 AM.

  4. #4
    Join Date
    May 2008
    Beans
    3

    Re: apache2: bad user name ${APACHE_RUN_USER}

    I believe this is caused by tryint to run apache with the wrong command.
    try "sudo /etc/init.d/apache2 restart" or start, or whatever you are trying to do. This should read in the environment variables correctly with the "out of the box" installation.

  5. #5
    Join Date
    Jun 2007
    Beans
    4

    Re: apache2: bad user name ${APACHE_RUN_USER}

    Hey that helped, I wonder why that helped, and not when I: cd /etc/init.d/ and then typed: apache2 restart ?,

  6. #6
    Join Date
    Apr 2006
    Beans
    24
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: apache2: bad user name ${APACHE_RUN_USER}

    Quote Originally Posted by AllanJP View Post
    Hey that helped, I wonder why that helped, and not when I: cd /etc/init.d/ and then typed: apache2 restart ?,
    AllanJP, the difference is the sudo. Apache2 needs to be restarted by the superuser, not just a normal account. That's the only difference between what you were doing and what jkobbe suggested.

    For whatever reason, the command doesn't return the normal "Permission denied" message. Weird, huh?

  7. #7
    Join Date
    May 2008
    Beans
    3

    Re: apache2: bad user name ${APACHE_RUN_USER}

    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 ..."

  8. #8
    Join Date
    Dec 2007
    Location
    CDO, Philippines
    Beans
    368
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: apache2: bad user name ${APACHE_RUN_USER}

    hi i have a problem similar to the OP. but mine is:

    when i restart apache i get this:

    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    (98 )Address already in use: make_sock: could not bind to address 0.0.0.0:443
    no listening sockets available, shutting down
    Unable to open logs
    i think this has something to do with my server name, right? should i change it?how?
    i'm sorry this is my first time setting up a server..

  9. #9
    Join Date
    Jun 2006
    Beans
    16

    Re: apache2: bad user name ${APACHE_RUN_USER}

    ISPConfig-2.2.23.tar.gz solves the problem in Ubuntu 8.04 LTS

    $ wget -c http://nchc.dl.sourceforge.net/sourc...-2.2.23.tar.gz

  10. #10
    Join Date
    Dec 2006
    Beans
    3

    Re: apache2: bad user name ${APACHE_RUN_USER}

    Quote Originally Posted by adredz View Post
    hi i have a problem similar to the OP. but mine is:

    when i restart apache i get this:


    i think this has something to do with my server name, right? should i change it?how?
    i'm sorry this is my first time setting up a server..
    You need to define your ServerName in /etc/apache2/apache2.conf, e.g


    ServerName "www.myDomain.com"

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •