Archive for November, 2008

Hullabaloo Apparel (done for now)

Today I finished up a major contract coding job today for this clothing company called Hullabaloo Apparel. They create very unique designs and then print them on various clothing items. Their idea of clothing is not for quick laughs or in-crowd designs (like most online clothing shops), but universally sweet designs. From the various things I’ve heard from Erik and Yuriah (the co-founders), they have already been doing quite well, and needed a web-presence to expand their market and for explaining their brand. Which is where I came in.

About two and a half weeks ago, after showing Yuriah a few tricks with his Mac, he asked me if I would be up for doing the website for Hullabaloo Apparel. They needed a website up asap. So I cracked out various designs from what Yuri described to me and settled on the fourth design in a series of high-contrast xhtml/css designs I put together.

So I jammed away this past week, after getting approval, and am now done.

A couple of things I wanted to write down:

  1. PayPal has an integrated shopping cart that can take in many different variables (such as sizes)
  2. PayPal has integrated shipping calculators (for various locales) when a user checks out
  3. Instant Payment Notification works best for subscriptions and individual (digital service) items; it looks best to have the IPN script running on a SSL host
  4. It is possible to give site owners access to Google Analytics on the fly, by setting up a Google account with an email of your choice; and then use said account via an auto-login script
  5. Submitting a form via a JavaScript link is done like so (where “monkey” is the name of the form. <form name=”monkey”></form>: <a href="javascript:document.monkey.submit();">Submit Form "Monkey"</a>

Dynadot banner

debian 4 web server setup

First post in awhile! I just had to get that out there. Well it has been an intense couple of weeks with college life really starting to kick in (the tests and lectures) and my work being the way it has. But I am back serving up cookbook recipies. Today’s is about setting up a debian based web server (for those of you with a vps or dedicated box). It is assumed that you are able to send mail directly from this box. Enjoy.

1) Install debian from floppies, full cd, or cd net install. Pretty self explanitory. I suggest doing it from floppies or cd net install, because we want to save as much disk space as possible for data.

2) Log in as root and run:

  • apt-get update
  • apt-get upgrade

If the system prompts you to reboot a process or the system, do as it says. Once you reboot all the core daemons and programs should be the latest (stable) versions.

3) Install the ssh server [apt-get install ssh] for remote command line access, so you don’t have to be hunched over a server rack.

4) If you wish to have email functionality follow the instructions in this article on howtoforge.org.

5) various dependencies and apps (php, mysql, pcre for nginx): apt-get install php5-cli php5-cgi build-essential mysql-server mysql-client openssl libssl-dev libpcre3 libpcre3-dev bzip2 gzip
better lock down the mysql root user: mysqladmin -u root password NEWPASSWORD

6) For individual virtual host files under nginx:
mkdir /etc/nginx
mkdir /etc/nginx/sites-enabled

[Sample Virtual Host File] • [More on Virtual Hosts]

7) if ($operating_system == “ubuntu*”) {
grab the nginx .deb archive (check the other releases out on technokracy.net):
[i386] wget http://vraidsys.com/article-includes/nginx_shiz/nginx_0613grrr-1_i386.deb
OR
[amd64] wget http://vraidsys.com/article-includes/nginx_shiz/nginx_0613grrr-1_amd64.deb
unpack and setup nginx: dpkg -i nginx_*
}else if($operating_system == “debian*”){
command to grab nginx: apt-get install nginx
}

8) Setup lighttpd for spwan-fcgi
grab the archive and make it. but DO NOT make install!
wget http://www.lighttpd.net/download/lighttpd-1.4.20.tar.bz2
tar -xvjf lighttpd-*
cd lighttpd*
./configure --without-bzip2
make

Now copy what we need for spawn-fcgi: cp src/spawn-fcgi /usr/bin/spawn-fcgi
Open the config file: vi /usr/bin/php-fastcgi
And add: /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -f /usr/bin/php5-cgi
-C controls how many fcgi instances of PHP5 are spawned, so you can put however many are appropriate for you in there. I only needed 5.

Open the startup file: vi /etc/init.d/init-fastcgi
Add the following:
#!/bin/bash
PHP_SCRIPT=/usr/bin/php-fastcgi
RETVAL=0
case "$1" in
start)
$PHP_SCRIPT
RETVAL=$?
;;
stop)
killall -9 php
RETVAL=$?
;;
restart)
killall -9 php
$PHP_SCRIPT
RETVAL=$?
;;
*)
echo "Usage: php-fastcgi {start|stop|restart}"
exit 1
;;
esac
exit $RETVAL

Now change some perms to make the files executable:
chmod 755 /etc/init.d/init-fastcgi
chmod 755 /usr/bin/php-fastcgi

Start your fcgi processes: /etc/init.d/init-fastcgi start
And add the script to startup: update-rc.d init-fastcgi defaults
Restart nginx and see if it works: /etc/init.d/nginx restart

#8 was based on: http://www.johnyerhot.com/2008/02/12/how-to-nginx-fcgi-php-mysql-ruby-on-rails-rewrite-vhosts/

[More on fcgi setups on the nginx wiki]

9) Install vsftpd
apt-get install vsftpd
Now open up the configuration file: vi /etc/vsftpd.conf
I am creating a single/few user system here, so whenever I add a new user, that user will have ftp permissions. Which would mean that I would edit the config file so that: local_enable=yes and chroot_local_user=YES.
Restart vsftpd: /etc/init.d/vsftpd restart

10) A great resource page on adding, editing, and deleting users can be found at http://www.ahinc.com/linux101/users.htm.

Return top