"...try "sudo /etc/init.d/apache2 restart"..."
Thanks! I had the same problem, but everything's OK now. I agree that values should be read from envvars.
"...try "sudo /etc/init.d/apache2 restart"..."
Thanks! I had the same problem, but everything's OK now. I agree that values should be read from envvars.
You may still need to run sudo apache2 directly if you need certain command line options, for example you need "sudo apache -t" to check the syntax of a conf that references SSL certificates.
In that case just prefix the command with the variables like this:
sudo APACHE_RUN_USER=www-data APACHE_RUN_GROUP=www-data apache2 -t
/etc/init.d/apache2 is great if you want to do any of the following:
- start
- stop
- restart
- reload
- force-reload
- start-htcacheclean
- stop-htcacheclean
- status
But if you need to run apache2 with arguments (for example "apache2 -S" for checking your virtualhost settings) you could prefix the command like Fjan suggested above but I think it's easier to use the apache2ctl command like this:
# apache2ctl -S
You are right, that is much more convenient than setting the environment vars by hand. Thanks.apache2ctl -S
ServerName "www.myDomain.com"
or
ServerName localhost
worked fine for me.
thank to all
Also just for the record and in case some one else has the same problem as I did with ${APACHE_RUN_USER} error:
I installed Plone and then it required for me to have sec. certs.
I could not run apache2 -k start no matter what. So I went in the /etc/apache2/sites-enabled and removed that plone.conf (Or any other conf file that generates the error) Remember renaming the conf file in that directory will Not help as long as it's in there it will be read.
I moved the bad.conf file to my home directory and apache started to run again?!
The running of apache from /etc/init.d plus --force-reload switched helped me to figure out which file was responsible.
So thanks to all who helped.
Probably because you should have done "./apache2 restart" instead of "apache2 restart", as well as sudo as others have pointed out. Without the "./", the computer uses the environment variables to look for an executable by that name. If you use "./", the directory you are currently browsing is used to look for that executable.
I was trying to figure if mod_rewrite is loaded, when I run:
I get the same error:Code:sudo apache2 -M
apache2: bad user name ${APACHE_RUN_USER}
tried restarting apache:
but still the same, but using:Code:sudo /etc/init.d/apache2 restart
I got it to work!Code:apache2ctl -M
I'll check later for solution, thought it may help someone.
hello ,
when i connect to htt://localhost/ or http://127.0.0.1/ (with original config file) ,it doesn't works !
because "bad user name ${APACHE_RUN_USER}" ,you know that !
After :
- apache2 restart
- and try http://127.0.1.1/ , it works !
Bookmarks