Webserver linux class activities

Page 1

Vannai .SAT

9 K


Vannai .SAT

Table of Contents I.

Basic hosting website: ..................................................................................... 4 a) install apache2 .............................................................................................. 4 b. Create Host, Pointer, and CNAME on DNS ................................................ 5 c. How to create virtual host (host name: pncsite.sna.edu) ...............................10

b. Configured Vhost: ..........................................................................................17

a) Create new vhost for new website (http://studentsna2015.sna.edu ) .............17 b) Create CNAME on DNS server ...................................................................20

c) Client tests and Troubleshooting if face a problem ......................................22 d) Allow/deny one IP address and network ......................................................22

e) Create users accounts for authentication ......................................................25 1. 1st : use command line to create users .......................................................25 2. 2nd: use shell scrypt to create users ..........................................................25 3. Configure vhost file for authentication accesses .......................................26 c. SSL Configuration: .........................................................................................30 a) Generate private key for SSL (sslserver.key) ...............................................30 b) Generate public key for SSL (sslserver.crt) ..................................................31 c) Configure some file to enable SSL ..............................................................33 d) Redirect https (port: 443) to http (port: 80) ..................................................34

d. Hosting HPH website: ....................................................................................38 a) Hosting Wordpress ......................................................................................38

b) Hosting GPLI ..............................................................................................48


Vannai .SAT

Network Infrastructure


Vannai .SAT

Class Activities I. Basic hosting website: a) install apache2


Vannai .SAT

b. Create Host, Pointer, and CNAME on DNS Below step to create host please follow step below Host is a "host" is a node in a network. 2) For companies or individuals with a Web site, a host is a computer with a Web server that serves the pages for one or more Web sites. A host can also be the company that provides that service, which is known as hosting.


Vannai .SAT


Vannai .SAT

Create PTR

A PTR is a reverse record for an IP address which allows an IP to map to a domain and vice versa.


Vannai .SAT

Create CNAME

1. A CNAME record is an abbreviation for Canonical Name record and is a type of resource record in the Domain Name System (DNS) used to specify that a domain name is an alias for another domain, the "canonical" domain. All information, including subdomains, IP addresses, etc, are defined by the canonical domain.


Vannai .SAT


Vannai .SAT

c. How to create virtual host (host name: pncsite.sna.edu) Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers). This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the samehost name.


Vannai .SAT


Vannai .SAT

resolv.conf is the name of a computer file used in various operating systems to configure the Domain Name System (DNS) resolver library. The file is a plain-text file usually created by the network administrator or by applications that manage the configuration tasks of the system.


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT

b. Configured Vhost: a) Create new vhost for new website (http://studentsna2015.sna.edu )


Vannai .SAT


Vannai .SAT


Vannai .SAT

b) Create CNAME on DNS server

Vi studentsna2015.conf for configure


Vannai .SAT


Vannai .SAT

c) Client tests and Troubleshooting if face a problem

d) Allow/deny one IP address and network Allow/deny one IP address


Vannai .SAT


Vannai .SAT

Test Allow /deny one Network


Vannai .SAT

e) Create users accounts for authentication 1. 1st : use command line to create users

2. 2nd: use shell scrypt to create users A shell script is a computer program designed to be run by the Unixshell, a command line interpreter. The various dialects of shell scriptsare considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.


Vannai .SAT

3. Configure vhost file for authentication accesses About use command line to create users Configure syntax for allow user authentication when access website.(Specific user) Please follow step below


Vannai .SAT


Vannai .SAT

About use shell scrypt to create users


Vannai .SAT


Vannai .SAT

c. SSL Configuration: a) Generate private key for SSL (sslserver.key)


Vannai .SAT

Now we use command cat copy to ssl

It so complexity we do not understand because it encryption.

Use command cat list random.

b) Generate public key for SSL (sslserver.crt) After we create ssl key and then we mount to extension crt that is the certificate. And then we complete all information that its requirement.


Vannai .SAT

We just copy file studentsna2015.key to /etc/apache2/ssl.key We just copy file studentsna2015.crt to /etc/apache2/ssl.crt

We change permission for ssl and crt that we created.

We are going to vim file studentsna2015.conf for configurer ssl.

Configure three option in order to allow secure socket layer.


Vannai .SAT

c) Configure some file to enable SSL We are going to configure some main point that related with ssl.

Going to enable option SSL.

Know about the time that client request or access to website.


Vannai .SAT

d) Redirect https (port: 443) to http (port: 80) We are going to vim listen.conf for allow port 443.

Now we enable NameVirtualhost that allow https.

We take client win7 access this website. And then we can see the picture bellow show us about certificate. We just click on in understand the risk


Vannai .SAT

And then client xp need to add exception with ssl.

On this step it gets certificate that create on suse linux.


Vannai .SAT

And then client xp can access this website successfully. And authenticate

This is the option that allow redirect to https that have port 443.


Vannai .SAT

We just test only types www.studentsna2015.sna.edu

We just test only types https://www.studentsna2015.sna.edu


Vannai .SAT

d. Hosting HPH website: a) Hosting Wordpress 1. We just install service mysql

What you need to do now is following the service installation as the picture shown


Vannai .SAT

It is much more easy if you install by this following step because all these service are involve.


Vannai .SAT

Copy wordpress folder to the location. Every service (package) are kept as same as installation of glpi. Just a little bit different of configure process. Let’s see what the process of hosting wordpress. Rename and copy the file in the picture to another file to configure it.

Enter you database name, your mysql user and password to access you database.


Vannai .SAT


Vannai .SAT


Vannai .SAT

Just like a bit reverse, but it is ok, create the database name wordpress for wordpress website.

Configure vhost file as the others configuration files. It is still the same. See the process

All steps are same as the others.


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT

b) Hosting GPLI 1. Makes sure your GPLI can allow clients or users send message request and view these messages. We just go to the dns configuration file then point as CNAME to the machine which contain web service.


Vannai .SAT


Vannai .SAT

Give the ownership to the wwwrun user with the following step above.


Vannai .SAT

Even it is php website, but we still need to configure the vhost file for it as the simple website too.

As same as the other vhost configuration file, do the same thing as picture have shown.


Vannai .SAT

Here are the process to create database for this glpi website and the database name is helpdesk.

Restart the service to make sure if your configuration file is not error or missing.

Here when you access the website, you still need to configure them to be usable. Firstly, choose the language.


Vannai .SAT

Accept the license policy, you have to do this in order to continue your installation.

Here let’s start the installation of GLPI (helpdesk).


Vannai .SAT

Just want you to check the environment of your machine which can support glpi or not.

Here you need to enter the machine which install mysql and also the username and password whose user is controlling the database.


Vannai .SAT

Then you have to choose which one is the database for the glpi website.

Just inform you about the initialization of the database with the site which is successed.


Vannai .SAT

Here, it is time to use GLPI

Login to the glpi page with the glpi user as default user.


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT


Vannai .SAT


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.