{"id":1158,"date":"2012-03-01T16:00:57","date_gmt":"2012-03-01T21:00:57","guid":{"rendered":"http:\/\/mossiso.com\/?p=1158"},"modified":"2013-02-01T12:45:19","modified_gmt":"2013-02-01T17:45:19","slug":"setting-up-a-hosting-environment-part-1-the-servers","status":"publish","type":"post","link":"https:\/\/mossiso.com\/2012\/03\/01\/setting-up-a-hosting-environment-part-1-the-servers\/","title":{"rendered":"Setting up a Hosting Environment: Part 1 &#8211; The servers"},"content":{"rendered":"<p>I&#8217;ve spent a lot of time at work setting up a few servers to be our new production environment. Much of it was accomplished by reading the documentation over and over again. Not much out there on the Net, so I&#8217;m hoping this series of posts benefits someone else out there.<\/p>\n<p>First of all, I&#8217;ll cover what set up I would like to achieve and why.<\/p>\n<h4>Hardware<\/h4>\n<p>I&#8217;m using two Sun SunFire X2100 M2 connected to a StorageTek 2530 with 4.5TB of drive space. The servers attach to the storage array via SCSI cables for quick data transfer speeds. The array also has the ability to handle iSCSI connections. This will give me a decent base set up, with room to grow.<\/p>\n<h4>Set up<\/h4>\n<p>I&#8217;ll put the two servers in a cluster and make the services available over the cluster. They will share the storage using GFS2. In the future, I&#8217;ll add a couple of load balancer\/proxy machines to farm out the Web traffic, and add a couple more SunFire X2100 M2&#8217;s to take that load. One of the main reasons to set up a new configuration with new servers is to provide a clean environment for the many WordPress and Omeka installations we host. We&#8217;ve had to hang on to some legacy services to support some older projects, so this will allow us to keep up to date. It will also allow me to set up Apache and PHP to run as a server user, locked down to it&#8217;s own directory. That way each of the 100+ sites won&#8217;t be able to access any other site&#8217;s content. I picked CentOS as the OS because it has cluster and GFS2 options of RedHat, but without the cost.<\/p>\n<p><a href=\"http:\/\/mossiso.com\/wp-content\/uploads\/2012\/03\/CHNMproduction.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1159 alignnone\" title=\"CHNMproduction\" src=\"http:\/\/mossiso.com\/wp-content\/uploads\/2012\/03\/CHNMproduction.png\" alt=\"\" width=\"525\" height=\"647\" srcset=\"https:\/\/mossiso.com\/wp-content\/uploads\/2012\/03\/CHNMproduction.png 525w, https:\/\/mossiso.com\/wp-content\/uploads\/2012\/03\/CHNMproduction-243x300.png 243w, https:\/\/mossiso.com\/wp-content\/uploads\/2012\/03\/CHNMproduction-250x308.png 250w, https:\/\/mossiso.com\/wp-content\/uploads\/2012\/03\/CHNMproduction-121x150.png 121w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/a><\/p>\n<h2>Sun X2100 M2 OS Install steps<\/h2>\n<ol>\n<li>Boot up with CentOS 6.x Minimal Install CD for x86_64<\/li>\n<li>Select the option to \u2018Install or upgrade an existing system\u2019, then hit the Enter key<\/li>\n<li>Skip the media test.<\/li>\n<li>You are now in graphic install mode.<\/li>\n<li>Hit Enter for \u2018OK\u2019 for \u2019English as the language.<\/li>\n<li>Hit Enter for \u2018OK\u2019 to US keyboard.<\/li>\n<li>Select the option to do a \u201cSpecialized Storage Devices\u201d install<\/li>\n<li>Enter the computer name \u2018bill.com\u2019 or \u2018ted.com\u2019, etc<\/li>\n<li>Click the button to \u2018Configure Network\u2019.\n<ol>\n<li>Eth2 seems to be the one associated with port 0 on the servers, so select that one and then \u2018Add\u2019<\/li>\n<li>Select \u2018Connect Automatically\u2019.<\/li>\n<li>Click the \u2018IPv4 Settings\u2019 tab.<\/li>\n<li>Choose \u2018Manual\u2019 for the \u2018Method\u2019.<\/li>\n<li>Enter the following for the info in \u2018Addresses\u2019.\n<ol>\n<li>Address: 192.168.1.1<\/li>\n<li>Netmask: 255.255.255.0<\/li>\n<li>Gateway: 192.168.1.1<\/li>\n<\/ol>\n<\/li>\n<li>For \u2018DNS servers\u2019, enter 192.168.1.100<\/li>\n<li>Then \u2018Apply\u2019<\/li>\n<\/ol>\n<\/li>\n<li>Select \u2018Next\u2019 to keep the defaults for time zone and system clock.<\/li>\n<li>Enter a root password<\/li>\n<li><strong>DRIVE PARTITION SETUP<\/strong>\n<ol>\n<li>On the \u2018Basic Devices\u2019 tab, select the local drive and on the \u2018Multipath Devices\u2019 tab, select the storage array, and click \u2018Next\u2019.<\/li>\n<li>Select the \u2018Fresh Installation\u2019 option for a fresh install, or \u2018Upgrade an Existing Installation\u2019 to upgrade. Hit \u2018Next\u2019.<\/li>\n<li>Select \u2018Create custom layout.\u2019 and \u2018Next\u2019<\/li>\n<li>Delete all of the current LVM and other partitions.<\/li>\n<li>Select the free remaining drive for the local drive (should be \/dev\/sda). Click \u2018Create\u2019<\/li>\n<li><strong>BOOT PARTITION<\/strong>\n<ol>\n<li>Select \u2018Standard Partition\u2019 and click \u2018Create\u2019<\/li>\n<li>Set the Mount Point as <code>\/boot<\/code>, the File System Type as \u2018ext4\u2019 and the Size (MB) as 500, then click \u2018OK\u2019<\/li>\n<\/ol>\n<\/li>\n<li>Select the free space and click \u2018Create\u2019<\/li>\n<li><strong>LVM PARTITION<\/strong>(NOTE: The sizes are different based on the size of the hard drives.)\n<ol>\n<li>Select \u2018LVM Physical Volume\u2019 and click \u2018Create\u2019<\/li>\n<li>Select \u2018Fill to maximum allowable size\u2019 and click \u2018OK\u2019<\/li>\n<li>Select the new LVM partition and click \u2018Create\u2019<\/li>\n<li>Select \u2018LVM Volume Group\u2019 and click \u2018Create\u2019<\/li>\n<li>Set the \u2018Volume Group Name\u2019 as \u2018Local\u2019\u00a0 then click the \u2018Add\u2019 button<\/li>\n<li>Set the \u2018File System Type\u2019 as swap, the \u2018Logical Volume Name\u2019 as \u2018swap\u2019 and the \u2018Size(MB)\u2019 as \u201812288\u2019, then click \u2018OK\u2019.<\/li>\n<li>Click the \u2018Add\u2019 button again. Set the \u2018Mount Point\u2019 to \u2018\/\u2019, the \u2018File System Type\u2019 to ext4, the \u2018Logical Volume Name\u2019 to \u2018root\u2019, and the \u2018Size(MB)\u2019 to \u201851200\u2019. Then click \u2018OK\u2019.<\/li>\n<li>Click the \u2018Add\u2019 button again. Set the \u2018Mount Point\u2019 to \u2018\/home\u2019, the \u2018File System Type\u2019 to ext4, the \u2018Logical Volume Name\u2019 to \u2018home\u2019, and the \u2018Size(MB)\u2019 to \u2018500\u2019. Then click \u2018OK\u2019.<\/li>\n<li>Click the \u2018Add\u2019 button again. Set the \u2018Mount Point\u2019 to \u2018\/var\u2019, the \u2018File System Type\u2019 to ext4, the \u2018Logical Volume Name\u2019 to \u2018var\u2019, and the \u2018Size(MB)\u2019 to the remaining space available. Then click \u2018OK\u2019.<\/li>\n<li>Click \u2018OK\u2019<\/li>\n<\/ol>\n<\/li>\n<li>Click \u2018Next\u2019 and \u2018Write changes to disk\u2019 to finish the partition creation.<\/li>\n<\/ol>\n<\/li>\n<li>Leave the boot loader settings as is, and click \u2018Next\u2019<\/li>\n<li>Select the \u2018Minimal\u2019 option and click \u2018Next\u2019<\/li>\n<\/ol>\n<p>One of the most important things to have with servers is some form of remote management. That way you don&#8217;t need to trek down to the data center each time the server hangs while testing (and it happens a lot). For Sun systems, that means setting up the ELOM (Embedded Lights Out Manager).<\/p>\n<h2>Steps to set up the Remote Console (Embedded Lights Out Manager \u2013 ELOM) for SunFire X2100 M2<\/h2>\n<h3>Set the SP serial port rate to 115200.<\/h3>\n<ul>\n<li>Log into the web based console, or through ssh via a computer on the same subnet (https:\/\/192.168.1.10) The IP is whatever the IP is set for the ELOM device. Check in BIOS for the IP.\n<ul>\n<li>Go to the Configuration tab, then the Serial Port tab.<\/li>\n<li>Change the Baud Rate to 115200.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Set BIOS<\/h3>\n<pre>IPMI Config\r\n   Set LAN Config\r\n   Set PEF Config\r\n     PEF Support ........ [Enabled]\r\n     PEF Action Global\r\n        All of them ..... [Enabled]\r\n     Alert Startup Discover ..... [Disabled]\r\n     Startup Delay .............. [Disabled]\r\n     Event Message For PEF ...... [Disabled]\r\n   BMC Watch Dog Timer Action ... [Disabled]\r\n   External Com Port ............ [BMC]\r\nRemote Access\r\n   Remote Access ................ [Serial]\r\n   Serial Port Number ........... [Com2]\r\n   Serial Port Mode ............. [115200 8,n,1]\r\n   Flow Control ................. [Hardware]\r\n   Post-Boot Support ............ [Always]\r\n   Terminal Type ................ [VT100]\r\n   VT-UTF8 Combo Key ............ [Enabled]<\/pre>\n<ul>\n<li>Other options for the Serial Port Mode are 9600, 19200, 38400, and 57600<\/li>\n<\/ul>\n<h3>Edit Linux Config Files<\/h3>\n<h4>Add a \/etc\/init\/serial-ttyS1.conf file<\/h4>\n<p>RedHat in EL 6, and thereby CentOS, moved to Upstart instead of Sysv, so we create a new serial-ttyS1.conf file instead of editing the \/etc\/inittab file.<\/p>\n<pre style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">#  This service maintains a getty on \/dev\/ttyS1.\r\nstop on runlevel [016]\r\n\r\nrespawn\r\ninstance $TTY\r\nexec \/sbin\/mingetty $TTY<\/pre>\n<h4>Change grub.conf<\/h4>\n<pre style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\"># grub.conf generated by anaconda\r\n#\r\n# Note that you do not have to rerun grub after making changes to this file\r\n# NOTICE:  You have a \/boot partition.  This means that\r\n#          all kernel and initrd paths are relative to \/boot\/, eg.\r\n#          root (hd0,0)\r\n#          kernel \/vmlinuz-version ro root=\/dev\/Logical\/root\r\n#          initrd \/initrd-version.img\r\n#boot=\/dev\/sda\r\ndefault=0\r\ntimeout=5\r\n#splashimage=(hd0,0)\/grub\/splash.xpm.gz\r\n#hiddenmenu\r\nserial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\r\nterminal --timeout=10 serial console\r\n\r\ntitle CentOS Linux (2.6.32-71.29.1.el6.x86_64)\r\n        root (hd0,0)\r\n        kernel \/vmlinuz-2.6.32-71.el6.x86_64 ro root=\/dev\/mapper\/Local-root \\\r\nrd_LVM_LV=Local\/root rd_LVM_LV=Local\/swap rd_NO_LUKS rd_NO_MD rd_NO_DM \\\r\nconsole=tty1 console=ttyS1,115200n8\r\n          initrd \/initramfs-2.6.32-71.29.1.el6.x86_64.img<\/pre>\n<h4>Add line to securetty<\/h4>\n<pre style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">console\r\nvc\/1\r\nvc\/2\r\nvc\/3\r\nvc\/4\r\nvc\/5\r\nvc\/6\r\nvc\/7\r\nvc\/8\r\nvc\/9\r\nvc\/10\r\nvc\/11\r\ntty1\r\ntty2\r\ntty3\r\ntty4\r\ntty5\r\ntty6\r\ntty7\r\ntty8\r\ntty9\r\ntty10\r\ntty11\r\nttyS1<\/pre>\n<hr \/>\n<h3>SUN SP Commands<\/h3>\n<p>Connect to the ELOM by ssh into the IP address.<br \/>\n<code>ssh root@192.168.xxx.xxx<\/code><\/p>\n<ul>\n<li>To power on the host, enter the following command:\n<ul>\n<li><code>set \/SP\/SystemInfo\/CtrlInfo PowerCtrl=on<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>To power off the host gracefully, enter the following command:\n<ul>\n<li><code>set \/SP\/SystemInfo\/CtrlInfo PowerCtrl=gracefuloff<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>To power off the host forcefully, enter the following command:\n<ul>\n<li><code>set \/SP\/SystemInfo\/CtrlInfo PowerCtrl=forceoff<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>To reset the host, enter the following command:\n<ul>\n<li><code>set \/SP\/SystemInfo\/CtrlInfo PowerCtrl=reset<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>To reboot and enter the BIOS automatically, enter the following command:\n<ul>\n<li><code>set \/SP\/SystemInfo\/CtrlInfo BootCtrl=BIOSSetup<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>To change the IP address for the ELOM, enter:\n<ul>\n<li><code>set \/SP\/AgentInfo IpAddress=xxx.xxx.xxx.xxx <\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>The default user name is <code>root<\/code>, and the default password is <code>changeme<\/code>.\n<ul>\n<li><code>set \/SP\/User\/[username] Password=[password]<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>To start a session on the server console, enter this command:\n<ul>\n<li><code>start \/SP\/AgentInfo\/console<\/code><\/li>\n<li>To revert to CLI once the console has been started, press <code>Esc-Shift-9<\/code> keys.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>\u2028To terminate a server console session started by another user, enter this command:\n<ul>\n<li><code>stop \/SP\/AgentInfo\/console<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Next we secure the new servers with some software updates and a firewall.<\/p>\n<h2>Software Updates and installs:<\/h2>\n<ol>\n<li>Edit <code>\/etc\/resolve.conf<\/code><\/li>\n<li>\n<div>nameserver 192.168.1.100<br \/>\noptions single-request-reopen<\/p>\n<ul>\n<li>The last line <code>options single-request-reopen<\/code> takes care of slow SSH logins. See here <a href=\"https:\/\/stomp.colorado.edu\/blog\/blog\/2011\/06\/29\/on-rhel-6-ssh-dns-firewalls-and-slow-logins\/\">https:\/\/stomp.colorado.edu\/blog\/blog\/2011\/06\/29\/on-rhel-6-ssh-dns-firewalls-and-slow-logins\/<\/a> and here <a href=\"http:\/\/www.linuxquestions.org\/questions\/showthread.php?p=4399340#post4399340\">http:\/\/www.linuxquestions.org\/questions\/showthread.php?p=4399340#post4399340<\/a> for more info.<\/li>\n<\/ul>\n<\/div>\n<\/li>\n<li><code>yum install openssh-clients tcsh ksh bc rpm-build gcc gcc-c++ redhat-rpm-config acl gcc gnupg make vim-enhanced man wget which mlocate bzip2-devel libxml2-devel screen sudo parted gd-devel pam_passwdqc.x86_64 rsync zip xorg-x11-server-utils gettext<\/code><\/li>\n<li>disable SELinux. Edit the <code>\/etc\/sysconfig\/selinux<\/code> file and set <code>SELINUX=disabled<\/code>.\n<ul>\n<li>Change takes affect on next reboot.<\/li>\n<\/ul>\n<\/li>\n<li>Add the following lines to the <code>\/etc\/vimrc<\/code>file:\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">set autoindent &#8221; auto indent after {<br \/>\nset smartindent &#8221; same<br \/>\nset shiftwidth=4 &#8221; number of space characters inserted for indentation<br \/>\nset expandtab &#8221; inserts spaces instead of tabs<br \/>\nset tabstop=4 &#8221; number of spaces the tab is.<br \/>\nset pastetoggle=&lt;C-P&gt; &#8221; Ctrl-P toggles paste mode<\/div>\n<\/li>\n<li>Switch root shell to <code>tcsh<\/code>\n<ul>\n<li>Edit the <code>\/etc\/passwd<\/code>file to have root use tcsh<code>root:x:0:0:root:\/root:\/bin\/tcsh<\/code><\/li>\n<li>Edit the <code>.tcshrc<\/code>file in root\u2019s home.\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">#\u00a0 .tcshrc#\u00a0 User specific aliases and functionsalias rm &#8216;rm -i&#8217;<br \/>\nalias cp &#8216;cp -i&#8217;<br \/>\nalias mv &#8216;mv -i&#8217;set prompt='[%n@%m %c]# &#8216;<\/p>\n<p>setenv PATH ${PATH}:\/opt\/sun\/cam\/bin<\/p>\n<p>#\u00a0 Make command completion (TAB key) cycle through all possible choices<br \/>\n#\u00a0 (The default is to simply display a list of all choices when more than one<br \/>\n#\u00a0 match is available.)<br \/>\nbindkey &#8220;^I&#8221; complete-word-fwd<\/p>\n<\/div>\n<\/li>\n<li>Logout and back in for it to take affect.<\/li>\n<\/ul>\n<\/li>\n<li>Edit <code>\/etc\/hosts<\/code>. Add a line with IP and domain name.\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">#\u00a0 Do not remove the following line, or various programs<br \/>\n#\u00a0 that require network functionality will fail.<br \/>\n127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4<br \/>\n::1 localhost localhost.localdomain localhost6 localhost6.localdomain6#\u00a0 External IPs<br \/>\n192.168.1.1 bill.com<br \/>\n192.168.1.2 ted.com192.168.1.3 domain.com # this needs to be an IP that the cluster server can manage#\u00a0 Internal IPs<br \/>\n192.168.1.11 bill.localdomain bill # notice the .localdomain, this is necessary for mysql later<br \/>\n192.168.1.12 ted.localdomain ted othernode # this is bill&#8217;s hosts file. othernode would be on the bill line for ted&#8217;s hosts file.<br \/>\n#\u00a0 ServicePort IPs<br \/>\n192.168.1.21 billsp # I like to have a short name to use to connect to the service port (ELOM)<br \/>\n192.168.1.22 tedsp<\/p>\n<p>#\u00a0 Internal Services<br \/>\n192.168.1.100 http.localdomain httpd.localdomain<br \/>\n192.168.1.101 mysql.localdomain<br \/>\n192.168.1.102 memcached.localdomain<\/p>\n<\/div>\n<\/li>\n<li>Run <code>updatedb<\/code> to set up the <code>locate<\/code> database.<\/li>\n<li>Edit password settings to allow for stricter control over passwords. This requires strong passwords or the use of passphrases.\n<ul>\n<li>Check here for updated info: <a href=\"http:\/\/www.nsa.gov\/ia\/guidance\/security_configuration_guides\/operating_systems.shtml#linux2\">http:\/\/www.nsa.gov\/ia\/guidance\/security_configuration_guides\/operating_systems.shtml#linux2<\/a><\/li>\n<li>Edit the <code>\/etc\/pam.d\/system-auth<\/code>file. Change the line<code>password requisite pam_cracklib.so try_first_pass retry=3<\/code>to this<code>password requisite pam_passwdqc.so min=disabled,disabled,16,12,8<\/code><\/li>\n<\/ul>\n<\/li>\n<li>[Optional] Firefox: <code>yum update<\/code>, and then a<code>yum install firefox xorg-x11-xauth xorg-x11-fonts-Type1<\/code>There will be more you\u2019ll need too.\n<ul>\n<li>If you get this error: <code>process 702: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open \"\/var\/lib\/dbus\/machine-id\": No such file or directory<\/code>. Then run the following command as root.\n<ul>\n<li><code>dbus-uuidgen &gt; \/var\/lib\/dbus\/machine-id<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Set up ssh keys\n<ul>\n<li><code>ssh-keygen<\/code><\/li>\n<li>Copy the id_rsa.pub file to the other node<\/li>\n<li>Copy the contents of id_rsa.pub to <code>cat id_rsa.pub &gt;&gt; ~\/.ssh\/authorized_keys<\/code><\/li>\n<li>Double check permission on <code>authorized_keys<\/code> and <code>id_rsa<\/code> both set to <code>rw-------<\/code><\/li>\n<li>You should now be able to log in from bill to ted (and vice versa) without a password.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre><\/pre>\n<h2>Shorewall<\/h2>\n<ul>\n<li>Yum Install:\n<ul>\n<li>Get EPEL repository. Visit <a href=\"http:\/\/fedoraproject.org\/wiki\/EPEL\">http:\/\/fedoraproject.org\/wiki\/EPEL<\/a> to get the URL for the correct rpm. Something like: epel-release-6-5.noarch.rpm.<\/li>\n<li>Copy that URL and run<code>rpm -Uvh http:\/\/download.fedoraproject.org\/pub\/epel\/6\/i386\/epel-release-6-5.noarch.rpm<\/code>on the machine.<\/li>\n<li>Edit the <code>\/etc\/yum.repos.d\/epel.repo<\/code> file and set the first \u201cenabled\u201d line to equal 0. That disables yum from using the EPEL repo by default.<\/li>\n<li>Install shorewall with yum.<code>yum --enablerepo=epel install shorewall<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Enable program to run by editing the <code>\/etc\/shorewall\/shorewall.conf<\/code> file. Change the <code>STARTUP_ENABLED=NO<\/code>to<code>STARTUP_ENABLED=Yes<\/code><\/li>\n<li>Edit the shorewall config files.<\/li>\n<li>Edit the <code>\/etc\/shorewall\/zones<\/code>file:\n<ul>\n<li>\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">#<br \/>\n#\u00a0 Shorewall version 4 \u2013 Zones File<br \/>\n#<br \/>\n#\u00a0 For information about this file, type \u201cman shorewall-zones\u201d<br \/>\n#<br \/>\n#\u00a0 The manpage is also online at<br \/>\n#\u00a0 http:\/\/www.shorewall.net\/manpages\/shorewall-zones.html<br \/>\n#<br \/>\n###############################################################################<br \/>\n#ZONE TYPE OPTIONS IN OUT<br \/>\n#\u00a0 OPTIONS OPTIONSnet ipv4 # The big bad Internet<br \/>\nloc ipv4 # Internal LAN<br \/>\nfw firewall#LAST LINE \u2013 ADD YOUR ENTRIES ABOVE THIS ONE \u2013 DO NOT REMOVE#LAST LINE \u2013 ADD YOUR ENTRIES ABOVE THIS ONE \u2013 DO NOT REMOVE<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>Edit the <code>\/etc\/shorewall\/interfaces<\/code>file:\n<ul>\n<li>\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">#<br \/>\n#\u00a0 Shorewall version 4 \u2013 Interfaces File<br \/>\n#<br \/>\n#\u00a0 For information about entries in this file, type \u201cman shorewall-interfaces\u201d<br \/>\n#<br \/>\n#\u00a0 The manpage is also online at<br \/>\n#\u00a0 http:\/\/www.shorewall.net\/manpages\/shorewall-interfaces.html<br \/>\n#<br \/>\n###############################################################################<br \/>\n#ZONE INTERFACE BROADCAST OPTIONS<br \/>\nnet eth2<br \/>\nloc eth1<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>Edit the <code>\/etc\/shorewall\/policy<\/code>file:\n<ul>\n<li>\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">###############################################################################<br \/>\n#SOURCE DEST POLICY LOG LIMIT: CONNLIMIT:<br \/>\n#\u00a0 LEVEL BURST MASK<br \/>\n#\u00a0 To\/from internal lan<br \/>\nfw loc ACCEPT<br \/>\nloc fw ACCEPT<br \/>\n#\u00a0 To\/from net<br \/>\nfw net ACCEPT<br \/>\nnet all DROP info<br \/>\n#<br \/>\n#\u00a0 THE FOLLOWING POLICY MUST BE LAST<br \/>\n#<br \/>\nall all REJECT info<br \/>\n#LAST LINE \u2014 DO NOT REMOVE<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>Edit the <code>\/etc\/shorewall\/rules<\/code>file:\n<ul>\n<li>\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">######################################################################################<br \/>\n#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL<br \/>\n#\u00a0 PORT <acronym title=\"S\">PORT<\/acronym> DEST<br \/>\n#SECTION ESTABLISHED<br \/>\n#SECTION RELATED<br \/>\nSECTION NEWSECTION NEW#\u00a0 Standard services<br \/>\n#<br \/>\nACCEPT \u00a0net \u00a0\u00a0\u00a0\u00a0 fw \u00a0\u00a0\u00a0\u00a0 tcp \u00a0\u00a0\u00a0 ssh<br \/>\nACCEPT \u00a0net \u00a0\u00a0\u00a0\u00a0 fw \u00a0\u00a0\u00a0\u00a0 tcp \u00a0\u00a0\u00a0 80,443Ping\/ACCEPT \u00a0\u00a0\u00a0\u00a0 net \u00a0\u00a0\u00a0\u00a0 fw<\/p>\n<p>#LAST LINE \u2014 ADD YOUR ENTRIES BEFORE THIS ONE \u2014 DO NOT REMOVE<\/p>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>Edit the <code>\/etc\/shorewall\/routestopped<\/code>file:\n<ul>\n<li>\n<div style=\"border: 1px solid; font-family: 'Courier New', Courier, monospace; color: #444; padding: 8px;\">#<br \/>\n#\u00a0 Shorewall version 4 \u2013 Routestopped File<br \/>\n#<br \/>\n#\u00a0 For information about entries in this file, type \u201cman shorewall-routestopped\u201d<br \/>\n#<br \/>\n#\u00a0 The manpage is also online at<br \/>\n#\u00a0 http:\/\/www.shorewall.net\/manpages\/shorewall-routestopped.html<br \/>\n#<br \/>\n#\u00a0 See http:\/\/shorewall.net\/starting_and_stopping_shorewall.htm for additional<br \/>\n#\u00a0 information.<br \/>\n#<br \/>\n###############################################################################<br \/>\n#INTERFACE <acronym title=\"S\">HOST<\/acronym> OPTIONS PROTO DEST SOURCE<br \/>\n#\u00a0 <acronym title=\"S\">PORT<\/acronym> <acronym title=\"S\">PORT<\/acronym><br \/>\neth1\u00a0\u00a0\u00a0\u00a0 &#8211;<br \/>\neth2 \u00a0\u00a0\u00a0\u00a0&#8211;<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>Set shorewall to start on reboots.<code>chkconfig shorewall on<\/code><\/li>\n<li>Start shorewall:<code>service shorewall start<\/code><\/li>\n<\/ul>\n<p>The next part will be <a title=\"Setting up a Hosting Environment: Part 1 \u2013 The servers\" href=\"http:\/\/mossiso.com\/2012\/03\/01\/setting-up-a-hosting-environment-part-1-the-servers.html\">connecting the servers to the storage array<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve spent a lot of time at work setting up a few servers to be our new production environment. Much of it was accomplished by reading the documentation over and over again. Not much out there on the Net, so I&#8217;m hoping this series of posts benefits someone else out there. First of all, I&#8217;ll &hellip; <a href=\"https:\/\/mossiso.com\/2012\/03\/01\/setting-up-a-hosting-environment-part-1-the-servers\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Setting up a Hosting Environment: Part 1 &#8211; The servers<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1167,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[249,167],"tags":[179],"class_list":["post-1158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-setting-up-a-hosting-environment","category-technical","tag-servers"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/mossiso.com\/wp-content\/uploads\/2012\/03\/DSCN7152-copy.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9wosP-iG","_links":{"self":[{"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/posts\/1158"}],"collection":[{"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/comments?post=1158"}],"version-history":[{"count":11,"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/posts\/1158\/revisions"}],"predecessor-version":[{"id":1432,"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/posts\/1158\/revisions\/1432"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/media\/1167"}],"wp:attachment":[{"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/media?parent=1158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/categories?post=1158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mossiso.com\/wp-json\/wp\/v2\/tags?post=1158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}