Setting up user permissions for new user

225

Solution 1

For the nginx conf file, simply make it group writable:

chgrp webusers /webservers/nginx/conf/nginx.conf
chmod 664 /webservers/nginx/conf/nginx.conf

To allow the webusers group to restart the service, it'll be easiest to do this with sudo. If it's not installed, install with (as root):

yum install sudo

Then edit /etc/sudoers with:

visudo

Add some entries like:

Cmnd_Alias NGINX=/sbin/service nginx restart
%webusers ALL = NGINX

This will allow members of the webusers group to run the command sudo service nginx restart.

For /var/www you'll need to add group write and add the setgid bit to the directory to ensure new files have group webusers:

chgrp -R webusers /var/www
chmod 2775 /var/www

Solution 2

Here is a great primer on unix permissions (and using chmod/chown/etc). It sounds like you'll want /var/www to be owned by the webusers group and with the g+s permission. You'll probably want to read up on umask and considering having these users use umask 002 for this shared directory.

/etc/init.d/nginx is going to require root permissions since it will want to bind to port 80, for that you'd use sudo. There should be tons of resources out there for setting up sudo, including the sudoers manpage.

Share:
225

Related videos on Youtube

akhil batlawala
Author by

akhil batlawala

Updated on September 18, 2022

Comments

  • akhil batlawala
    akhil batlawala almost 2 years

    I am using superslim library for sticky header view but when i use other layouts like LinearLayout or RelativeLayout in header_item.xml it will not sticky.

    But when i use single textview in header_item.xml it will work properly but i don't wonn't that.

    header_item.xml

    <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
                <TextView
                    android:id="@+id/post_user_id"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <TextView
                    android:id="@+id/text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/lightgrey"
                    android:gravity="start"
                    android:layoutDirection="locale"
                    android:padding="10dip"
                    android:textColor="@color/black"
                    android:textDirection="locale"
                    android:textSize="12sp"
                    app:slm_headerDisplay="sticky|inline"
                    app:slm_isHeader="true"
                    app:slm_section_headerMarginStart="56dip"
                    tools:text="Header Item" />
    </LinearLayout>
    

    What i need to change for sticky header with multiple view.Please help me out. I am not alter the coding of superslim library just try to add multipleview on header. but it will stay sticky when i add multiple view on it.

    • Ravi Vaghela
      Ravi Vaghela over 8 years
      can you post link of using lib and post some of code you have tried.
    • akhil batlawala
      akhil batlawala over 8 years
      github.com/TonicArtos/SuperSLiM, i am just add view on header_item.xml, nothing else
    • Ravi Vaghela
      Ravi Vaghela over 8 years
      have problem with add layout in header item?