You are on page 1of 9

Linux Installation Overview

TASK

 Set up your server.


 Prepare your system for OS installation.
 Set up your system for a RAID or non-RAID configuration based on the SAS controller
card.
 Review your Server Product Notes.
 Install the Linux OS.
 Install the system-specific drivers from the Tools and Drivers CD
 Run the up2date or SUSEWatcher utility.

INSTALLATION TASK

 Install your server hardware and configure the service processor.


 Set the display environment. If necessary, erase the primary boot disk.
 Your server supports two SAS controller cards. RAID setup is different for each card.
 The product notes contain late-breaking news about the Linux OS software and patches.
 Choose an installation method and locate the installation instructions.
 Install the system-specific drivers needed to run the Linux OS on your server.
Linux NFS Overview

Network File Sharing (NFS) is a protocol that allows you to share directories and files with
other Linux clients over a network. Shared directories are typically created on a file server,
running the NFS server component. Users add files to them, which are then shared with other
users who have access to the folder. An NFS file share is mounted on a client machine,
making it available just like folders the user-created locally. NFS is particularly useful when
disk space is limited and you need to exchange public data between client computers.

Installing NFS Server

sudo apt-get update


sudo apt install nfs-kernel-server

Create Root NFS Directory

sudo mkdir /mnt/myshareddir

Set permissions so that any user on the client machine can access the folder.

sudo chown nobody:nogroup /mnt/myshareddir #no-one is owner


sudo chmod 777 /mnt/myshareddir #everyone can modify files

Define Access for NFS Clients in Export File

To grant access to NFS clients, we’ll need to define an export file. The file is typically located
at /etc/exports

Edit the /etc/exports file in a text editor, and add one of the following three directives.

All the directives below use the options rw, which enables both read and write, sync, which writes
changes to disk before allowing users to access the modified file, and no_subtree_check, which means
NFS doesn’t check if each subdirectory is accessible to the user.
To enable access to a single client /mnt/myshareddir {clientIP}(rw,sync,no_subtree_check)

To enable access to several clients /mnt/myshareddir {clientIP-1}(rw,sync,no_subtree_check)

{clientIP-2}(...)

{clientIP-3}(...)

To enable access to an entire subnet /mnt/myshareddir {subnetIP}/{subnetMask}


(rw,sync,no_subtree_check)

Make the NFS Share Available to Clients

You can now make the shared directory available to clients using the exportfs command. After running
this command, the NFS Kernel should be restarted.

sudo exportfs -a #making the file share available


sudo systemctl restart nfs-kernel-server #restarting the NFS kernel

Samba Overview
“Samba is the standard Windows interoperability suite of programs for Linux and Unix.”

Samba basically allows Unix systems to share files and printers with Windows so that in spite of their
differences, these two systems can peacefully exist.

Samba is also very instrumental in integrating Linux/Unix servers and applications into an Enterprise’s
Active Directory. In this module, we will learn how we can install and set up a samba server with our
Ubuntu distro.

Installing Samba on Linux

To install samba, we can use the default package manager of our system. In this case, I am using an
Ubuntu machine so my package manager is apt:

$ sudo apt update && sudo apt install -y samba

To verify that samba was successfully installed, we’ll use the whereis command:

$ whereis samba

samba: /usr/sbin/samba /usr/lib/samba /etc/samba /usr/share/samba


/usr/share/man/man7/samba.7.gz/usr/share/man/man8/samba.8.gz

Hence, as we see, samba was successfully installed !

Editing The Config Files

First, we need to create a directory that we want to share. Create a directory with the mkdri
command as shown below:

$ mkdir /tmp/sambashare

We created a directory in /tmp folder but you can create it anywhere you choose. Next up we need to
edit the samba config file located under /etc/samba/smb.conf

$ sudo nano /etc/samba/smb.conf

Append the following to the end of the file :

[sambashare]
comment = Samba And Linux
path = /tmp/sambashare
read only = no
browsable = yes

Analyze:
comment: A brief description of our share
path: The complete path of the directory we are going to share
read-only: This allows the files of the share to be modified by others
browsable: This would allow File Managers to list the share under “Network”

Starting The Samba Server

You can start the samba server with the service command:
$ sudo service smbd restart

Note that if you have a firewall like ufw enabled, we need to configure it to allow our samba traffic as
such :

$ sudo ufw allow samba

Setting Up User Account

Samba doesn’t use our system account password. Hence, we need to set up a Samba password manually
for our account :

$ sudo smbpasswd -a $USER

samba server is ready!

Apache Web Server overview


Apache is a remarkable piece of application software. It is the most widely used Web Server application
in the world with more than 50% share in the commercial web server market. Apache is the most widely
used Web Server application in Unix-like operating systems but can be used on almost all platforms such
as Windows, OS X, OS/2, etc. The word, Apache, has been taken from the name of the Native American
tribe ‘Apache’, famous for its skills in warfare and strategy making.

It is a modular, process-based web server application that creates a new thread with each simultaneous
connection. It supports a number of features; many of them are compiled as separate modules and
extend its core functionality and can provide everything from server-side programming language
support to the authentication mechanism. Virtual hosting is one such feature that allows a single Apache
Web Server to serve a number of different websites.

Installing Apache

ways of installing the package or application

 One of the features of the open-source web application is that anyone can make an installer as
per their own environment. This has allowed various vendors like Debian, Red Hat, FreeBSD,
Suse, etc. to customize the file location and configuration of Apache taking into account other
installed applications and base OS.
 Apart from installing it from a vendor-based installer, there is always the option of building and
installing it from the source code. Installing Apache from the source file is platform-independent
& works for all OS.

The Apache web server is a modular application where the administrator can choose the required
functionality and install different modules as per his/her requirement.

All modules can be compiled as Dynamic Shared Objects (DSO is an object file that could be shared by
multiple apps while they are executing) that exist separately from the main Apache file. The DSO
approach is highly recommended, it makes the task of adding/removing/updating modules from the
server’s configuration very simple.

Install Apache: Linux Platform

You can install Apache via the default Package Manager available on all Red Hat-based distributions like
CentOs, Red Hat, and Fedora.
[root@amsterdam ~]# yum install httpd

The apache source tarball could be converted into an rpm file using the following command.
[root@amsterdam ~]# rpmbuild -tb httpd-2.4.x.tar.bz2

It is mandatory to have -devel package installed on your server for creating .rpm file from source.
Once you convert the source file into an rpm installer, you could use the following command to install
Apache.
[root@amsterdam ~]# rpm –ivh httpd-2.4.4-3.1.x86_64.rpm

After the installation the server does not start automatically, in order to start the service, you have to
use any of the following command on Fedora, CentOs or Red Hat.
[root@amsterdam ~]# /usr/sbin/apachectl start

[root@amsterdam ~]# service httpd start

[root@amsterdam ~]# /etc/init.d/httpd start

Install Apache from Source

Installing apache from the source require the –devel package to be installed on your server. Once you
download the source file move it to the /usr/local/src folder.

[root@amserversterdam ~] cd /usr/local/src

[root@amserversterdam ~] gzip -d httpd-2.2.26.tar.gz

[root@amserversterdam ~] tar xvf httpd-2.2.26.tar

[root@amserversterdam ~] httpd-2.2.26

In order to see all configuration options available for Apache, you can use ./configure –help option. The
most common configuration option is –prefix={install directory name}.

[root@amserversterdam ~]./configure --help

[root@amserversterdam ~]./configure –prefix=/usr/local/apache –enable-so

[root@amserversterdam ~] make

[root@amserversterdam ~] make install

The above example shows the compilation of Apache within the /usr/local/apache directory with the
DSO capability. The –enable-so option, can load required modules to apache at run time via the DSO
mechanism rather than requiring a recompilation.

Once the installation completes, you can browse the web server’s default page with your favorite
browser. If a firewall is enabled on your server, you must have to make an exception for port 80 on your
OS firewall. You can use the following command to open port 80.

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

Virtual Host
An Apache web server can host multiple websites on the SAME server. You do not need a separate
server machine and Apache software for each website. This can achieve using the concept of Virtual
Host or VHost.

Any domain that you want to host on your web server will have a separate entry in apace configuration
file.

 Name-based Virtual host


 Address-based or IP based virtual host and.

Name-based Virtual Host

Name-based virtual hosting is used to host multiple virtual sites on a single IP address.

In order to configure name-based virtual hosting, you have to set the IP address on which you are going
to receive the Apache requests for all the desired websites. You can do this by NameVirutalHost
directive within the apache configuration i.e. httpd.conf/apache2.conf file.

NameVirtualHost *:80

<VirtualHost 192.168.0.108:80>

ServerAdmin webmaster@example1.com

DocumentRoot /var/www/html/example1.com

ServerName www.example1.com

</VirtualHost>

<VirtualHost 192.168.0.108:80>

ServerAdmin admin@example2.com

DocumentRoot /var/www/html/example2.com

ServerName www.example2.com

</VirtualHost>

You can add as many virtual hosts, as per your requirement. You can check your web configuration files
with:

[root@amsterdam ~]#httpd –t
Syntax OK

If the configuration file has some wrong syntax, it will throw an error
[root@115 conf.d]# httpd -t

Syntax error on line 978 of /etc/httpd/conf/httpd.conf:

Invalid command '*', perhaps misspelled or defined by a module not included in the server
configuration

IP-based Virtual host

In order to setup IP based virtual hosting, you need more than one IP address configured on your server.
So, the number of vhost apache will depend on number of IP address configured on your server. If your
server has 10 IP addresses, you can create 10 IP-based virtual hosts.

Listen 192.168.0.100:80

<VirtualHost 192.168.10.108:80>

ServerAdmin webmaster@example1.com

DocumentRoot /var/www/html/example1.com

ServerName www.example1.com

</VirtualHost>

<VirtualHost 192.168.10.109:80>

ServerAdmin admin@example2.com

DocumentRoot /var/www/html/example2.com

ServerName www.example2.com

</VirtualHost>

You might also like