Tuesday, April 26, 2011

Testing Ubuntu Lamp 11.04 Natty Narwhal Server edition

So several days ago, my development server (that was loading Ubuntu Server 10.10 Maverick Meerkat) began giving problems. It started with suddenly not being able to connect via wireless ... and then, while we were still trying to figure out the solution to that problem, it stopped booting up up. We could not figure out what the problem was, only that possibly there might have been a hardware problem (maybe power supply?). So we changed the power supply and still could not boot up because some of the boot files had become corrupted.

We then decided to try out the 11.04 version which was not yet released, but the release was / is only days away.

We were able to get the server up and running, however, still could not get the wireless working.

Then it crashed again, this time for no discernible reason ... we had just got things up & running & perhaps the only thing in common was server updates had been done and we discovered certain boot files had broken links ... specifically the initrd.img & vmlinuz.img links.

Through this entire process, we learned a few useful tips from a variety of sources (sorry I do not recall exactly who) and I thought I should post them here for reference:


1. Download and install the server version of the operating system ... while going through that process, provide (when asked) the server host name, the user name and password, ... also select what server software you would like installed on the computer (LAMP, Samba, etc.) & make sure to provide a user name and password for mysql also.


2. To get the desktop to install over the server, download the alternate desktop cd version and after booting the server:
type
sudo apt-cdrom add
sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo dpkg-reconfigure xserver-xorg
sudo /etc/init.d/gdm start


3. Installing Additional Server Software
If there is any server software that perhaps you forgot to install initially, you can always install them using one of the following ways:
A. Open terminal (Programs > Accessories > Terminal or with your keyboard, simply type Ctrl+Alt+t); Then type the following commands:
i)To install Apache:
sudo apt-get install apache2
Now to confirm the installation of Apache2 open http://YourIpAddress in your web browser, you will see It Works! default page of Apache.
ii) To install Mysql:
sudo apt-get install mysql-server
At the installation you be will asked to provide a root password for Mysql.
iii)To install php:
sudo apt-get install php5 libapache2-mod-php5
After this installation restart Apache [sudo /etc /init.d/apache2 restart] don’t write brackets.
iv)To install phpmyadmin:
sudo apt-get install phpmyadmin
Two option window will open in installation one for web server reconfigure automatically[select apache2] and second for configure database for phpmyadmin with dbconfig-common [select No].
You will need to copy the apache.conf to /etc/apache2/conf.d/ from /etc/phpmyadmin/ or the page will return a 404 error.
To copy Run-
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d
Now you have to restart your apache server
sudo /etc/init.d/apache2 restart
Now open http://YourIpAddresss/phpmyadmin

B. Alternately, you can install LAMP by opening Linux Tasksel
i) If you do not have Linux Tasksel installed already (most server editions do not have to worry about this, so those users can skip to ii) below), in terminal type
sudo apt-get install tasksel
and that command will install the software for you;
ii) to open & use the software, in terminal, type
sudo tasksel
and the software application window will open up for you;
iii) In the Tasksel window select the server software that you would like to install (LAMP for example) and click the space bar to select it;
iv) do the same to add more of the server softwares available. Use your arrow keys to highlight each available software in turn and the space bar to select them for installation;
v) to install everything you've selected, click the enter button on your keyboard;
vi) please remember, during installation, you may be asked to provide user names and passwords, so it would be a good idea to stay close by during this process.


4. Setting root password (just incase you can not sign in to your webmin account using your regular user name and password):
Launch the Terminal by going to Applications > Accessories > Terminal
Type or copy and paste the following command
sudo passwd root
Enter your user password
Enter the password you wish to use for the root user.
Enter the password one more time.
To test out the changes you can switch to the root user and try login in.
su
Enter your new root password.
You will now notice that it says root@YourSystemName.
You could also enter the following command:
whoami
Now to logout as the root user use the exit command
exit
You can easily change the password at any time for root by just following these steps again.

1 comment: