понедельник, 11 мая 2009 г.

Adm tasks on CentOS

To create a user account from a shell prompt:
1. Open a shell prompt.
2. If you are not logged in as root, type the command su - and enter the root password.
3. Type useradd followed by a space and the username for the new account you are creating at the command line (for example, useradd jsmith). Press [Enter]. Often, usernames are variations on the user's name, such as jsmith for John Smith. User account names can be anything from the user's name, initials, or birthplace to something more creative.
4. Type passwd followed by a space and the username again (for example, passwd jsmith).
5. At the New password: prompt enter a password for the new user and press [Enter].
6. At the Retype new password: prompt, enter the same password to confirm your selection.

###
## Apache
###
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch20_:_The_Apache_Web_Server
seLinux, new VirtualHost


###
# New user and web sites
# % - under root
# $ - under newuser
###

% useradd newuser
% passwd newuser
% mkdir /var/www/newuser
% chown newuser /var/www/newuser

$ cd /var/www/newuser
$ mkdir site1
$ echo "test content" > site1/index.html

in httpd conf

DocumentRoot /var/www/newuser/site1

If "access denied" check: The directories (all of them) must be rwxr-xr-x (readable and executable by everyone), this apply to all the subdirectories and the parent directories in the path, the files have to be rw-r--r--

Комментариев нет: