14
Jul 07

Shared Hosting is Awesome!

Until I get my VPS server up and running, I’m hosting Command Line Idiot on a shared hosting plan with Dreamhost. Shared hosting is awesome!

Here’s the uptime report on the server that’s hosting the blog.
11:32:24 up 38 min, 3 users, load average: 266.63, 259.39, 230.23

For the uninitiated, that means that the current demand on the server is overloaded by 26,600%. It would take 266 servers to handle the load they’ve dumped on this one single wheezing box that my blog is sharing.

The end result? It just took 9 minutes for the main page of Command Line Idiot to load.

Popularity: 10% [?]


14
Jul 07

apache2, php5, phpmyadmin

So, I solved at least one of my nagging headaches. I ran into a brick wall trying to get phpmyadmin up and running on ubuntu.

The Setup

Ubuntu 7.04, Apache2.2, MySQL, PHP5, running on a VPS from slicehost.com. All installed from apt-get, all working fine. Gave MySQL root user a password, the login to MySQL from the command line works just fine.

Installed phpmyadmin from apt-get, everything’s cool, it sets up the appropriate symbolic links so that www.MYURL.com/phpmyadmin points the browser to the phpmyadmin login page.

The Problem

I go to www.MYURL.com/phpmyadmin, and I get the login page. I enter the MySQL user root + password. Sometimes it logs in. Sometimes it bounces me back to the login with no warning. Sometimes it redirects me to the login page and says “root”@”localhost” not permitted [password=YES]. Sometimes it’s the same warning, but with [password=NO], even though I have entered a password.

Sometimes, if I click login 3 or 4 times after it keeps redirecting me, I actually get let in to phpmyadmin. As soon as I do anything requiring privileges (create new user, create new database), I get bounced back to the login page again.

Troubleshooting

Here’s what I tried to fix it

1) Tried all browsers at my disposal (OSX: Firefox, Opera, Safari, Camino; Windows: IE6, IE7). Same problem with all.

2) Assumed it was a cookie issue. Dumped all cache and cookies on my browser, reset safari, relaunched apache2, tried again. Same problem.

3) Same as step 2, but also did a shutdown -r of the entire server, just in case. Old habits die hard.

3) Sacrificed male goat by the light of a full moon. Sticky fingers, but still no persistent login.

Nothing worked.

The Solution

Turns out, in order to run phpmyadmin with php5 on a 64bit ubuntu machine, you need to have a little package installed called php5-mcrypt. It’s not listed in the dependencies, so if you just use apt-get, it gets left behind.

sudo apt-get install php5-mcrypt

the conclusion

aaaarrrrrgh.

Let the record show that it was at this precise moment in time that I switched from Ubuntu to Debian for my server needs. If I wanted to shed this much stomach bile on figuring out required dependencies, I would strap on a pocket-protector and go join the gentoo geeks. At least then I know it’s up to me.

Popularity: 19% [?]


14
Jul 07

Back from Italy!

Flew from Milan to LAX yesterday. Got off the plane, and could literally feel the itching in my fingers to turn on the Treo, fire up the mobile ssh client, and do me some server-administratin’! If sorting out the group permissions on your apache virtual hosts has you a bit batty, I highly reccomend 2 weeks of wine, cheese, and prosciutto in the beautiful Tuscan hills. Call it therapy. Bill the client.

So, CLIdiot is back. Good times ahead, my hapless friends, as we foolishly stumble forward into that great fire swamp that is linux, armed only with our dauntless good cheer, a del.icio.us account full of tutorial links, and two pints of bitter ale.

To arms!

Popularity: 5% [?]


28
Jun 07

farting in an elevator

I know starting a new blog, getting 15,000 hits from Stumble Upon, then ignoring everyone has all the tact of farting in an elevator, but the CLIdiot blog will be on hold for two weeks. I’ll be in Italy, because my life is more fabulous than you can even imagine, and I don’t intend to spend my nights getting postfix to work. Thus, no tirades or swear-filled rants.

I’ll be back soon. And if you don’t think getting IMAP configured will whip me up into a frenzy, you don’t know the CLIdiot.

Popularity: 9% [?]


25
Jun 07

if at first you don’t succeed, blow it up

I’m on build #28.

28 times that I’ve blown up and re-imaged my server slice with a fresh Ubuntu install. I sit down to the command line with the intent of building a stable install, and I’ll get to the point where something goes way left, blow up the server, start over. I haven’t found a way to back things up cleanly, to uninstall a package, revert config files to their defaults, and remove the files and folders associated with it. I get very nervous knowing that some package has left trash all over my server. So, I blow up and start over.

  • Install apache2, install php5, install webmin, try to enable WebDAV on a virtual host, webmin hangs on a perl module and won’t budge. Blow up, start over.
  • Install apache2, install php5, install phpmyadmin, try to use it to setup a new privileged user and database, but phpmyadmin refuses to stay logged in. uninstall, reinstall, uninstall, reinstall, blow it up, start over.
  • Install Lighttpd, install ruby, install gems, install mongrel, realize that you’re accidentally following a tutorial for a ruby on rails application instead of a LAMP server, blow it up, start over.

Repeat, 28 times, with different problems and configurations.

It’s not lost time, really. I’m actually enjoying it. There’s something very zen about knowing you can always erase your mistakes and start over. I feel like each time, I’m narrowing in on the right setup, learning new things, starting to get a sense of how Ubuntu organizes data. My goals is to be able to setup a server without having to follow a tutorial; to know what the available options are at each stage in the setup, and to make an informed choice for each one.

It’s not enough to just build a server, I want to know how to build a server.

Popularity: 24% [?]


20
Jun 07

i c u, scurvey-dev-core

I have a bug up me arse about most linux tutorials. 90% of linux tutorials are written for one of two reasons:

  1. As a handy checklist for the person who is writing it. They’re using it instead of a pad of yellow legal paper to keep track of how they set things up. These tutorials tend to have almost no notation about what things actually do, they’re just a running list of commands
  2. To demonstrate how remarkably clever the person is. These tutorials tend to veer off into lengthly political rants in the middle, all about how infantile and shortsighted the distro developers were when they decided to include XYZ in the canonical sources list, rather than forcing users to follow this 97 step process that is marginally more secure, so long as you don’t accidentally leave off the semicolon at the end of one of the commands.

Where are the tutorials for people like me? I’m not a mouth-breathing moron, just ignorant about linux. I don’t want a running list of things to copy and paste into the command line, I want to understand what I’m doing. And, I want to know when you’re presenting alternatives that are your own personal hobby-horse rather the standard method. Don’t tell me “this is the best way” and then point me in some obscure direction that’s going to cause a dozen headaches later on when I have to alter every other tutorial I try to follow.

On Tutorial to Rule Them

So, I hereby present to you my first tutorial. This tutorial will allow you to rescue all of the other bad tutorials and make them useful again. It only does one thing, and there are only two steps, but they work.

wtf is this?

So, you’re following a tutorial, and it tells you to apt-get a dozen packages, If you’re like me, this makes you very nervous. I want to actually know what these things do before I dump them onto my server. Let’s say one of the packages is “php5-dev”

Enter the following in the command line:
apt-cache show php5-dev

You’ve just told the apt package manager application to get you information about this package. It doesn’t install anything, just tells you what the package does, along with some nifty info about other packages it’s dependent on. In this case, it shows the following:

Package: php5-dev
Priority: optional
Section: devel
Installed-Size: 2680
Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Architecture: amd64
Source: php5
Version: 5.2.0-8+etch1
Depends: autoconf, automake1.4, libssl-dev, libtool, shtool, php5-common (>= 5.2.0-8+etch1)
Filename: pool/main/p/php5/php5-dev_5.2.0-8+etch1_amd64.deb
Size: 342036
… snip …
Description: Files for PHP5 module development
This package provides the files from the PHP5 source needed for compiling additional modules.
.
PHP5 is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.
Tag: devel::lang:php, role::devel-lib

Sweet! So now I know that it contains the tools to compile additional modules for PHP5. I’m now smarter!

bash it

If you are following a lot of tutorials, you’ll end up typing the words “apt-cache show” until you go blind, or develop ganglion cysts on your tendons. Let’s make the automatic computrix machine do it for is. Open your .bash_profile file with your favorite text editor. I like nano:
nano ~/.bash_profile
hit control+v until your cursor reaches the end of the file, then add the following line:
alias c="apt-cache show"
hit control+x, then enter, and you’re out of the text editor. We want to force bash to reload the profile, so type the following:
. ~/.bash_profile
To see if it worked, type this:
c php5-dev
It should bring you back exactly the same info you saw up above. Huzzah!

Now, no matter how shitty the tutorial is that you’re following, you can check out the packages and see what they do before you apt-get install scurvey-dev-core and it translates all of your config files into Cyrillic.

Popularity: 13% [?]