Overclock.net › Forums › Specialty Builds › Servers › Project Servercycle: 0 Dollars, 1 (Vague) Server Farm
New Posts  All Forums:Forum Nav:

Project Servercycle: 0 Dollars, 1 (Vague) Server Farm

post #1 of 7
Thread Starter 
wheee.gifNow with pictures! yessir.gif

As many of you have, I'm sure, experienced, through several years of acting as the go-to IT guy for family/friends/neighbors' cats, people tend to chuck old PCs our way. When they decide to get a new computer, I go set it up, transfer data, and am promptly asked if I'd like the old one. Generally, these offers are always accepted and I then put the computer through triage: any minor hardware issue means recycling, if it's still running fine but is old, it gets stored in the basement, with the hope of one day achieving something with it like some sort of maniacal PC hoarder.

Needless to say, I now have several top-of-the-line dust collectors in the basement.

And by several, I mean three.

And by now, I mean the past, for I've finally decided to recycle all of my old tech into something useful, and I thus introduce Project Servercycle.

The goal here is to spend absolutely no money, and use only the stuff lying around my house to build a server "farm" in my living room from which I'll host my dev server for web projects. As of right now I already have an old laptop operating as a web server which has been working flawlessly, but I figured why not expand.

The hardware is:
  • One (1) Netgear WNDR3700v2 (currently used router)
  • One (1) HP Tablet PC (currently used web server)
  • One (1) Sony Vaio VGC-RB30
  • One (1) Sony Vaio PCV-2242
  • One (1) Compaq Presario SR1151NX
  • One (1) Linksys WRT54Gv2

One of the biggest goals for this setup will be upgrade-ability: being able to easily add in, or switch out, computers without resetting the whole thing up, as I'm sure I'll be getting more and more computers as the year progresses.

Since my Netgear is already pretty much filled up when it comes to Ethernet ports, the Linksys (also pulled out my basement and still fully functional biggrin.gif) will act as a switch for hooking all the PCs up.

All of the PCs will be wiped and hard drive integrity checked, and will be running the minimal CentOS 6.3 setup to maximize performance. Right now I'm thinking of setting the strongest of the PCs up with BIND and using it as the DNS server, which'll run all load-balancing tasks, and then the laptop + 2 other desktops will be standard Apache+MySQL+PHP machines. Any setup suggestion/tips would be greatly appreciated..

Any comments appreciated!
crazyap7

Index
Chapter 1: The Dust, the Leaf Blower, and the Install Disc
Chapter 2: EPEL and Remi, sittin' in a tree...
Edited by crazyap7 - 10/29/12 at 8:16pm
post #2 of 7
Thread Starter 
Chapter 1: The Dust, the Leaf Blower, and the Install Disc

As can be expected of old machines that have sat on carpets most of their lives, these geezers were actively participating in a fairly convincing Dust Bowl re-enactment. Cue leaf blower.



Protip: use small bits of tape to avoid destroying your fans. I had already cleaned out Vaio PCV-2242 a couple days before, these are the other two. After cleaning, I got everyone together for a group shot.



And finally, I pulled together a Dell AT101w and a rolly-ball-thing PS/2 mouse from my very first computer, an eMachines, to start setting up.
Not sure if any of these can run 64-bit, so I burned both 32- and 64-bit ISOS just to be safe.



Beginning install!

EDIT:
Checked all the hard drives, and everyone checked out ok!

Compaq:


Vaio PCV-2242:


Vaio VGC-RB30:


And on a side note, none of them have 64-bit CPUs frown.gif A+ for thinking ahead with the 32-bit CD rolleyes.gif

EDIT2:
All 3 have been setup identically: install Centos 6.3 32-bit, establish connection on eth0, update packages, install nano (just because vi is too tedious thumb.gif). I've left the laptop as is for now as I still have some projects on it.

Terminal commands (this is after logging in as root, as made during the OS install)
Code:
ifconfig eth0 up
dhclient eth0
yum check-update
yum update
yum install nano
  1. Bring online the ethernet port
  2. Request an IP address from the DHCP server (the router, in this case)
  3. Use CentOS's package manager (yum) and check repositories for updates
  4. Install update
  5. Install nano

Calling it quits for tonight. Not sure if I'll have time to work on it over the week, but next installment should involve setting up the three servers to be identical Apache machines + SSH, and then messing around with BIND and load-balancing algorithms.
I'll try and be as explicit as possible to help anyone interested in setting up their own servers at home, it's much easier than you might think smile.gif
Edited by crazyap7 - 10/28/12 at 8:14pm
post #3 of 7
Usually older systems don't have the compute power per watt to be worth it as far as electricity cost, but can be fun to assemble as a hobby/training.
Le Rig
(15 items)
 
Chromebook
(6 items)
 
 
CPUMotherboardGraphicsRAM
1.7 GHz Samsung Exynos 5 Samsung Chromebook 3 ARM Mali-T604 2 GB DDR3L 
Hard DriveOS
16 GB SSD Chrome OS 
  hide details  
Reply
Le Rig
(15 items)
 
Chromebook
(6 items)
 
 
CPUMotherboardGraphicsRAM
1.7 GHz Samsung Exynos 5 Samsung Chromebook 3 ARM Mali-T604 2 GB DDR3L 
Hard DriveOS
16 GB SSD Chrome OS 
  hide details  
Reply
post #4 of 7
Thread Starter 
Quote:
Originally Posted by beers View Post

Usually older systems don't have the compute power per watt to be worth it as far as electricity cost, but can be fun to assemble as a hobby/training.

A buddy of mine mentioned that to me as well :/ As far as this project, I doubt I'll be able to pull huge performance out of these machines, but definitely a good learning experience which is mostly why I'm doing it smile.gif
post #5 of 7
Subbed! I'm really looking forward to following this thread! I can't wait to see what you do with all of this and being a network dummy, I'll probably learn something in the process!thumb.gif
Phantom 1.0
(16 items)
 
PAIN
(11 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 3930K P9X79 PRO NVIDIA GeForce GTX 560  Samsung  
RAMHard DriveHard DriveOptical Drive
Samsung  Crucial M4 64GB SSD Seagate Barracuda 1TB ASUS 24x DVD Burner 
CoolingOSOSMonitor
NH-D14 Windows 7 Ultamite 64 bit Fedora 17 ASUS VW246H Glossy Black 24" HDMI Widescreen LC... 
KeyboardPowerCaseMouse
Logitech Combo mk520 Seasonic X Series 650W NXT Phantom 410 Logitech Combo mk520 
CPUMotherboardGraphicsRAM
Intel Core i7 2600K P8Z68-V PRO GEN3 NVIDIA GeForce GTX 560 Ti  Samsung  
RAMHard DriveHard DriveCooling
Samsung  Seagate Barracuda HDD Crucial M4 SSD Corsair H80 
OSPowerCase
Windows 7 Enterprise Seasonic M12II 750w Plexiglass 
  hide details  
Reply
Phantom 1.0
(16 items)
 
PAIN
(11 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 3930K P9X79 PRO NVIDIA GeForce GTX 560  Samsung  
RAMHard DriveHard DriveOptical Drive
Samsung  Crucial M4 64GB SSD Seagate Barracuda 1TB ASUS 24x DVD Burner 
CoolingOSOSMonitor
NH-D14 Windows 7 Ultamite 64 bit Fedora 17 ASUS VW246H Glossy Black 24" HDMI Widescreen LC... 
KeyboardPowerCaseMouse
Logitech Combo mk520 Seasonic X Series 650W NXT Phantom 410 Logitech Combo mk520 
CPUMotherboardGraphicsRAM
Intel Core i7 2600K P8Z68-V PRO GEN3 NVIDIA GeForce GTX 560 Ti  Samsung  
RAMHard DriveHard DriveCooling
Samsung  Seagate Barracuda HDD Crucial M4 SSD Corsair H80 
OSPowerCase
Windows 7 Enterprise Seasonic M12II 750w Plexiglass 
  hide details  
Reply
post #6 of 7
Thread Starter 
Chapter 2: EPEL and Remi, sittin' in a tree...

Proofiness


Got the base server setup working today! This is the setup that'll be mirrored across the three HTTP servers. Quickly installed everything on one of the PCs and port forwarded port 80 to it just to see if it worked, and looks like it does! I'll finish the others tomorrow and then get to the more important stuff.

Got home a little later today, so didn't have time to start doing the heavy lifting and setting everything up with SSH and the Linksys router as a switch, but I figured I might get the base server setups done. I added the EPEL and Remi repositories to the CentOS package manager in order to get the latest and greatest PHP and MySQL installs, rather than the outdated ones in the CentOS repo.

Terminal commands to get everything setup were:
Code:
Login
yum install wget
cd
mkdir Downloads
wget http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-7.noarch.rpm
rpm -Uvh epel*
rm -f epel*
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi*
rm -f remi*
nano /etc/yum.repos.d/remi.repo
**edit 'enabled' line in the first section to enabled=1**
yum check-update
yum clean metadata
yum check-update
yum install httpd mod_ssl
yum --enablerepo=remi-test install php php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml
yum --enablerepo=remi-test install mysql mysql-server
nano /etc/httpd/conf/httpd.conf
**edit ServerName and port**
chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on
service httpd start
service mysqld start
mysql_secure_installation
chmod 700 firewall_config
service iptables stop
./firewall_config
service iptables start

  1. Login
  2. Install the wget tool to download stuff from the web
  3. Make sure you're in the system root
  4. Make a directory called Downloads
  5. Download the EPEL repository RPM for easy setup
  6. Use rpm -Uvh to add the repo settings to the package manager
  7. Remove the rpm file (gotta keep things clean!)
  8. Download the REMI repository RPM
  9. Use rpm -Uvh to add the repo to the package manager
  10. Remove the RPM file
  11. Open up the Remi repository's settings file in the text editor
  12. Changing this line to enabled=1 will make the package manager (yum) use the Remi repo (EPEL is enabled by default)
  13. Ran this just to update the Remi package database
  14. A metadata error popped up at this point for the EPEL repo; ran clean metadata to reset everything
  15. Re-ran check-update, everything is A-ok this time
  16. Download and install the Apache HTTP server and the SSL module
  17. Download and install PHP plus some commonly used modules; notice the use of --enablerepo=remi-test which enables the secondary Remi repo, remi-test, which will download the latest 5.4.x version of PHP rather than the 5.3.x versions
  18. Download and install the MySQL client and server, once again using remi-test
  19. Open up the Apache configuration file in the text editor
  20. Now start scrolling down and change everything that applies, should just be ServerName (computer's_IP_address:port_number), for now I didn't use an IP as I haven't assigned it a permanent IP through my Netgear router, but I gave it a temporary domain name and used port 80, just for setup
  21. This makes sure the HTTP daemon starts when the computer starts
  22. This make sure the MySQL daemon starts when the computer starts
  23. Start the HTTP daemon
  24. Start the MySQL daemon
  25. Use the built-in MySQL secure setup tool (recommend saying yes to everything and setting a root password)
  26. I'll post the firewall script I quickly wrote up below; it basically just blocks everything except traffic coming from port 80, and can easily be modified to your needs; without the script, the won't accept traffic on port 80 and you won't be able to connect. I put the script in the root folder of my OS and this gives root permission read/write/execute it
  27. Stop the firewall service
  28. Execute the firewall script
  29. Restart the firewall service

Firewall script:
Code:
# This script will:
#
# -Flush firewall settings
#

iptables -F

#
# -Set default INPUT/OUTPUT/FORWARD policies
#

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

#
# -Open up localhost
#

iptables -A INPUT -i lo -j ACCEPT

#
# -Accept ESTABLISHED and RELATED packets
#

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#
# -Allow port 80 (HTTP) connections on TCP/UDP
#

iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p udp --dport 80 -j ACCEPT

#
# -Save settings
#

service iptables save

#
# -List firewall rules
#

iptables -L -v

# END SCRIPT #

And that's about the extent of the setup on the base server machines!
I'll post proof that it works in a bit.
Next I'll be hooking them up to the Linksys router-switch-morph and setting up SSH for easy remote access so I don't have to have them physically hooked up to a screen and keyboard anymore.

EDIT: Proof posted

EDIT: phpMyAdmin
This doesn't deserve a post of its own, but I didn't have time to do anything important today, just setup the eth0 connection to auto-connect on boot, and phpMyAdmin for easy configuration of MySQL databases.
Code and explanation included below:
Code:
nano /etc/sysconfig/network-scripts/ifcfg-eth0
**edit "onboot=no" line to "onboot=yes"**
mkdir Downloads
cd Downloads
wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.3/phpMyAdmin-3.5.3-all-languages.7z
yum intall p7zip
7za x php*
mv php* phpmyadmin
mv php* /var/www/html
cd /var/www/html/phpmyadmin
nano config.sample.inc.php
**enter random value for $cfg['blowfish_secret'] = 'random_value';**
mv config.sample.inc.php config.inc.php
  1. Open up the ifcfg-eth0 file in nano
  2. Edit that line to make it turn on and connect on boot
  3. Make a directory called Downloads in the root
  4. Go into it
  5. Get the phpmyadmin .7z file from sourceforge
  6. Install p7zip so you can actually unzip it
  7. Extract phpMyAdmin
  8. Rename the long folder name to something simple
  9. Move it from the Downloads folder to your webroot
  10. Change to its directory
  11. Edit the sample configuration file
  12. Change this value for security: any random sequence of numbers and letters
  13. Rename it so phpMyAdmin actually uses it

That's it!

Fun fact: I spent 30 minutes with that flippin' ifcfg-eth0 file and could not for the life of me get it to work, it wouldn't connect on boot. 30 minutes. That's the time it took me to realize I hadn't plugged the Ethernet cord in doh.gif
Edited by crazyap7 - 10/31/12 at 3:52pm
post #7 of 7
Thread Starter 
Quote:
Originally Posted by benpack101 View Post

Subbed! I'm really looking forward to following this thread! I can't wait to see what you do with all of this and being a network dummy, I'll probably learn something in the process!thumb.gif

Let me know if I can help you with anything thumb.gif
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Servers
Overclock.net › Forums › Specialty Builds › Servers › Project Servercycle: 0 Dollars, 1 (Vague) Server Farm