On February 8th, 2010 Linode.com announced the availability of StackScripts. The StackScripts are described as:
StackScripts™ provide a flexible way to customize our distribution templates. They’re very easy to use — find a StackScript, answer its questions, and click deploy. When the deployment is first booted, the script is executed and does its thing. You can even watch its progress by viewing the console.
As so many things with Linode.com and its community there is a public library of the Stackscripts available for a variety of purposes. Anything a from a standard LAMP setup to WordPress, Drupal and TRAC/SVN setups.
Already having a Linode up and running, I have also been thinking about re-doing the setup of ourLAMP server. Seeing this as an opportunity to both rebuild our LAMP server and test StackScripts, I set out to give it a try.
We already had a Linode configuration and a disk image actively running. The good news was that when you choose to deploy a new distribution via a stackscript, it will create both a new Linode configuration as well as a new disk image. Doing so keeps you from having to remove the currently running setup.
One of the standard Linode LAMP StackScripts provide a form like the image to the left when executed to deploy a new distribution. MySQL user and password, creation of a default database, as well as root O/S password and such. dec
Once the configuration is created, you now only need to boot into the new configuration. If you are logged into your LISH console, you will see the distribution go through the automated process of the StackScript. In our test case, an Ubuntu 8.04 LTS kernel was booted and installed, system updates installed and applied, postfix installed for local loopback only, MySQL installed and tuned, php installed and tuned and apache2 installed and tuned.
Pretty cool so far. Now, there is plenty left to do to get a fairly decent LAMP going that in our case would run Drupal.
Create a new non-root admin user account called myadminuser and add to the admin group:
adduser myadminuser usermod -G admin myadminuser
NOTE: Looks like the admin group is already part of sudoers so your new account has sudo privileges.
Update the timezone:
sudo dpkg-reconfigure tzdata
Secure MySQL services in a quick fashion:
sudo mysql_secure_installation
Enable a few Apache2 modules:
sudo a2enmod deflate sudo a2enmod expires sudo a2enmod cache sudo /etc/init.d/apache2 force-reload
Add a few PHP tools:
sudo apt-get install php5-gd sudo apt-get install php5-curl sudo apt-get install php5-cli
Secure SSH daemon by changing the port for SSH and disallow root login:
sudo vim /etc/ssh/sshd_config -- # Protocol 1 -- Protocol 2 -- ListenAddress 10.54.55.104 #your IP -- Port 5502 # New port different than 22 and < 65535 -- PermitRootLogin no -- X11Forwarding no sudo /etc/init.d/ssh restart
Install the firewall and configure:
sudo apt-get install ufw sudo ufw default deny sudo ufw allow http/tcp sudo ufw allow 5502/tcp sudo ufw enable sudo ufw status verbose
Configured PostFix by following pieces of our previous post on PostFix and domain forwarding.
sudo vim main.cf -- See article referenced sudo vim virtual -- See article referenced sudo postmap virtual sudo ufw allow 25/tcp sudo postconf -e "inet_interfaces = all" sudo /etc/init.d/postfix restart
Lastly upon reboot we noticed that mysqld was failing. The problem was that mysqld was not binding correctly. We editing the my.cnf file and added BindAddress 127.0.0.1 above our existing BindAddress 10.54.55.104. This allows mysqld to bind and listen to both local loopback and the external IP (if needed)
At this point, we had not installed APC or MemCached yet. Performance was quite good with this setup and the minimal memory available to this test Linode. We ran six(6) Drupal , one (1) WordPress and one (1) CMS Made simple site with sub-second response times under fairly good load.
Kudos to Linode.com on their StackScript concept. I can certainly see this being very appealing for providers needing to crank out Linodes with a standard configuration for customers.
Blessings.
Popularity: 9% [?]

