Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linux Basics And Apache Installation

Similar presentations


Presentation on theme: "Linux Basics And Apache Installation"— Presentation transcript:

1 Linux Basics And Apache Installation
01:09:18 1

2 Operating System 01:09:18 2

3 Operating System 01:09:18 3

4 Operating System 01:09:18 4

5 Operating System Duties
Process Management Memory Mgmt I/O Managemnt File Management 01:09:18 5

6 Operating System 01:09:18 6

7

8 Enable root Login in Ubuntu 14.04
sudo -i passwd root /etc/lightdm/lightdm.conf [SeatDefaults] greeter-session=unity-greeter user-session=ubuntu greeter-show-manual-login=true

9 Enable root Login in Ubuntu Desktop 14.04
Edit /etc/gdm/custom.conf file and include AllowRoot=true. sudo passwd -dl root (to disable)

10 dd if=/path/to/ubuntu.iso of=/dev/sdb bs=1M
Create bootable USB umount /dev/sdb dd if=/path/to/ubuntu.iso of=/dev/sdb bs=1M 01:09:19 10

11 File System A file system or filesystem is used to control how data is stored and retrieved. The structure and logic rules used to manage the groups of information and their names is called a "file system". 01:09:19 11

12 File System of Linux

13 LINUX DIRECTORY STRUCTURE

14 File System Linux uses Ext2, Ext3, Ext4 01:09:19 14

15 File System Ext2 stands for second extended file system.
It was introduced in Developed by Rémy Card. 01:09:19 15

16 File System Ext2 Ext2 stands for second extended file system.
It was introduced in 1993. Developed by Rémy Card. Ext2 does not have journaling feature Maximum individual file size can be from 16 GB to 2 TB Overall ext2 file system size can be from 2 TB to 32 TB 01:09:19 16

17 File System EXT3 Ext3 stands for third extended file system.
It was introduced in Developed by Stephen Tweedie The main benefit of ext3 is that it allows journaling Maximum individual file size can be from 16 GB to 2 TB Overall ext3 file system size can be from 2 TB to 32 TB

18 File System EXT4 Ext4 stands for fourth extended file system.
It was introduced in 2008. \Maximum individual file size can be from 16 GB to 16 TB Overall maximum ext4 file system size is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). 1 PB = 1024 TB (terabyte).

19 Formating drive and usb
#fdisk -l # mkfs.ext4 /dev/device 01:09:19 19

20 File System

21 File System

22 File System

23 File System

24 Formating drive and usb
umount /dev/sda2 tune2fs -j /dev/sda2 mount /dev/sda2 /home

25 Source List To Add source list /etc/apt/sources.list
3rd pary installation /etc/apt.sourceslist.d 01:09:19 25

26 Source List deb saucy main restricted deb-src saucy main restricted deb file:/mnt/debian-dvd/ wheezy main contrib

27 System back add-apt-repository -y ppa:nemh/systemback
sudo apt-get update sudo apt-get install systemback

28 Linux Basic Commands ls cp [option(s)] sourcefile targetfile
mv [option(s)] sourcefile targetfile rm [option(s)] file(s) -r . Deletes any existing subdirectories cd [options(s)] [directory] mkdir [option(s)] directoryname rmdir [option(s)] directoryname

29 Linux Basic Commands ln [option(s)] sourcefile targetfile
chown [option(s)] username.group file(s) R- Changes files and directories in all subdirectories. chgrp [option(s)] groupname file(s) adduser user group

30 Linux Basic Commands chmod [options] mode file(s) u-user g-group
o-others For access, access is granted by the + symbol and denied by the – symbol. r-read ,w-write ,x- execute

31 Linux Basic Commands grep [option(s)] searchstring filenames
mount [option(s)] [<device>] mountpoint du [option(s)] [path] -h human redable free [option(s)]

32 Linux Basic Commands kill [option(s)] process ID
ping [option(s)] host name|IP address

33 Setting Proxy export http_proxy="http://usrname:passwrd@host:port"
/etc/environment http_proxy= /etc/apt/apt.conf Acquire:: "

34 Mount command Mount -t <file system ? <souce> <dest>
Fdisk -l

35 Netwoking in Ubuntu sudo vi /etc/network/interface
iface eth0 inet static address netmask gateway dns-search example.com dns-nameservers

36 Networking sudo /etc/init.d/networking restart Or Reboot.

37 Networking #ip addr show #Ifconfig
# ip addr del /24 dev eth1 # ip link set eth1 up # ip link set eth1 down

38 Networking # ip route show #ping <IP>

39 Web Server The term web server can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver web content that can be accessed through the Internet. A user agent, commonly a web browser or web crawler, initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource 39 39

40 Web Server 40 40

41 Web Server 41 41

42 Web Server 42 42

43 Popular Web Server Apache HTTP Server (open source)
Microsoft Internet Information Services (IIS) NGINX, Inc (open source) Google -GWS Sun Java System Web Server TEQIP_GEC_WAYANAD_25_June 43 43

44 Popular Web Server 44 44

45 LAMP LAMP (Linux, Apache, MySQL, PHP/Perl/Python) is a package that contains a web server (Apache). This is a piece of software that actually runs your web application. Frameworks are, in short, libraries that help you develop faster.

46 LAM

47 LAMP

48 Apache Apache httpd has been the most popular web server on the Internet since April 1996, and celebrated its 17th birthday as a project this February. The Apache HTTP Server ("httpd") is a project of The Apache Software Foundation. open-source HTTP server for modern operating systems including UNIX and Windows NT 48 48

49 Apache 49 49

50 Apache Apache httpd 2.4.25 (released 2016-12-20)
50 50

51 Apache2 apt-get -y install apache2
vi /etc/apache2/conf-enabled/security.conf # line 26: change ServerTokens Prod # line 37: change ServerSignature Off

52 Apache2 vi /etc/apache2/mods-enabled/dir.conf
# line 2: add file name that it can access only with directory's name DirectoryIndex index.html index.htm

53 Apache2 vi /etc/apache2/apache2.conf # line 70: add server name
ServerName

54 Apache2 vi /etc/apache2/sites-enabled/000-default.conf
# line 11: change admin address /etc/init.d/apache2 restart 

55 Apache2 server's hostname or IP address)/

56 Supporting PHP pages GECTCR_13_ JAN_2016 56 56

57 Apache2-PHP # apt-get -y install php5 php5-cgi libapache2-mod-php5 php5-common php-pear  #a2enconf php5-cgi.conf  #/etc/init.d/apache2 restart 

58 Apache2-PHP vi /var/www/html/index.php <html> <body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;"> <?php       print Date("Y/m/d"); ?> </div> </body> </html>

59 Apache2-Enable Userdir
# a2enmod userdir   /etc/init.d/apache2 restart  mkdir ~/public_html   vi ~/public_html/index.html <html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> UserDir Test Page </div> </body> </html>

60 Virtual Hosting GECTCR_13_ JAN_2016 60 60

61 Virtual Hosting 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 same host name. 61 61

62 Virtual Hosting One widely used application is shared web hosting. Shared web hosting prices are lower than a dedicated web server because many customers can be hosted on a single server. 62 62

63 Apache2-Virtual Hostings
# vi /etc/apache2/sites-available/virtual.host.conf # create new for virtualhost <VirtualHost *:80> ServerName ServerAdmin DocumentRoot /home/ubuntu/public_html ErrorLog /var/log/apache2/virtual.host.error.log </VirtualHost>

64 Apache2-Virtual Hostings
#a2ensite virtual.host  /#etc/init.d/apache2 restart 

65 Apache2-Virtual Hostings
$ mkdir ~/public_html  vi ~/public_html/index.html <html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> Virtual Host Test Page </div> </body> </html>

66 Basic Authentication A simple user ID and password-based authentication scheme, and provides the following: To identify which user is accessing the server To limit users to accessing specific pages (identified as Universal Resource Locators, URLs 66 66

67 SSL and Certificates The Secure Socket Layer protocol was created by Netscape to ensure secure transactions between web servers and browsers. 67 67

68 SSL Secure Sockets Layer (SSL), are cryptographic protocols that provide communication security over the Internet. 68 68

69 SSL GECTCR_13_ JAN_2016 69 69

70 SSL GECTCR_13_ JAN_2016 70 70

71 SSL Communication 71 71

72 Apache2 -SSL Settings vi /etc/apache2/sites-available/default-ssl.conf
# line 3: change to admin # line 32,33: change to the one created in [1] SSLCertificateFile /etc/ssl/private/server.crt SSLCertificateKeyFile /etc/ssl/private/server.key

73 Apache2 -SSL Settings # a2ensite default-ssl # a2enmod ssl
#/etc/init.d/apache2 restart

74 SSL WEBSITES www.gmail.com www.yahoo.com www.onlinesbi.com
Etc etc etc 74 74

75 Apache2 -Use Basic Auth # apt-get -y install apache2-utils
# vi /etc/apache2/sites-available/auth-basic.conf # create new <Directory /var/www/html/auth-basic> AuthType Basic AuthName "Basic Authentication" AuthUserFile /etc/apache2/.htpasswd require valid-user </Directory>

76 Apache2 -Use Basic Auth # htpasswd -c /etc/apache2/.htpasswd test
# mkdir /var/www/html/auth-basic  # /etc/init.d/apache2 restart  # vi /var/www/html/auth-basic/index.html <html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> Test Page for Basic Auth </div> </body> </html>

77 Webserver & Database GECTCR_13_ JAN_2016 77 77

78 Install MySQL # apt-get -y install mysql-server
#/etc/init.d/mysql start # mysql -u root -p  mysql> select user,host,password from mysql.user; 

79 Install phpMyAdmin # apt-get -y install phpmyadmin
# vi /etc/phpmyadmin/apache.conf # near line 8: add lines below Require ip /24 # /etc/init.d/apache2 restart 

80 PhpMyAdmin PPA sudo add-apt-repository ppa:nijel/phpmyadmin
sudo apt-get update

81 Install phpMyAdmin Create db connect php code

82 SAMBA SERVER

83 SAMBA SERVER

84 SAMBA SERVER # apt-get -y install samba # mkdir /home/share
# chmod 777 /home/share 

85 SAMBA SERVER # vi /etc/samba/smb.conf # near line 25: add
unix charset = UTF-8 # line 30: change (Windows' default) workgroup = WORKGROUP # line 51: uncomment and change IP address you allow interfaces = /8  /24

86 SAMBA SERVER # line 58: uncomment bind interfaces only = yes
# line 60: add (no auth) map to guest = Bad User

87 SAMBA SERVER # add at the last line [Share]# any name you like
   path = /home/share# shared directory    writable = yes# writable    guest ok = yes# guest OK    guest only = yes# guest only    create mode = 0777# fully accessed    directory mode = 0777# fully accessed    share modes = yes# warn if some people access to a file

88 SAMBA SERVER # initctl restart smbd 

89 SAMBA SERVER # groupadd security # mkdir /home/security
# chgrp security /home/security  # chmod 770 /home/security  # vi /etc/samba/smb.conf

90 SAMBA SERVER # line 60: comment out # map to guest = Bad User

91 SAMBA SERVER [Security]# any name you like path = /home/security
   writable = yes    create mode = 0770    directory mode = 0770    share modes = yes    guest ok = no# guest not allowed    valid users allow only security group

92 SAMBA SERVER # smbpasswd -a trusty # add a user in Samba
# usermod -G security trusty  # initctl restart smbd 

93 FTP Server

94 FTP Server # apt-get -y install vsftpd #vi /etc/vsftpd.conf

95 FTP Server # line 29: uncomment write_enable=YES
# line 97,98: uncomment ( allow ascii mode transfer ) ascii_upload_enable=YES ascii_download_enable=YES

96 FTP Server # line 120: uncomment ( enable chroot )
chroot_local_user=YES # line 121: uncomment ( enable chroot list ) chroot_list_enable=YES

97 FTP Server # line 123: uncomment ( enable chroot list )
chroot_list_file=/etc/vsftpd.chroot_list # line 129: uncomment ls_recurse_enable=YES

98 FTP Server # add at the last line
# specify root directory ( if don't specify, users' home directory equals FTP home directory) local_root=public_html # turn off seccomp filter seccomp_sandbox=NO

99 FTP Server #vi /etc/vsftpd.chroot_list
# add users you allow to move over their home directory test

100 FTP Server #initctl restart vsftpd

101 Govt.Engg.College Sreekrishnapuram Palakkad 9539601112
SIJO S VADAKKAN Govt.Engg.College Sreekrishnapuram Palakkad 01:09:19 GEC KANNR _JAN_2017 101 101


Download ppt "Linux Basics And Apache Installation"

Similar presentations


Ads by Google