installation of lamp server with ubuntu 14.10 server edition
DESCRIPTION
Introducing the installation of LAMP Server with Ubuntu 14.10 Server Edition at Open Source Tech Talk 2014.11.TRANSCRIPT
Sammy Fung
● Python Developer
● President at Open Source Hong Kong
● Volunteers at Open Source Communities
Linux Certifications
● Linux Professional Institute
– Level 1: Perform Maintenance tasks.
– Level 2: Administrate Small-medium mixed network.
– Level 3: New enterprise-level.
● Linux Foundation (New)
– LFCS: System Admins
– LFCE: Engineers
LinuxWeb Server
LAMP
LAMP Stack
● L = Linux
● A = Apache (Web Server)
● M = MySQL (Database Server)
● P = PHP (Programming Language)
LAMP Stack Alternatives
● L = Linux
● A = Apache
● M = MySQL / MariaDB
● P = PHP / Python / Perl
Other Alternatives
● Web Server
– Nginx replacing Apache
● Database
– PostgreSQL replacing MySQL / MariaDB
● Programming Languages
– Ruby, Node.JS
Step-by-Step Install Demosration
● Linux: Ubuntu 14.10 Server Edition
– Base system with SSH server.
● MySQL database system
● Apache web server + PHP
– Apache PHP module.
– PHP libraries
– Drupal: PHP Content Management System.
Linux
● Linux = Linux Kernel● Linux distributions (distros)
– Linux Kernel + System Tools + Application Progams
– Red Hat and RPM-based● Red Hat Enterprise Linux● Fedora, CentOS● SuSE, OpenSuSE
– Debian and DEB-based● Debian● Ubuntu
Ubuntu 14.10 Server Edition
● Single CD-size image to target Linux installation for serverpurposes.
● Non-LTS version: 9-month support cycle.
– Upgrade to next version after support cycle (July 2015).
– Next version 15.04 Vivid Vervet (non-LTS) will be released in April2015.
– LTS versioon 14.04 (Trusty Tahr) supports till April 2019.
● Linux Kernel 3.16
● OpenStack 2014.2 (Juno) release in main repo.
● Docker 1.2
Installation Targets
● Physical machines
● Virtual machines
– KVM, Virtualbox, VMware
– Linode
– Amazon Web Service (AWS)
– Google Cloud Service
– Rackspace
– Microsoft Azure
OK! Let's startto install.
Ubuntu 14.10 Server Edition as base system
Linux Operating System
● UNIX-style Operation System
● Command Line Interface (CLI)
● Disk Storages and Filesystems
● Process and memory management
● Networking
● OS managament
UNIX-Style Operating System
● Users and Groups
– Super User (Admin): root● su, sudo, id
– useradd, usermod, userdel.
– groupadd, groupmod, groupdel.
– /etc/passwd, /etc/shadow
● Everything is file.
– Filesystem Structure● /dev, /etc, /home, /var
Command Line Interfaces
● Shell: BASH
● BASH Script: .bashrc
● Redirection: >, >>, <, |, `cmd`
● uname
● SSH
– Secure Remote Shell over SSL SecretCommunication
Disk Storage and Filesystems
● Partitioning: fdisk
● Filesystem: ext4
– mkfs, mount, fsck, mkswap
● File Operation
– ls, pwd, cd, mkdir, rmdir, rm, chmod, chown, find,du, df
– Tar, rsync
Process and Memory Management
● Runlevels 0-6
– /etc/init.d/
● Process Management
– ps, kill
● Memory Management
– free
Networking
● Networking interface
– Ifconfig
– /etc/network/interface
– /etc/resolv.conf
● Routing: route, traceroute
● Packet Filtering (Firewall): iptables
● Monitoring: netstat
● Troubleshooting: ping, host, traceroute
OS Managament
● Software Package: .deb
– dpkg: core package management tool
– apt-get: easier software package tool● apt-get install python
– aptitude: menu-based package tool
MySQL
● RDBMS: Relationship-based Database System
● CLI Client: mysql -u username -p
● Config File /etc/my.cnf
● SQL
– CREATE DATABASE / TABLE / USER, GRANT
– FLUSH PRIVILEGES
– USE databasename
– SHOW DATABASES / TABLES
– INSERT, UPDATE, DELETE
MySQL
● apt-get install mysql-server
● mysql -u root -p
– CREATE DATABASE mydrupal;
– CREATE USER mydrupal@localhost identified by'opensource.hk';
– GRANT ALL ON mydrupal.* to mydrupal@localhost;
– FLUSH PRIVILEGES;
Apache
● HTTP server
– HTTP = web protocol
● Installation and Configuration
– Setting up name-based virtual web hosts
– Configure Apache log files
– Restrict access to a web page with Apache
– Modules: SSL, Userdir, rewrite
● PHP
– MySQL, SMTP
● Postfix SMTP server
Name-based Virtual Host
<VirtualHost 10.0.2.15:80> ServerName firsttest.sammy.hk.lan ServerAdmin [email protected] DocumentRoot /home/sammy/www <Directory "/home/sammy/www"> AllowOverride All Options Indexes FollowSymLinks order allow,deny allow from all Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/firsttest.sammy.hk.lan-error.log CustomLog ${APACHE_LOG_DIR}/firsttest.sammy.hk.lan-access.logcombined</VirtualHost>
Name-based SSL Virtual Host<VirtualHost *:443> ServerName firsttest.sammy.hk.lan ServerAdmin [email protected] DocumentRoot /home/sammy/www <Directory "/home/sammy/www"> AllowOverride All Options Indexes FollowSymLinks order allow,deny allow from all Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/firsttest.sammy.hk.lan-error.log CustomLog ${APACHE_LOG_DIR}/firsttest.sammy.hk.lan-access.logcombined SSLEngine on SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateKeyFile /etc/ssl/certs/ssl-cert-snakeoil.key</VirtualHost>
Apache + PHP5 Installation
● apt-get install apache2
● apt-get install php5
● apt-get install php5-mysql
● apt-get install php5-gd
● cd /etc/apache2/sites-available● vim firsttest.sammy.hk.lan.conf● cd /etc/apache2/sites-enabled● ln -s ../sites-available/firsttest.sammy.hk.lan.conf
● /etc/init.d/apache restart
PHP / Python
● Drupal: PHP Content Management System
● Wordpress: PHP Blog System
● Django: Python Web Framework
Drupal basic installation
● Download and uncompress Drupal tarball to DocumentRoot– cp sites/default/default/settings.php sites/default/settings.php
– mkdir sites/default/files
– chmod a+w sites/default/settings.php sites/default/files
● At web browser,– http://firsttest.sammy.hk.lan/
– Add above hostname to host files on your client machine, eg. /etc/hosts
– Use port 8080 at VirtualBox port forwarding to port 80
● Go thru step-by-step installation.● DONE!
LAMP
LAMP Stack
● L = Linux
● A = Apache (Web Server)
● M = MySQL (Database Server)
● P = PHP (Programming Language)
THANK YOU!Sammy Fung <[email protected]>
http://slidesha.re/1tsBbLA
This slide is licensed under Creative Commons BY-NC-SA 3.0