You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ravindranath M <ra...@comviva.com> on 2012/01/16 07:57:01 UTC

[users@httpd] What is the "correct way" for starting apache2 as a service in UNIX (Ubuntu)

Dear Apache team and other friends,

According to official Apache documentation, the correct way to start httpd is to use apachectl.  When I start this way it works.  Since I am using Ubuntu, I run it with "sudo"  prefix.  As a result it starts with root user's privileges.

But for another software module (Reviewboard), which is supposed to use apache web service, this is causing problems with respect to some file permissions.  When posted to their forum, they advised me to use the following command to start apache.

sudo service apache2 start|stop|restart

But the above command gives me errors, as below:

-----begin-quote-------
rvnath@rvnath:~$ sudo service apache2 restart
/usr/sbin/apache2: symbol lookup error: /usr/sbin/apache2: undefined symbol: apr_os_uuid_get
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!
-----end-quote-------

Searching through various forums and groups didn't help me much either.

My question is:

1.       What is the right way to start apache as a daemon service in UNIX (Ubuntu)?

2.       Finally, when httpd is run, does it run as "www-data" user, or some other user.  When I did a process grep (ps -ef | grep httpd), it shows me that it runs with a user name called "daemon" instead of www-data).  So, is it correct to say that apache runs as a "daemon" user and NOT www-data as claimed by Reviewboard forums?

Regards,
RV

This e-mail and all material transmitted with it are for the use of the intended recipient(s) ONLY and contains confidential and/or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken pursuant to the contents of the present e-mail is strictly prohibited and is unlawful. The recipient acknowledges that Comviva Technologies Limited or its management or directors, are unable to exercise control or ensure the integrity over /of the contents of the information contained in e-mail. Any views expressed herein are those of the individual sender only and no binding nature of the contents shall be implied or assumed unless the sender does so expressly with due authority of Comviva Technologies Limited. E-mail and any contents transmitted with it are prone to viruses and related defects despite all efforts to avoid such by Comviva Technologies Limited.

Re: [users@httpd] What is the "correct way" for starting apache2 as a service in UNIX (Ubuntu)

Posted by Igor Cicimov <ic...@gmail.com>.
It runs under the user and group that you have set in the User and Group
directives in your apache config file. It always starts as root and then
drops the privileges to that user no matter how you start it. Obviously
your User and Group are set to "daemon" in your config.

Igor
On Jan 16, 2012 6:59 PM, "Roel Wagenaar" <ro...@wagenaar.nu> wrote:

> "Ravindranath  M" <ra...@comviva.com> wrote:
>
> >     Dear Apache team and other friends,
> >
> >     According to official Apache documentation, the correct way to start
> httpd
> is to use apachectl.  When I start this way it works.  Since I am using
> Ubuntu,
> I run it with "sudo"  prefix.  As a result it starts with root user's
> privileges.
> >
> >     But for another software module (Reviewboard), which is supposed to
> use
> apache web service, this is causing problems with respect to some file
> permissions.  When posted to their forum, they advised me to use the
> following
> command to start apache.
> >
> >     sudo service apache2 start|stop|restart
> >
> >     But the above command gives me errors, as below:
> >
> >     -----begin-quote-------
> >     rvnath@rvnath:~$ sudo service apache2 restart
> >     /usr/sbin/apache2: symbol lookup error: /usr/sbin/apache2: undefined
> symbol: apr_os_uuid_get
> >     Action 'configtest' failed.
> >     The Apache error log may have more information.
> >        ...fail!
> >     -----end-quote-------
> >
> >     Searching through various forums and groups didn't help me much
> either.
> >
> >     My question is:
> >
> >     1.       What is the right way to start apache as a daemon service
> in UNIX
> (Ubuntu)?
> >
> >     2.       Finally, when httpd is run, does it run as "www-data" user,
> or
> some other user.  When I did a process grep (ps -ef | grep httpd), it
> shows me
> that it runs with a user name called "daemon" instead of www-data).  So,
> is it
> correct to say that apache runs as a "daemon" user and NOT www-data as
> claimed
> by Reviewboard forums?
> >
>
>
> Ubuntu is based on Debian, the proper way to start/stop the daemon is by
> using
> the script:
>
>  /etc/init.d/apache2
>
> {start|stop|graceful-stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean|status}
>
> The script will take care of the proper user/group for the daemon to start
> with.
>
>
> --
> Roel Wagenaar,
> Linux-User #469851 with the Linux Counter; http://linuxcounter.net/
>
> Men are proof that women can take a joke.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] What is the "correct way" for starting apache2 as a service in UNIX (Ubuntu)

Posted by Roel Wagenaar <ro...@wagenaar.nu>.
"Ravindranath  M" <ra...@comviva.com> wrote:

>     Dear Apache team and other friends,
>     
>     According to official Apache documentation, the correct way to start httpd
is to use apachectl.  When I start this way it works.  Since I am using Ubuntu,
I run it with "sudo"  prefix.  As a result it starts with root user's
privileges.
>     
>     But for another software module (Reviewboard), which is supposed to use
apache web service, this is causing problems with respect to some file
permissions.  When posted to their forum, they advised me to use the following
command to start apache.
>     
>     sudo service apache2 start|stop|restart
>     
>     But the above command gives me errors, as below:
>     
>     -----begin-quote-------
>     rvnath@rvnath:~$ sudo service apache2 restart
>     /usr/sbin/apache2: symbol lookup error: /usr/sbin/apache2: undefined
symbol: apr_os_uuid_get
>     Action 'configtest' failed.
>     The Apache error log may have more information.
>        ...fail!
>     -----end-quote-------
>     
>     Searching through various forums and groups didn't help me much either.
>     
>     My question is:
>     
>     1.       What is the right way to start apache as a daemon service in UNIX
(Ubuntu)?
>     
>     2.       Finally, when httpd is run, does it run as "www-data" user, or
some other user.  When I did a process grep (ps -ef | grep httpd), it shows me
that it runs with a user name called "daemon" instead of www-data).  So, is it
correct to say that apache runs as a "daemon" user and NOT www-data as claimed
by Reviewboard forums?
>     


Ubuntu is based on Debian, the proper way to start/stop the daemon is by using
the script: 

 /etc/init.d/apache2
{start|stop|graceful-stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean|status}

The script will take care of the proper user/group for the daemon to start with.


-- 
Roel Wagenaar,
Linux-User #469851 with the Linux Counter; http://linuxcounter.net/

Men are proof that women can take a joke.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org