nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Grant Start / Stop Apache Server Permission to Normal User

This is a discussion on Grant Start / Stop Apache Server Permission to Normal User within the Web servers forums, part of the Mastering Servers category; Hi nixcraft currently i can start my Apache server as root(I installed apache as root user) I am using "service ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-27-2008, 06:29 AM
Junior Member
User
 
Join Date: Nov 2008
OS: Red Hat 4
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
tanweernoor is on a distinguished road
Default Grant Start / Stop Apache Server Permission to Normal User

Hi nixcraft
currently i can start my Apache server as root(I installed apache as root user) I am using "service httpd start" on red hat 4 as a root user to start the server, is it possible to start stop and get complete access as an user.
In other words i want to run apache as user with accesses like starting stopping and modifying httpd.conf file.
please guide

thanks
tanweer
Reply With Quote
  #2 (permalink)  
Old 11-27-2008, 11:05 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,695
Thanks: 11
Thanked 243 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Yes, it is possible to run following command as normal users using sudo (super user do) commands. You need to type following command as root user to grant permissions. Let us grant user vivek start stop and edit permissions.

Use visudo command edit to edit the config file:
Code:
visudo
Code:
vivek localhost=/sbin/service httpd start,/sbin/service httpd stop, /sbin/service httpd restart
vivek localhost=/bin/vi /etc/httpd/conf/httpd.conf
Now vivek can login as normal user. To restart httpd, vivek has to type the following command:
Code:
sudo /sbin/service httpd restart
OR to edit file
Code:
/bin/vi /etc/httpd/conf/httpd.conf
Before running a command with sudo, vivek has to supply current password.

See sudo tutorial for more info:
Allow a normal user to run commands as root under Linux / UNIX operating systems


However, I do not recommend editing file using vi as user can edit any other files too. This is may result into security issues! Just provide restart and other perms.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help

Last edited by nixcraft; 11-27-2008 at 11:11 PM.
Reply With Quote
  #3 (permalink)  
Old 11-28-2008, 10:44 AM
Junior Member
User
 
Join Date: Nov 2008
OS: Red Hat 4
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
tanweernoor is on a distinguished road
Default

thank you very much vivek for the information..
suppose I have 10 users and each user wants to start stop his own apache without disturbing other users.
is it possible to do so?
is it possible to build apache for each user?
Reply With Quote
  #4 (permalink)  
Old 12-01-2008, 04:13 AM
Junior Member
User
 
Join Date: Nov 2008
OS: Red Hat 4
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
tanweernoor is on a distinguished road
Default

Hello vivek
please let me know on this

thanks
tanweer
Reply With Quote
Reply

Tags
apache , httpd , sudo


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
process start stop on web asim.mcp CentOS / RHEL / Fedora 1 12-16-2008 12:49 PM
Failed to start the X server (your graphical user interface) zillah Linux software 1 12-24-2007 04:57 PM
Add normal user / FTP user usein NORMAL user(non-root) anilvrathod Shell scripting 0 12-07-2007 06:04 PM
start and stop service in crontab. gthian Shell scripting 7 05-31-2007 11:04 AM
start up and stop the running script mala_un Shell scripting 9 07-26-2006 07:10 AM


All times are GMT +5.5. The time now is 12:48 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38