Download PDF

hastywittedmarriedInternet and Web Development

Dec 8, 2013 (3 years and 10 months ago)

156 views

Linux Servers
Ali Nadalizadeh
Ahmad Darki
Ashkan Yousefpour
AUT’s 5th Linux Festival
Thursday, June 6, 13
Presentation Layout
Theoretical Overview on Linux Servers
Slide Presentation
Web Server Installation
Workshop
Server Management and Monitoring
Semi-Workshop
Thursday, June 6, 13
What’s a Server?
In computing, a server is
any combination of
hardware or software designed to provide
services to clients
.
When used alone, the term typically refers to a
computer which may be running a server
operating system, but is also used to refer to
any software or dedicated hardware capable of
providing services.
Thursday, June 6, 13
Expectations
Advanced Networking Capabilities
Automation Capabilities
Tight System Security
Resource Management Capabilities
Stability
Thursday, June 6, 13
What do I need?
You need to be friend with Linux
Terminal Commands
Editing Config files
Reading Log Files
Willpower to read and try
HOW-TO(s), Manuals and Forums
Thursday, June 6, 13
What do I need?
Have Networking Knowledge
Concepts (IP, Port, Interface, Firewall, etc)
Network Configuration
Network Troubleshooting
Security and Auditing
Permissions and Access Control
Never trust your theoretical knowledge
Constantly monitoring for malicious activities
Thursday, June 6, 13
Typical Server Scenarios
Web Server
Internet Gateway
Domain Controller Server
E-Mail Server
Load Balancing Servers
...
Thursday, June 6, 13
Web Server
Serving Dynamic Web Pages Involves:
Serving Static Files
Apache, NGINX
Server Side Programming Language
PHP, Ruby, Python, J2EE, ...
Database Server
MySQL, PostgreSQL, Oracle
Thursday, June 6, 13
Shared Web Servers
Administration Portal
CPanel, ISPConfig, Webmin, PHPMyAdmin, ...
File Transfer
ProFTPD, VSFTPD, PureFTPD
Notes on File and Process Permissions
SuPHP, Apache-itk, FASTCGI, Jailing Concept
Thursday, June 6, 13
Internet Gateway
Linux as a Router
Netfilter / iptables / traffic shaping
(Layer 3 to 5 in OSI)
Caching Proxy Server (Squid, Traffic Server, ...)
Authentication
Log
Bandwith Control
Thursday, June 6, 13
Domain Controller
Samba
Freeware reimplementation of SMB/CIFS protocol
Acts as File / Printer sharing server
Can act as Primary Domain Controller (PDC)
Version 3 can join Active Directory as a member
Version 4 promises Active Directory Server feature
Thursday, June 6, 13
Domain Controller
For *nix Systems
User Authentication
Network Information Service (NIS)
OpenLDAP
PAM (Pluggable Authentication Module)
File Sharing
NFS (Network File System)
AFS (Andrew File System)
Any other Virtual FS
Thursday, June 6, 13
Email Server
Mail Transportation Agent (MTA)
Postfix
Exim
Courier
Mail Access Server (POP3, IMAP)
Dovecot, Courier, Webmail
Thursday, June 6, 13
Web Server Setup
Workshop
Ahmad Darki / Ashkan Yousefpour
AUT’s 5th Linux Festival
Thursday, June 6, 13
Server Management
and Monitoring
Ali Nadalizadeh
AUT’s 5th Linux Festival
Thursday, June 6, 13
Remote Management
Secure Shell Server (OpenSSH Server)
Install:
apt-get install openssh-server
Key Exchange
File Transfer (SCP)
Port Forwarding

(ssh my.server.com
-L 999:site.com:80
)
VNC
Web-based Terminals
Thursday, June 6, 13
System Monitoring
System Load
13:02:15 up 11 days, 19:28, 1 user, load average: 0.88, 0.98, 0.95
Disk Space
[root@cl-t169-402cl ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 290G 89G 187G 33% /
Memory
free -m
Thursday, June 6, 13
System Monitoring
Network Usage / Quota
vnstat (general and timed reports)
munin (graphical charts)
Network Bandwidth
[root@cl-t169-402cl ~]# vnstat -l
Monitoring eth0... (press CTRL-C to stop)
rx: 1.29 Mbit/s 2301 p/s tx: 42.10 Mbit/s 3769 p/s
Thursday, June 6, 13
System Monitoring
Process Monitoring
ps
and
grep, pstree
top - Constant Process Monitoring
htop - Supports Multicore
iotop - Disk Input/Output stats
iftop - Network transfer activity
Thursday, June 6, 13
High Load Servers
Too much load on the server?
Software Optimization
database queries, code, cache
Changing Server Softwares
nginx, fastcgi, ...
Changing Internal Server Architecture
varnish, squid, nginx mixtures
Distributed / Load Balancing Architecture
dns, server based, resource based
Thursday, June 6, 13
Log files
Analyzing logs
less, tail, head
grep, grep -v
Live Monitoring
tail -f /var/log/syslog
Thursday, June 6, 13
Log files
System Logs
/var/log/syslog
/var/log/messages
Application Log Files
Service Logfiles
/var/log/apache/access_log
/var/log/nginx/access.log
Thursday, June 6, 13
Analyzing Logs
Using Helper Tools
last
webalizer
logrotate
logwatch
Using Shell Utilities
Extract number of accesses from an IP
cat /var/log/nginx/access.log | grep 2.187.234.77 | wc
Thursday, June 6, 13
Thanks
Questions?
Thursday, June 6, 13