nginx + php + Solaris 10

I wanted to set up a development server to test more intensive PHP applications, and also a sandbox so I opted to get a typical web server stack on Solaris.

First thing's first: grab nginx from  Cool Stack page. There's some great packages there, like Apache, PHP and MySQL all in one. I decided to go with nginx for something light and something new. 

The binary for nginx is  /opt/coolstack/nginx/sbin/nginx so be sure to set your configuration in /opt/coolstack/nginx/conf/nginx.conf (pretty straight forward). Be sure to enable the FastCGI section in the config file!

Next thing is PHP. Pretty standard here. Get the source from php.net, configure and install. I ran ./configure with --prefix=/usr/local/php5 --enable-fastcg=/usr/local --enable-force-cgi-redirect --enable-cli --enable-zip --with-layout=GNU --with-regex=php --with-zlib=/usr/local --with-curl=/usr/local --enable-exif --with-gd 

Once that's done, set up your php.ini in /usr/local/php5/etc And of course, add cgi.fix_pathinfo = 1 to the end of the file. Now, for everything to piece together, you'll need FastCGI to parse PHP with nginx (as far as I know). Grab FastCGI from here and the standard compile commands.

Now, nginx was running but I couldn't get it to parse PHP. nginx was listening for port 9000 for FastCGI but it wasn't there. After a bit of Googling I found spawn-cgi, as it comes with lighttpd by default. Anyway, get spawn-cgi and install.

Finally, spawn FastCGI with:
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -f /usr/local/php5/bin/php-cgi


(You'll have to create user www-data if it doesn't exist).

And that's about it. I now have Proftpd on there, and it's running quite smoothly indeed. Any comments or ideas are welcome.

iStat on Solaris 10

After experimenting with Solaris 10 for a bit, I thought I'd get iStat on there so I can see it's activity on my iPhone. After getting down and dirty with Solaris for a bit, I definitely learned some things. Since iStat needed libxml2, I grabbed that from Sun Freeware and installed it fine. Next thing was to, of course, install the iStat client. When I ran ./configure it was complaining about not being able to create a C++ executable. And with gcc already installed, libraries were the issue. /usr/bin/crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib:/usr/local/ssl/lib did the trick.

Solaris has a steep learning curve, as compared to Linux. I've always fancied nano as my text editor, but Solaris didn't have nano so I had to make do with vi (of which I'm quite better at than before). Tab completion and using the up or down arrow key to repeat the last command isn't there either. I've learned that I have to gunzip then tar xvf a tar.gz file (bunzip2 works for .tar.bz2).  Also, I found this great for some tricks on Solaris (alebeit it's Solaris 9).

Networking was a bit difficult to start, I had to get the driver from here.Although, I'm still having problems with the module not loading on boot. All in all, I find that Solaris definitely improved on my command line skills. It's like Linux, but without the fun.

iOS 4.0.1 released, now what?

Now, I'm not one to blog about the newest tech news or anything, but Apple has released iOS 4.0.1 which as they say, "improves the formula used to calculate the appropriate bars for signal strength". Available in iTunes and here. I've always had a cheap plastic case on mine, so I never noticed any reception loss greatly. Although if I do hold it in my left hand for an extended period, I saw 5 bars go to 1 bar.

Firmware 4.0.1 is jailbreakable with the 3G so far, so 3GS and 4 users are out of luck. If the only entry in the change log is the "improved formula", I don't see the need to update personally. Sure, it may say I have 1 bar, but hey, as long as it works.

Cycoder still doesn't work in 4.0. I finally found a working version of biteSMS, 4.93. I had to run redsn0w again last week or so because 3G didn't work. Working fine now, but it was strange that it didn't work at all. Still some themes don't work. Infinidock and Lockinfo don't seem to be compatible either. I do experience random reboots and lockups, but whatever. 

Tags

iStat on pfSense and server monitoring

One of my most favourite apps for my iPhone is iStat. It lets me monitor all my *nix servers in a beautiful interface. For my Linux clients, all I had to do was download the client, extract and compile. And since my router is running pfSense (FreeBSD 7.2) I thought I might as well get iStat on there.

 

Apparently, the developers edition of pfSense has all the goodies to compile stuff. Without even thinking of cross compiling, I quickly set up a VM of FreeBSD 7.1 (I know little to nothing of FreeBSD so I opted to get something near 7.2) and started to compile it. I had to get libxml2 first though and for FreeBSD 7. Anyway, logged into pfSense via SSH, fetch'd libxml2 and installed it. Now, since my router had nothing to compile packages with, I built iStat in the FreeBSD virtual machine and transfered the resulting mess to pfSense via SFTP. Now, since I couldn't have run make install in pfSense, I had to create /usr/local/etc/istat.conf and filled it in with the configuration file from another Linux client. I also edited the configuration file to fit the network interface (xl0 instead of eth0).

Looking back, I probably could have done things a little different. Either way, I got the job done. Now I'm happy that I can monitor my entire network with one app. I recommend for those that are in need of a functional server monitor to check out iStat for the iPhone. Be warned that iStat only supports one interface so far.

 

Since I have one Windows server I like to monitor that too. And for that, I have WinAdmin for remote RDP (great app) and Weave, which is almost a Windows version of iStat (but not). Awesome monitoring gauges in there. And, since it uses push notifications, it can alert me when the CPU usage is above 92% for example.

Another great agent-less monitoring app is Net Status. It simply pings the most comment ports on your IP of choice.

Also, see the attachment for the agent compiled on FreeBSD (i386). I can't guarantee that this will work for you.

 

Syslog server on Lenny

So, I installed VMWare Server on my Windows Server 2003 box the other day. Downloaded a Debian Lenny image and got it running. Never dealt with VMWare Server so it's pretty neat to configure virtual machines from a convenient web interface. The web interface was having issues at first, of which I tracked down to IIS. The web UI runs on port 8333 and IIS runs on port 80 of course. Disabled IIS and the web UI was up and running.

 

After that it was all down hill. Set the network adapter on the VM to bridged. Got the virtual machine running and started installing packages and such. At first, it couldn't resolve names so I had to correct /etc/resolv.conf and point it to my DNS servers. 


Anyway, I decided I'd set up a syslog server. Lenny now uses rsyslog but I went back with sysklog. Edit your /etc/default/syslogd, and change SYSLOGD="" to SYSLOGD="-r" for remote logging. Still on the syslog server, I edited /etc/syslog.conf and added *.* /logs/file.log to make sure everything was working.

On the clients, or nodes, I edited /etc/syslog.conf and added *.* @192.168.0.113 (or whatever your IP is). After reboots of sysklogd on the servers and the nodes, it's finally working. Going to get lighttpd working with the logs, perhaps set up a little PHP script to read the logs.

I do really like this VMWare Server, it lets me utilize this server more. I might get it running on my other servers on that note. Plus, it's free. Can't argue with that ;)

As usual, comments are welcome.

 

iOS 4.01

With my iPhone 3G jailbroken with iOS 4.0, lots of other users have been experienced cell phone reception trouble. I tried it myself and covered the left side and saw my signal bars drop by 4. I've read around the internet and its rumoured that 4.01 was supposed to drop today to fix the antenna issues. I'd assume before Friday, there's going to be a fix out there. I, myself, didn't have too much trouble with getting a signal. Where I was reading on Slashdot, it was said that even if the signal is 5% or 100%, you're going to get the same call quality.

I haven't got BiteSMS to work on 4.0 yet, nor five column springboard (fcsb) or Infinidock. A couple Winterboard themes don't work either, such as custom Wifi and signal bar icons. Cycorder doesn't work either. Hopefully, these'll be fixed soon so I can get 4.0 running like I had 3.1.3.

Also, I was thinking about rejailbreaking my iPhone to disable multitasking. Apparently, Backgrounder uses more resources than native multitasking (duh). If two apps are running at the same time and one requires more resources than the other, the one running in the background will be terminated leaving the foreground application with more memory.

 

Jailbroken 4.0 on iPhone 3G

So, after a long time of tinkering I finally got it working.

Get 4.0 (stock 8A293) on your iPhone
Run redsn0w 0.9.5b
Be patient!  - This took a bit for me. Once redsn0w says it's done, the screen on your iPhone will display what it's doing (flashing NOR) and a running pineapple(?).  
4.0 seems to run faster on my 3G than 3.1.3.

Tried to make this post quick as I'm off to bed!

Place of education

 

Photo by aussiegall

With school finished with the exception of an exam or two and my domain back, I think I'll now have the motivation to get shit done.

Sysode is nearing completion: one of my projects that looks have decent. On the bad side, it uses PTB which would make it hardly scalable if at all. I could recode it so Sysode uses SQLite but I'd rather write it from scratch than transfer it. To make it feel better, a VPS would be ideal but wouldn't solve the problem.

Anyway, with my domain back (woot!) I think I'll go about fixing some stuff on this site.

 

 

Cold coffee

For my love of coffee, I tried cold brewing the other day. More convenient, in my opinion.

7 (or so) table spoons of your favourite coffee in a mason jar and fill it up near the top of water. Let it sit over night, or at least 12 hours. Strain that lovely juice into another jar. You now have cold-brewed coffee. Pour into a cup, add milk, sugar and enjoy :) 

For iced cappuccinos (blended ice coffee), freeze an ice cube tray of the coffee you just made (with out milk/etc). I stuck 6-7 ice cubes in a blender, with about two cups of milk (call it 450mL), some chocolate sauce and vanilla Coffee-mate (honey would do, too). What you end up with, is a delicious, higher in caffeine drink.

iPhone borken

Yes, I purposely spelled that wrong. Anyway, the entire left of the touchscreen on my iPhone doesn't work. Plugged it in at night, then didn't work in the morning. So, I've had to suffer only using the right side of the screen for the last two weeks. Going to have to restore back to factory defaults, package it up and send it off.

 

Luckily, I've been somewhat productive lately. I've added some new features toSysode, the free project management app I've been working on since late August. There only needs to be a couple features added (member search, user control panel, etc.) and then it'll be mostly done (err..). And, for once, it looks half decent.

 

School'll be out in about two weeks; summer job then. Makin' bank...