Posts Tagged ‘wifi’

Installing LAMP on Ubuntu

November 18, 2009

I worked 20 hours straight to prepare an old Gateway tower with 280 gig drive for an Ubuntu 9.10 install. The Gateway was hopelessly unbootable in Windows because of some operating system problem (not hardware problem). I realized that I should drop down to C: and type format, to just reformat the entire drive which took about 30 minutes. I forgot that I should have typed FDISK first, to set up the necessary partitions, but it was too late.

I downloaded an ISO image for GNOME partition and burned it to a bootable CD.

I booted the GNOME partition utility. It took me literally hours to guess at what I should do.

Finally I realized that Ubuntu expects THREE partitions. The first is referred to as ROOT but the actual name you give it in the partition process is simpl “/” (forward slash omitting the double quotes).

The second partition will have NO name, but you will designate its format TYPE as swapfile, and that will become the system swap file.
The third partition is called /home.

I had no idea how much space to allocate, so I gave 512 for root and 512 for swap, and the huge remainder for /home.

The software warned me that root and swap were too small. Just for the heck of it, I changed root and swap to 5000, and it worked.

Then it took me dozens of tries installing Ubuntu. I had a 2008 Ubuntu disc and a 9.10 disc I had created last week. Time after time, I would boot from each one, say INSTALL UBUNTU, and it would chug away for a long time, and then die with no messages. FINALLY, but why or how I dont know, the 9.10 unstall brought up an Ubuntu desktop with what looked like all kinds of error messages. There were TWO icons on the desktop which I had never seen before. One said EXAMPLES which I never looked at. I was about to give up in dispair when I decided to click on the icon marked Ubuntu. AS IT TURNS OUT, that is the icon which COMPLETES the install process, and it first brings you into its OWN partition software. I cant exactly remember what I did next. I do remember that GNOME partition utility offered me literally 20 DIFFERENT format types to choose from for each partition (one of which is swap-file). I had no clue what to choose. I did some google searching on my other machine (and you NEED a windows machine attached to the internet to look these things up). I discovered that format type ext3 is good for Debian Linux (and Ubuntu is a flavor of Debian) so I went with ext3.

Finally, I had a working bootable pure Ubuntu 9.10 machine.

My next Sisyphean agony task was to connect it to the Internet. The tower already had an Ethernet card. I was informed that IF I connected a cable from the ethernet to the router, then Ubuntu would automatically sense the ethernet connection and configure it. The ethernet board DID light up and pulse when I connected the cable to my Westell router. But Ubuntu never recognized it. Later I read that only certain ethernet cards will be automatically recognized, so I guess the one in my tower was not a compatible one. My next choice was to try and get my Belkin USB WiFi adapter working. I went to ADMINISTRATION -> SYNAPTIC PACKAGE MANAGER and keyed ndiswrapper into the search. I was prompted to place the Ubuntu install cd into my drive. It kept giving me errors. I placed my Belkin adapter install cd in the drive and looked around for the ini driver file, but could not see it. Finally, out of despair, I plugged the Belkin wifi adapter into the USB and LIKE MAGIC Ubuntu recognized it, asked me to choose a connection and enter the WEP key, which I have now done many times with other machines and during the Wubi Ubuntu install on Windows. So now I had a working Ubuntu machine connected to the Internet.

I went to J&R computer store up the street and found a $10 USB 4 gig memory stick by http://www.dane-elec.com which is REALLY cheap. I recently discovered that the Sancor memory sticks that I love actually have a lot of SOFTWARE on them, which only works under windows, AND if you have a password set on the device, then Ubuntu wont even read it.

I had to go into synaptic manager and search on usb for some installs. Again, it was trial and error, and I dont know what finally made it work, but finally, Ubuntu recognized the memory stick.

TODAY, I had to meet my step-son near at Borders Book Store next to Penn Station. This was lucky for me, because while I waited for him, I browsed the computer book section on the second floor. I found a $9 small Linux handbook reference of commands by Daniel J. Barrett (O Reilly publishers) so I got that to practice all the hundreds of Linux commands that I dont know but need to know.

I browse various books on Ubuntu and Mysql.

I found the key thing I needed to know for my next project, to install LAMP (Linux Apache MySQL PhP) on my new Ubuntu desktop.

All one needs to do is enter TERMINAL, and key in

sudo tasksel

(you will be prompted for your system password next)

A task selection window will pop up with many packages available for install, one of which is LAMP. Now here is a mystery that took me an hour to solve. You can arrow down to highlight LAMP, but you dont have a clue in the world as to how to CHECK it for install. Google revealed the secret: YOU SIMPLY PRESS THE SPACE BAR AND IT IS MARKED CHECKED FOR INSTALL. Then you press ENTER and the install proceeds, Apache, MySQL and PhP. You will be prompted for the MySQL admin password.

Next I wanted to install phpmyadmin to administrate mysql, creating databases, tables, etc. I went to SYSTEM-> Synaptic Manager and searched on phpmyadmin. I think there is only one. BUT HERE IS A SECRET. Once your LAMP install finishes, then power down and boot back up; otherwise, certain files will remain locked by processes and the phpmyadmin install will fail.

Once phpmyadmin installs (and you will again be prompted for that pesky password), then you can open firefox and key in http://localhost/phpmyadmin

You will be PROMPTED FOR A USER NAME AND PASSWORD. This is tricky and confusing. You have to key in the user name “root” without quotes, and then give the password that you have been using all along throughout this. Now you are in phpmyadmin, and you can go to Privileges, and create a new user and give him all possible privileges.

Then, I found a $50 book, also by O’Reilly, entitled
“Head First – PHP & MySQL”. THIS book looks like the perfect way to teach myself how to develop php mysql applications which will have proper security (which is a very complex topic).

I didnt purchase that book tonight, because I wanted to come home and see first if I could successfully install LAMP and phpmyadmin, which I just now finished.

The Head First book gave me links to try the book on line free for 45 days. Money is kind of tight, so I decided to see how far I can go without any additional purchases, but if I get things working, I will buy the book one day. It is interesting that O’Reilly also offers a link to an on line university which can grant degrees in computer science.

I signed up at Oreilly for a trial access of the electronic version of the above-mentioned book.

Here is something I tried which crashed my Ubuntu. I wanted to copy the introduction to the book, from the OReilly site, and PASTE it into an Open Office Document. The first time Open Office died, and the file was shown as requiring recovery. I did the recovery, opened it again with Open Office Document, and then the whole Ubuntu system crashed. I rebooted, and had to go through a long complicated reconstruct procedure. I thought perhaps I would have to install everything from scratch, but fortunately, Ubuntu repaired itself. Moral to story is paste into GEDIT and save, which I guess eliminates whatever hidden characters are in the webpage which cause Open Office to crash the system.

There, I found a link to download all the source code from the book.

I downloaded the zipped file of all the source code.

Next, I went to the source code for chapter 1. They have a beginning version (which I guess you make changes to, and then a final version).

I tried to copy and paste report.html to var/www which is where Apache wants to find pages loaded from local host. I was not allowed to paste because I do not have superuser privileges. So, I went to terminal and typed SUDO GEDIT, which gets me into gedit with super powers, so I can now navigate to the unzipped code in my DOCUMENTS in a special folder I created, open report.html, then do a save as to var/www.

THIS WORKED, because now, when I open Firefox and key in localhost/report , it runs the Chapter 1 example webpage.

FOR MY NEXT TRICK, I must figure out how to copy a chapter 1 tutorial image of a dog (fang.jpg) from the location where it unzipped (in a folder in my Documents) and copy it into var/www where I do not have Admin privileges. SO, I open my OReilly handbook of Linux commands and find the CP command. I open a TERMINAL session and key in SUDO CP which I know will executed it with super admin privileges, but NOW I do not have a clue as to what the PATH names are for the file source and destination.

I am permitted to copy fang.jpg from the unzipped file into DOCUMENTS, just to simplify things.

Using PLACES -> COMPUTER, which brings up the FILE BROWSER, I first navigate to home/Documents and I RIGHT CLICK on the fang.jpg image, and click on PROPERTIES which will SHOW ME that the path is
/home/bryan/Documents/fang.jpg (I use bryan as my user name, but that is my step-son’s name). Next I do the same right click trick on any file which is already in var/www such as report.html, and I discover THAT path, which tells me that the command I should issue in TERMINAL is

sudo cp /home/bryan/Documents/fang.jpg var/www/fang.jpg

BUT IT HANGS… NOTHING HAPPENS.

Then I realize that I should close my other applications, because they are somehow LOCKING UP something that the CP command needs. Sure enough, once I close a bunch of applications, the SUDO CP command asks me for the PASSWORD and then copies fang.jpg to var/www

I can now bring up the image by opening Firefox and typing

localhost/fang.jpg

into the browser address field.

NOW that fang.jpg is in var/www, if I once again open Firefox and type
localhost/report.html

the exercise 1 page loads and also shows the picture of the little dog fang.jpg

I still need to copy report.php and style.css from the place where they unzipped to var/www. Since I can launch gedit with sudo and have superadmin powers, I may open them in that fashion and do a save as.

I ran the finished example, hoping that it would actually send me an email.

I realized that I must examine my php.ini and somehow reconfigure it. I went to some pains to locate that file, but did not post notes as I went, and now I must reconstruct what I did. I still have not succeeded in getting the app to actually send an email through php. But I feel it is more essential for me to move on to other lessons in the HEAD FIRST book.

Advertisements

Dulcinea-Beatrices and my Holy Grail

November 17, 2009

It was an UTTERLY awesome experience.

I had to redo each and every step of the way about 10 or 20 times, guessing about different tricks, before each stage would work, because there is little documentation, and the intall utilities are not intuitively obvious.

It took a few hours of playing around to realize that Windows was a lost cause.

Then, I tried to install Ubuntu from a CD about 20 times. I then realized I had to drop to drive C: and say FORMAT, and reformat the entire drive.

Then, I remembered too late that I should have first used FDISK, to adjust the PARTITIONS.

So, I burnd an ISO image cd of a linux utility which can repartition the drive. There is little documentation on how to do this. PLUS, you mentioned that your mouse was so old. Well, it was doing weird stuff, like I had to RIGHT click instead of left click. Finally, I switched to the newer usb mouse, and it worked FIND.

I had to try repartitioning the drive about 4 times. FInally I realized from obscure error messages that what it WANTS me to do and NEEDS ME TO do is to create THREE partitions in your 280 gig drive. The first is called ROOT, which makes everything in Linux run, except you simply name it “/” (forward slash, without the quotes).

Root has to be a certain size but not too big. I chose 512 and at the end of the process, it made me go back, saying that was too small, so I made it 5000. The second partition is what is called the SWAP partition. You do not give it a name, but with each partition you are offered 20 different flavors of format. I had to google to learn that ext3 is preferred for Ubuntu/Debian linus. So the second partition you do not name at all, and you choose the type SWAP-FILE, and it automatically makes that your swap file. Then, the third and humungous partion of 200 gig is called /home and is format type ext3. Then you finalize it, and it chugs away formatting and testing the drive.

Next, you put in the Ubuntu install and boot from that. I have a 2008 Ubuntu disk, and one created last week. I tried both of them over and over. They would run 30 minutes and then stop. FINALLY, the recent ubuntu disk actually INSTALLED itself and came up with the Ubuntu desktop, but it had alll sorts of error warning that make me think it had failed. But on the desktop was a strange folder saying INSTALL UBUNTU. Out of curiosity, I clicked on that, and low and behold, that was the part that would finish the install. It dumped me into a different partition utility. Finally, Ubuntu is installed, but no internet connection. I plugged a cable from the router to the ethernet card. I was told by forum members that Ubuntu would just automatically sense the Ethernet card and attach to internet. Didnt work. Then I followed a Youtube tutorial on how to install a Belkin USB adaptor. I did it several times. It didnt seem to work. But then, out of curiosity I plugged in the Belkin to the USB (which I had done earlier and nothing happend). Suddenly, I had internet connection.

Thanks you so much for giving me this machine, and making possible an experience with Ubuntu which I have wanted for several years, but never had a spare machine to take chances with.

ANd this machine is SUPER FAST on the internet, even though it is only a WiFi connection. Ethernet hardwire is supposed to be much faster. Anyway, I will sleep for a couple of hours, and be over in the afternoon to pick up that Mybook for repair.

I feel like superman with this success, or Dante, crawling through all of hell and pergatory, and finally getting a glimpse of Ubuntu heave.

I know I must run to J&R to get another $10 Belkin laser mouse, because your old mouse is so weird. And another belkin wifi adaptor. Then, all we need is a monitor at some point because we have 4 computers and 3 monitors.

Even my headphones and mic work in this Ubuntu. THey would not work on my Wubi install of Ubunu on top of windows.

Also, I am going to buy a cheap $7 memory stick and see how it works. Those sancor have SOFTWARE On them, which makes them more expensive. But the cheap ones are simply USB devices, and should serve my needs.

But your old Gateway was so trashed in Windows, it was hopeless. And now it is brand spanking new with a fresh Ubuntu install, and no viruses, no firewalls, no antivirus overhead. Apparently, Ubuntu is not as susceptible to viruses.

Anyway, thanks and talk to you later, and see you today to pick up that Mybook. I will make it my Holy Grail to retrieve the data, and you will be my Dulcinea, my Beatrice (remember, Quixote, and Dante).

Later !!!

Ubuntu, Ethernet, and Empathy chat

November 15, 2009

My reply at bleepingcomputer.com

One member answered my question:
Why would plugging a PC, no matter what OS is installed on it, into a modem/router change it? So no I wouldn’t worry about the Westell.

My reply:

Thanks! That’s just what I needed to know. But, obviously, I am not technically versed. So what is OBVIOUS to you may not be obvious to me.

A professor of Russian language, in the 1970s once said to me “There is no such thing as a foolish question, for IF it is a question in your mind, it is a LEGITIMATE question. There are only foolish answers.” Beginners should be encouraged to ask questions, and not ridiculed, for that is how they learn. And those who are fortunate enough to have expertise and experience should not gloat in their knowledge as if it were wisdom.

I once mentioned to an examining physician something very obscure and little know, about the anastamosis (joining) of a one vein to the left renal vein which is totally different on the right. He was astounded and asked how I could possible know that, not being a physician. I explained that all one has to do is read, and remember a fact, and the only difference between a physician and a plumber, is that plumbers still make house calls, but physicians do not.

Plus, if I had 5 routers, and 3 providers, and money flowing out my kazoo, I would just plug the cable in and see what happens. But, if something DOES go wrong, then since I only have one router and one provider, then I must spend hours on the phone with tech support, or, if that fails, spend days waiting for a technician to show up from Verizon.

Oh, by the way, I found a free beginners manual in PDF, on Ubuntu, which also mentions that IF the Ubuntu machine has an internet card, THEN connecting it to the router should give instantaneous internet access.

http://www.ubuntupocketguide.com/index_main.html

And, this is a bit off topic, but I spent much of last night experimenting with that Ubuntu chat program EMPATHY. When I initially clicked on Empathy, it launched a wizard asking me first if I wanted a Jabber account, and then asking me if I want to add AIM, MSN, Yahoo, ICQ, etc.

I only added Yahoo. Later, I tired to add other things and could not see how to get back into that wizard dialogue. I googled and found other posts suggesting that there was some problem. I UNINSTALLED REMOVED and reinstalled EMPATHY, but still no wizard. THEN I discovered that F4 will bring up a window to ADD other chat programs (which is not intuitively obvious to a beginner). I was pleased to see that my Wubi Ubuntu install is stable enough to remove and reinstall Empathy without crashing things.

I am very curious to explore the limits of the Wubi install on a Windows machine. Tonight I will have that old tower, and do a pure Ubuntu desktop install, and first I will try the wrapper technique with a Belkin Wi-Fi, and later I will experiment with the cable from the Ethernet to the router. I was a bit confused as to whether I should install Ubuntu DESKTOP or Ubuntu Server, but reading up on it made me realize that I am better off with the Desktop, because that gives the most GUI, and then ADD LAMP (Apache, MySQL, PhP) with the synaptic manager, since that is all I really want anyway and I will not use the machine as an actual server to other clients.

Details of Network Adapter in Ubuntu

November 14, 2009

Enter TERMINAL

lspci -v | less

00:00.0 Host bridge: Intel Corporation 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface (rev 01)
Flags: bus master, fast devsel, latency 0
Memory at f8000000 (32-bit, prefetchable) [size=64M]
Capabilities:
Kernel driver in use: agpgart-intel
Kernel modules: intel-agp

00:02.0 VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 01)
Subsystem: Compaq Computer Corporation Device 00b8
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at f0000000 (32-bit, prefetchable) [size=128M]
Memory at fc400000 (32-bit, non-prefetchable) [size=512K]
Capabilities:
Kernel driver in use: i915
Kernel modules: i915

00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
Subsystem: Compaq Computer Corporation Device 00b8
Flags: bus master, medium devsel, latency 0, IRQ 16
I/O ports at 2440 [size=32]
:
NOW FOR THE WIFI:

ENTER TERMINAL

lsusb -v | less

00:00.0 Host bridge: Intel Corporation 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface (rev 01)
Flags: bus master, fast devsel, latency 0
Memory at f8000000 (32-bit, prefetchable) [size=64M]
Capabilities:
Kernel driver in use: agpgart-intel
Kernel modules: intel-agp

00:02.0 VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 01)
Subsystem: Compaq Computer Corporation Device 00b8
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at f0000000 (32-bit, prefetchable) [size=128M]
Memory at fc400000 (32-bit, non-prefetchable) [size=512K]
Capabilities:
Kernel driver in use: i915
Kernel modules: i915

00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
Subsystem: Compaq Computer Corporation Device 00b8
Flags: bus master, medium devsel, latency 0, IRQ 16
I/O ports at 2440 [size=32]
: