Tutorial:

Wednesday, November 28th, 2007. Filed under PHP

Toward the end of pursuing various personal projects I decided to set up a LAMP server on my second machine here at home, but wanted to maintain the desktop aspects of what I currently have with Ubuntu desktop so I decided to run the LAMP setup on a clean Ubuntu desktop. I’m aware that I could have went the server route with the LAMP configuration, and then installed the desktop on top of it with:

$ sudo apt-get install ubuntu-desktop

but I decided for now to run similar setups on both machines. So below are my notes for installing the LAMP server on Ubuntu desktop (these notes are as much for my later use as they are for anyone who trips over them whilst running through the interwebs). Overall, its fairly straightforward, and there really aren’t that many steps involved. The community has made this pretty painless IMO. These notes assume that Ubuntu desktop is already installed. An excellent walkthrough for this process can be found here, and mostly what’s below are my adjustments to that excellent walkthrough.

1. Install the LAMP server package using tasksel.

$ sudo tasksel install lamp-server

This tasksel package will install apache2, php5, and mysql5, along with various dependencies and libraries.

2. Set your mysql password when prompted in the terminal. You’ll need it later.

3. Visit http://localhost. If Apache is up in your browser, you’ll see a directory listing.

4. Make sure PHP is up and parsing by placing a test index.php file in the /var/www/ directory. You’ll need sudo for this as it requires root privileges to edit files in this directory. You can do this with any text editor. I chose gedit.

$ gksudo gedit /var/www/index.php

Once open, enter this PHP line and save:

<? echo 'hello there'; ?>

5. Now refresh your browser. If your test page greets you heartily, PHP is up and parsing.

6. On the other hand, if firefox prompts you to download the file cuz it doesn’t know what to do with “PHTML”, make sure the php5 service is enabled with:

$ sudo a2enmod php5

7. If the message returned indicates php5 is already enabled, try just restarting the service:

$ sudo /etc/init.d/apache2 restart

Thats what it took for me. My guess is the alteration of a previously installed service by the subsequent installation of the other items in the same lamp-server package.

8. If you then get the error, “Restarting web server apache2. apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” like I did, you’ll need to edit the httpd.conf file:

$ gksudo gedit /etc/apache2/httpd.conf

Add this line and save:

ServerName localhost

9. Once that’s done, refresh your browser again. If you’re like me, the test page performed as intended. So you now know that Apache and PHP are running, but what about MySQL?

10. Try logging in via the terminal and enter that password you created earlier when prompted. If you can login, then MySQL is running:

$ mysql -u root -p

11. If you prefer a web-based interface for your MySQL needs, phpMyAdmin is an excellent way to go. Its not installed with the other packages via the tasksel lamp-server command, but as usual, installing the application is as easy as command line:

$ sudo apt-get install phpmyadmin

you’ll be prompted to allow phpMyAdmin to automatically configure various instances of Apache for PHP use. If you’re following this walkthrough, you’ll want to select the apache2 web service.

12. once the installation is complete, go log in using your mysql login information at http://localhost/phpmyadmin.

13. But if you’re new at this like I am, you may want to verify that PHP can connect to your MySQL instance before you sit down and start writing code, so open up the same index.php file from earlier, add and save this code:

<?php
$hostname = 'localhost';
$username = 'root';
$password = 'yourMySQLpassword';
$conn = mysql_connect($hostname,$username,$password) or die ('could not connect to mysql.');
echo 'OK';
?>

14. Now refresh your browser. If you see the OK, then PHP has no problem connecting to your MySQL.

So hopefully you’re now up and running with your own LAMP server on Ubuntu desktop 7.10. If you’re not up and running, the best place I’ve found for help with anything Ubuntu related is http://ubuntuforums.org/.Good luck.

–>

Tutorial:

Sunday, November 25th, 2007. Filed under Ubuntu

So I’m sure that for many of us dual-booting converts stepping into the Linux world, one of the most common obstacles keeping us handcuffed to Windows is World of Warcraft. Well not anymore for me, thank you very much.

I went through many tutorials on how to configure WoW for Ubuntu, but I found the below link to be by far the most helpful AND up-to-date:

https://help.ubuntu.com/community/WorldofWarcraft

In truth, I did part of this the easy way. Once I had installed wine and configured it, instead of installing each of the disks (WoW + Burning Crusade) from Ubuntu, I just dragged the 10GB installation folder from the Vista side to Wine’s pseudo C drive \ Program Files directory, which by default is located here:

/home/<yourusername>/.wine/drive_c/Program Files/

So that’s much less hassle, and I highly recommend it if at all possible. The other excellent bonus of this method is that I didn’t have to reinstall or mess with any of my addons, of which I have several.

So once all the files were copied over, I followed the instructions from the link above and added this to my Program Files/World of Warcraft/WTF/config.wtf file:

SET gxApi "opengl"

SET ffxDeath "0"

SET ffxGlow "0"

SET SoundOutputSystem "1"

SET SoundBufferSize "150"

And if you want to run WoW in windowed mode, add this as well:

SET gxWindow "1"

I also created the shortcut indicated, and added that to my panel, complete with WoW SVG icon. Nice touch by the editors of ubuntu.com. So now I’m finally up and running with WoW in Ubuntu. One less thing tying me to Windows.

Note: Technically, I had tried this all once before, and it was kind of working, but it was with a lower end graphics card, and though I could log into the game, once in Azeroth, the ground was black everywhere I went, and lighting was all funky whenever I went in doors. Oh, and the text looked like Sanskrit. I probably should have taken a screenshot. So if you call that “working”, then this is old hat. Otherwise, its finally up. May my blades never dull.

–>

Ubuntu:

Sunday, November 25th, 2007. Filed under Compiz

So on Black Friday, I picked up a new graphics cards since my previous didn’t fit in my new machine. The one I got was the NVidia GeForce 6200 LE ($50 with a $50 mail-in rebate = free graphics card. sweet). I went with this one as opposed to an ATI card since the majority of information I found online indicates that overall Linux support for NVidia is good, while support for ATI kind of sux0rz. To be fair, as I understand it, the reason for the lack of consistent ATI support is on the part of the ATI development team, not on the Linux community side (newbie disclaimer). So anyway, I installed the card and booted straight into Ubuntu (I’ll install the Vista drivers later. Maybe). Though instead of the GUI, I boot into the command line telling me very sexily:

(EE) no devices detected.
fatal server error:
no screens found

which of course is awesome like command-line sudoku. And even though I realize its telling me ‘No screens found’ because it can’t find the device listed in my xorg.conf file, I still find it humorous that its giving me this error message on one of the screens it can’t find lol. Well I tried a few things, but in the end, the below steps are what worked for me.

1. Reconfigure x (the desktop environment), like this:

$ sudo dpkg-reconfigure -phigh xserver-xorg

2. Once thats completed, restart x:

$ startx

3. Once in, head to synaptic to install the correct drivers: Applications / ‘Add/Remove’.

4. Search for ‘drivers’ and check the box for ‘Restricted Drivers Manager’. Apply Changes.

5. Once installed, go there: System / Administration / Restricted Drivers Manager.

6. Check the box next to the NVidia drivers it found to enable them. You will be prompted to log out or reboot (this was the first time I’ve ever been prompted to reboot in linux).

Once you log out or reboot you should be good.

7. You may want to adjust your screen resolution: System / Preferences / Screen Resolution.

8. You may also want to verify that openGL is installed. For me, this is a necessary component for both Compiz and World of Warcraft via Wine.

$ glxinfo | grep rendering

If openGL is installed (which it should be if everything else ran correctly), it will say:

direct rendering: Yes

or maybe direct rendering: woohoo! on some machines (jk). Good luck.

–>