Tuesday, April 26, 2011

Install Webmin via terminal

Ok so,
now you may have a problem because although LAMP is installed, webmin is not yet installed.To download and install webmin:

1. In terminal:
a) First download some needed perl related libraries & also (this is for webmin 1.5x) apt-show-versions
sudo apt-get install apt-show-versions perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl
b) Then download webmin either by visiting http://www.webmin.com/download.html and downloading the .deb version of the file or via terminal using the following code:
wget http://www.webmin.com/download/deb/webmin-current.deb
If you use the former method of downloading the debian package, please copy the download to your home folder or the folder that you are currently in (you can determine which folder that is from terminal, by typing the following code dir)
c) install webmin via terminal by one of the following two options:
sudo dpkg -i webmin-current.deb
or
sudo dpkg --install webmin_1.5xx_all.deb
(where the xx in the webmin package name stands for the webmin version you downloaded).

And that should be it ... it may take a few minutes to do the installation, but, after that you should be ready ... when you see a message something like the following, the installation will be complete:
Webmin install complete. You can now login to https://YourServerNameOrIpAddress:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.

Please note that installing webmin via terminal does not mean you will automatically be able to sign in to webmin using your regular user name and password ... you might initially be required to sign into webmin using root as your user name and set a password for root via terminal ... using the method described in the previous post.

However, once logged in as root, you can add your regular user account to webmin, by:
1. clicking on the "Webmin" link on the top left column and then
2. selecting "Webmin Users"
3. Clicking on the link (on top) titled "Create New User"
4. Enter the user name and where it says password, select, from the drop down menu, change "set to" to "Unix authentication", enter the real name (as identified when you first registered for your server's user account);
5. Next, click on the "Available Webmin Modules" blue bar and from the drop down select the module options you would like this user to have access to, or click the "Select All" option and then click the Create button, down below.

That's it, your new webmin user is now created using your default linux user name and password.

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.