Difference between revisions of "Useradd add user"

From Wiki2
(Created page with "====useradd - setting up accounts==== useradd -d/home/sitebuil sitebuil passwd sitebuil create a publichtml and set permissions [root@openeyeworld home]# chmod 711 /home/s...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
====useradd - setting up accounts====
====useradd - setting up accounts====
  useradd -d/home/sitebuil sitebuil
lastlog (lists all the users)
  passwd sitebuil
  useradd -d/home/newdir newdir (makeit <=8 char)
  passwd newdir
create a publichtml and set permissions
create a publichtml and set permissions


  [root@openeyeworld home]# chmod 711 /home/sitebuil
  cd /home
  [root@openeyeworld home]# cd sitebuil/
mkdir /newdir
  [root@openeyeworld sitebuil]# chmod ugo+rx -R public_html
chmod 711 /home/newdir
  cd /home/newdir
mkdir public_html
  chmod ugo+rx -R public_html


=====apache etc/httpd.conf setup=====
=====apache etc/httpd.conf setup=====
This is probably already done. Do this maybe if new install of server
<pre>
<pre>
<IfModule mod_userdir.c>
<IfModule mod_userdir.c>
Line 45: Line 50:
</pre>
</pre>


in sites available add and entry for new domain
in /etc/apache2/sites-available create a file with the username
 
  <VirtualHost *:80>
  <VirtualHost *:80>
   DocumentRoot /home/abvbread/public_html
   DocumentRoot /home/abvbread/public_html
Line 53: Line 59:


  cd /etc/apache2/sites-enabled
  cd /etc/apache2/sites-enabled
  ln -s ../sites-available/webeshop webeshop
  a2ensite webeshop (puts a link in sites-enabled)
  sudo /etc/init.d/apache2 restart
or do it manually - ln -s ../sites-available/webeshop webeshop
/etc/init.d/apache2 reload
  sudo /etc/init.d/apache2 restart OR apache2ctl restart

Latest revision as of 09:32, 13 March 2013

useradd - setting up accounts

lastlog (lists all the users)
useradd -d/home/newdir newdir (makeit <=8 char)
passwd newdir

create a publichtml and set permissions

cd /home
mkdir /newdir 
chmod 711 /home/newdir
cd /home/newdir
mkdir public_html
chmod ugo+rx -R public_html
apache etc/httpd.conf setup

This is probably already done. Do this maybe if new install of server

<IfModule mod_userdir.c>
	#
	# UserDir is disabled by default since it can confirm the presence
	# of a username on the system (depending on home directory
	# permissions).
	#
	#UserDir disable

	#
	# To enable requests to /~user/ to serve the user's public_html
	# directory, remove the "UserDir disable" line above, and uncomment
	# the following line instead:
	#
	UserDir public_html

</IfModule>

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
	AllowOverride FileInfo AuthConfig Limit
	Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
	<Limit GET POST OPTIONS>
		Order allow,deny
		Allow from all
	</Limit>
	<LimitExcept GET POST OPTIONS>
		Order deny,allow
		Deny from all
	</LimitExcept>
</Directory>

in /etc/apache2/sites-available create a file with the username

<VirtualHost *:80>
 DocumentRoot /home/abvbread/public_html
 ServerName www.abvbreadandroses.info
 # Other directives here
</VirtualHost>
cd /etc/apache2/sites-enabled
a2ensite webeshop (puts a link in sites-enabled)
or do it manually - ln -s ../sites-available/webeshop webeshop
/etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart OR apache2ctl restart