Closing the Loop: Automating Server Setups. Vanessa Vasile, InMotion Hosting



Similar documents
Linux VPS with cpanel. Getting Started Guide

cpanel Structure Details for the complete structure of cpanel by Kevin Asklund.

WHM Administrator s Guide

Dedicated Servers InfoGuide

WebHost Manager 7 User Guide DOCUMENTATION VERSION: 1.2

Introduction to the Capabilities of cpanel & WHM

Parallels Panel. Deployment Guide. Plesk Automation Revision 1.0

cpanel Structure Details for the structure of cpanel & WHM by Kevin Asklund.

Parallels Plesk Automation

A Beginner's Guide to Setting Up A Web Hosting System (Or, the design and implementation of a system for the worldwide distribution of pictures of

Creating Custom Nameservers Contents

Installing Booked scheduler on CentOS 6.5

About This Document 3. Integration Overview 4. Prerequisites and Requirements 6

Magento Optimised Template CentOS 6 with cpanel/whm V1.0

Installing WordPress MU

OS Installation: CentOS 5.8

Parallels Cloud Server 6.0

Moving to Plesk Automation 11.5

WebPanel Manual DRAFT

Create a New Account Contents

The current version installed on your server is el6.x86_64 and it's the latest available.

Fasthosts Internet Parallels Plesk 10 Manual

Bigstep Server Management Service Details

Cloud Homework instructions for AWS default instance (Red Hat based)

WebHost Manager User Manual. cpanel

About this Guide Web Hosting...6 Concepts... 6

VPS Geek Guide. cpanel/whm

EZblue BusinessServer The All - In - One Server For Your Home And Business

Host your websites. The process to host a single website is different from having multiple sites.

SETTING UP A LAMP SERVER REMOTELY

Installation 42goISP Manager

Automated CPanel Backup Script. for home directory backup, remote FTP backup and Amazon S3 backup

Comodo MyDLP Software Version 2.0. Installation Guide Guide Version Comodo Security Solutions 1255 Broad Street Clifton, NJ 07013

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

Getting Started With Your Virtual Dedicated Server. Getting Started Guide

Parallels Cloud Server 6.0

OS Installation Guide Red Hat Linux 9.0

Plexxi Control Installation Guide Release 2.1.0

F-Secure Messaging Security Gateway. Deployment Guide

Using Webmin and Bind9 to Setup DNS Sever on Linux

Web Hosting: Pipeline Program Technical Self Study Guide

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

CN=Monitor Installation and Configuration v2.0

Deploying IBM Lotus Domino on Red Hat Enterprise Linux 5. Version 1.0

Parallels Cloud Server 6.0

Table 1-1. PXE Server Side Requirements

Create a virtual machine at your assigned virtual server. Use the following specs

Getting an ipath server running on Linux

INUVIKA OVD INSTALLING INUVIKA OVD ON RHEL 6

Spam Marshall SpamWall Step-by-Step Installation Guide for Exchange 5.5

42goISP Documentation

Install and configure Apache, MySQL, PHP on OSX 10.8 Mountain Lion

Connections and wiring Diagram

HOWTO: Set up a Vyatta device with ThreatSTOP in router mode

System Admin Module User Guide. Schmooze Com Inc.

INSTALLING KAAZING WEBSOCKET GATEWAY - HTML5 EDITION ON AN AMAZON EC2 CLOUD SERVER

Mohamed Zaki. Certificates and Training. Qualifications. Phone : Address: RedHat Certification ID :

EZblue BusinessServer The All - In - One Server For Your Home And Business

Switching Your DNS WiredTree

I N S T A L L A T I O N M A N U A L

Desktop : Ubuntu Desktop, Ubuntu Desktop Server : RedHat EL 5, RedHat EL 6, Ubuntu Server, Ubuntu Server, CentOS 5, CentOS 6

Parallels. for your Linux or Windows Server. Small Business Panel. Getting Started Guide. Parallels Small Business Panel // Linux & Windows Server

DevShop. Drupal Infrastructure in a Box. Jon Pugh CEO, Founder ThinkDrop Consulting Brooklyn NY

HOWTO: Set up a Vyatta device with ThreatSTOP in bridge mode

Load Balancing Microsoft AD FS. Deployment Guide

Apache 2.0 Installation Guide

How to Create, Setup, and Configure an Ubuntu Router with a Transparent Proxy.

Sponsor. Categories. Ubuntu Linux Tutorials,Howtos,Tips & News Quantal,Precise,Oneiric

HP CloudSystem Enterprise

Hadoop Multi-node Cluster Installation on Centos6.6

ISPConfig Documentation

Zimbra :: The Leader in Open Source Collaboration. Administrator's PowerTip #3: June 21, 2007 Zimbra Forums - Zimbra wiki - Zimbra Blog

See the installation page

LAMP Quickstart for Red Hat Enterprise Linux 4

owncloud 8 and DigitalOcean Matthew Davidson Bluegrass Linux User Group 03/09/2015

Written by: Johan Strand, Reviewed by: Chafic Nassif, Date: Getting an ipath server running on Linux

Data Center Automation with the VM-Series

1. An Introduction to cpanel. Welcome to Thanks for signing up. 2. How Domain Names work

Load Balancing McAfee Web Gateway. Deployment Guide

DKTCOMEGA AONode Management Module User Documentation

Using a login script for deployment of Kaspersky Network Agent to Mac OS X clients

Dell Proximity Printing Solution. Installation Guide

Building Website with Drupal 7

Server Installation/Upgrade Guide

Cybozu Garoon 3 Server Distributed System Installation Guide Edition 3.1 Cybozu, Inc.

VDCF - Virtual Datacenter Control Framework for the Solaris TM Operating System

Tunnel Client FAQ. Table of Contents. Version 0v5, November 2014 Revised: Kate Lance Author: Karl Auer

Semantic based Web Application Firewall (SWAF - V 1.6)

Plesk 11 Manual. Fasthosts Customer Support

Installing Virtual Coordinator (VC) in Linux Systems that use RPM (Red Hat, Fedora, CentOS) Document # 15807A1-103 Date: Aug 06, 2012

Advanced Internetworking

APACHE WEB SERVER. Andri Mirzal, PhD N

How To Install An Org Vm Server On A Virtual Box On An Ubuntu (Orchestra) On A Windows Box On A Microsoft Zephyrus (Orroster) 2.5 (Orner)

GlobalSign Solutions

Extending Remote Desktop for Large Installations. Distributed Package Installs

Ciphermail Gateway Separate Front-end and Back-end Configuration Guide

Your Server Support Looking after your servers, giving you peace of mind

Parallels Plesk Panel 11 for your Linux server

ALERT installation setup

Redmine Installation on Debian. v1.1

Transcription:

Closing the Loop: Automating Server Setups Vanessa Vasile, InMotion Hosting

Teeny bit about me... I'm currently a senior system administrator with InMotion Hosting, and I've been there about four years. IMH is one of the leading U.S. managed hosting providers offering shared, VPS, and dedicated hosting services. Some of my many responsibilities include solution implementation and maintaining quality of service. You can contact me via vanessav@inmotionhosting.com, or follow me on Twitter: http://twitter.com/nessa421 I also own thecpaneladmin.com, a free resource for cpanel administrators.

We'll talk about... How much time you spend setting up servers How to automate the installation of the OS + cpanel How to enable and configure services How to adjust common settings without touching WHM What scripts can save you time

How Much Time Do You Spend? cpanel + OS Install Service Setup & Config (You could've gone out for a beer around now) Rinse and repeat (how many servers do you have again?) Manually configure everything else

Why a Fully-Automated Solution? Time Mass-deployment Standardization

Automating the OS and cpanel Installation

Kick Start with the Kickstart Boot media (USB, CD, PXE, etc) /root/anaconda.cfg (Previous Install), or ksgen: http://sourceforge.net/projects/ksgen/

Sample Kickstart File install url url http://isoredirect.centos.org/centos/5/os/x86_64/ lang en_us.utf 8 keyboard us network device eth0 bootproto static ip 1.2.3.4 netmask 255.255.255.0 gateway 1.2.3.1 nameserver 4.2.2.2,4.2.2.1 hostname myserver.hostname rootpw iscrypted $1$Z6xdLawy$dfwreJN/tvj1787XXf6WQ/ firewall disabled authconfig enableshadow enablemd5 selinux disabled timezone utc America/Los_Angeles bootloader location=mbr driveorder=sda,sdb clearpart all part / fstype ext3 size=100 grow ondisk=sda part swap size=4000 ondisk=sda %packages @editors %post log=/root/setup.log yum y update wget http://layer2.cpanel.net/latest ; chmod 755 latest ;./latest sh downloadandrunmyawesomesetupscript...

Loading the Kickstart file

Tip: If you want to speed things up a bit, put all your configurations in place prior to starting the installation of cpanel So in other words, my presentation is bit backwards :)

Configure cpanel/whm /etc/wwwacct.conf : Basic cpanel/whm Config /var/cpanel/cpanel.config : a.k.a Tweak Settings /etc/cpupdate.conf : cpanel update prefs

/etc/wwwacct.conf Structure ADDR 5.6.7.8 CONTACTEMAIL my@email.address CONTACTPAGER DEFMOD x3 ETHDEV eth0 FTPTYPE proftpd HOMEDIR /home HOMEMATCH home HOST myserver.hostname LOGSTYLE combined MINUID NS ns1.mynameserver.com NS2 ns2.mynameserver.com NS3 NS4 NSTTL 86400 SCRIPTALIAS y TTL 14400

cpanel.config Correlates with WHM > Tweak Settings Example: echo nativessl=1 >> /var/cpanel/cpanel.config Apply: /usr/local/cpanel/whostmgr/bin/whostmgr2 updatetweaksettings Note: The hangup of the above command may halt a bash script! Try invoking it as so: trap "nohup /usr/local/cpanel/whostmgr/bin/whostmgr2 updatetweaksettings &" INT

WHM Setup Screen We can go ahead and get rid of that: touch /etc/.whostmgrft

Service Configuration

Nameserver Setup Nameservers specified in /etc/wwwacct.conf Reseller nameservers in: /var/cpanel/resellers-nameservers /scripts/setupnameserver <bind nsd disabled>

Need to set up DNS cluster? touch /var/cpanel/useclusteringdns mkdir p /var/cpanel/cluster/root/config (for root) DNS role: /var/cpanel/cluster/root/config/x.x.x.x-dnsrole Key file: /var/cpanel/cluster/root/config/x.x.x.x Take note: Each remote nameserver needs both a dnsrole and key file Your server's unique remote access key: /root/.accesshash

Cluster Example Set DNS role to sync instead of standalone : echo "sync" tr d "\n" > /var/cpanel/cluster/root/config/x.x.x.x dnsrole Sample key file format (using remote access key): root ns1.myremotenameserver.com <contents of RAK>

Exim Setup /etc/exim.conf.localopts : General config (corresp. WHM > Exim Configuration Editor) /etc/exim.conf.local : Additional config options template /scripts/buildeximconf

IMAP Server Setup /scripts/setupmailserver <courier dovecot disabled> Existing mail folders will be converted to appropriate formats automatically Converts mailserver setting in /var/cpanel/cpanel.config

IMAP Configuration Courier template: /var/cpanel/courierconfig.yaml Dovecot templates: /var/cpanel/conf/dovecot/main /var/cpanel/templates/dovecotx.x/main.default ( main.local) /scripts/builddovecotconf

FTP Server Setup /scripts/setupftpserver <pure-ftpd proftpd disabled> Configuration Templates: Pure-FTP: /var/cpanel/conf/pureftpd/main ProFTP: /var/cpanel/conf/proftpd/main Apply Configuration: /scripts/setupftpserver force <type>, or /usr/local/cpanel/whostmgr/bin/whostmgr2 doftpconfiguration

Sample FTP Template It's simple: Just list the settings you want to change Format: <option>: <value> yes/no values enclosed in single quotes AllowAnonymousFXP: 'no' AllowUserFXP: 'no' AnonymousCanCreateDirs: 'no' AnonymousCantUpload: 'yes' LimitRecursion: 10000 8 MaxClientsNumber: 150

MySQL Server To change the version: 1. Open /var/cpanel/cpanel.config 2. Edit value for mysql-version, save and exit 3. Run: /scripts/mysqlup Allowed values for mysql-version: 4.0, 4.1, 5.0, 5.1 Changing the MySQL version may require you to recompile PHP

Apache and PHP cpanel has extensive documentation on automating EasyApache builds, so I'll just go over the basics

Build Apache 1. Put this: 2. In here: MyEABuild.yaml /var/cpanel/easy/apache/profile/custom Q. Where do you get the YAML file? 3. Then run this: /scripts/easyapache --profile=myeabuild.yaml --build A. Save your last EasyApache build, and grab it from the profile folder

Tip: You can put your EasyApache build YAML file in /etc/cp_easyapache_profile.yaml, and the cpanel installer will use it Want to skip EasyApache altogether? touch /root/skipapache

Configure Apache WHM > Apache Configuration > Global Configuration: /var/cpanel/conf/apache/main local Main Apache Template: /var/cpanel/templates/apachex/main.default main.local To apply: /scripts/rebuildhttpdconf service httpd restart

Configure PHP Config file: /usr/local/lib/php.ini Change how PHP interacts with Apache: /usr/local/cpanel/bin/rebuild_phpconf <mainver> <php5api> <php4api> <suexec> Ex:./rebuild_phpconf 5 none suphp enabled Install major extensions: /scripts/phpextensionmgr install <modulename> Module names: Eaccelerator, IonCubeLoader, Zendopt, SourceGuardian, PHPSuHosin

Configuring MySQL /etc/my.cnf (What? Were you expecting something more complicated?) Easily change the MySQL root password: /scripts/mysqlpasswd root <password>

Misc Chkservd Configuration(WHM > Service Manager) /etc/chkservd/<servicename> /etc/chkservd/chkservd.conf Disable cpdavd: /usr/local/cpanel/etc/init/stopcpdavd touch /etc/cpdavddisable replace cpdavd:1 cpdavd:0 /etc/chkserv.d/chkservd.conf /scripts/restartsrv_chkservd Set up cphulkd: /usr/local/cpanel/bin/hulkdsetup Config file: /var/cpanel/cphulk.conf

Misc Configuration

Adding IP Addresses /etc/ips : Contains list of IP addresses, bound to the server as aliases of primary interface (specified in /etc/wwwacct.conf) Format: <ip>:<mask>:<broadcast> echo 1.1.1.1:255.255.255.0:1.1.1.255 >> /etc/ips service ipaliases reload /scripts/rebuildippool Reserving IPs (WHM > Show/Edit Reserved IPs) echo 1.1.1.1 >> /etc/reservedips echo 1.1.1.1: idontliketoshare >> /etc/reservedipreasons

Packages, Features, & Web Templates Packages: /var/cpanel/packages/<name> Features: /var/cpanel/features/<name> *lists features that are disabled Web Templates: (default, suspended, move, and connection selection pages) /var/cpanel/webtemplates/<user>/<lang>/<templatename> <user> refers to the account owner (root or reseller user) <lang> refers to the cpanel language (ex: english) <templatename> values are listed in WHM > Web Template Editor

Branding The easiest way I've found to do this is by simply tar'ing up the cpanelbranding folder and unpacking it to: /var/cpanel/userhomes/cpanel/cpanelbranding/ (root) /home/<user>/cpanelbranding (reseller)

A couple things for email... /etc/localaliases : Routes system email, ex: cpanel: my@emailaddress nobody: wheremyspamgoes@mail.com root: my@emailaddress SMTP Tweak: /scripts/smtpmailgidonly <on off>

Misc Tips & Tricks

Invoking WHM Functionality Note: cpanel developers have stated that they don't recommend invoking WHM this way. https://localhost:2087/scripts2/setrhash /usr/local/cpanel/whostmgr/bin/whostmgr2 setrhash https://localhost:2087/scripts4/... /usr/local/cpanel/whostmgr/bin/whostmgr4...

Sexy time-savers Install RoR/Mongrel: /scripts/installruby Install ImageMagick: /scripts/installimagemagick Install a Perl module: /scripts/perlinstaller Module::Name Install PostgreSQL: /scripts/installpostgres

Configuration Management Question: How do you intend on storing, deploying, tracking, securing, and verifying your configs? Just a couple of ideas: Simple HTTP repo (wget) Version control (Git, Subversion) RPMs (If you're into that kind of thing)

Questions?