Apache web server


Apache Web Server: Introduction and Installation


What is Apache web Server?

Apache is a most popular, freely available open source web server. A Web server accepts HTTP requests from web clients and serves them HTTP responses in the form of web pages that contains static (text, images etc) and dynamic (scripts) content.

According to the Apache Software Foundation:

The name 'Apache' was chosen from respect for the Native American Indian tribe of Apache, well-known for their superior skills in warfare strategy and their inexhaustible endurance. It also makes a cute pun on "a patchy web server" -- a server made from a series of patches -- but this was not its origin. The group of developers who released this new software soon started to call themselves the "Apache Group".

Samba Server Access Control Options


Options to restrict the security in Samba Server



valid users

It is required when some users only can access the directory, not all users.


[sales]
path = /home/samba/sales
comment = Sales Data
writeable = yes
valid users = tom dick harry


Here sales directory can be accessed by the user listed in valid users.

invalid users

To explicitly deny the listed users access we use invalid users. If the user is present in both list then user can’t access the directory.

[sales]
path = /home/samba/sales
comment = Sales Data
writeable = yes
valid users = tom dick harry
invalid users = kim

Samba User Security

Samba User authentication and security


If we want only valid user can only access the Samba server then we use security as user in global section. If we set security = user in global section then user will require to provide password to access the Samba Server.


The global for user security

[global]
workgroup = WORKGROUP
server string = Samba Server
netbios name = LinuxSamba
security = user


Creating Samba User


Samba User Creation on Samba Server


We can create a user for Samba Server who can own files and directories.

First we create a Linux user who can’t login to any shell.


# useradd -s /bin/false sambauser
# passwd password
Changing password for user sambauser.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.


Now we create a samba share directory for the user with owner permissions.

# mkdir /home/samba/sambauserdir
# chown -R sambauser:sambauser /home/samba/sambauserdir


Echo Command - Writing Output on Screen


Echo Command


Echo is a shell built-in command used to display a line of text on standard output.

echo with -e option enables interpretation of backslash escapes

Some backslashes used for different purpose are:


\\
backslash
\a
alert (BEL)
\b
backspace
\c
suppress trailing newline
\f
form feed
\n
new line
\r
carriage return
\t
horizontal tab
\v
vertical tab