Ubuntu 8.04 (Hardy Heron) LAMP Server Setup
Sponsored Link
The LAMP option means you don't have to install and integrate each of the four separate LAMP components, a process which can take hours and requires someone who is skilled in the installation and configuration of the individual applications. Instead, you get increased security, reduced time-to-install, and reduced risk of misconfiguration, all of which results in a lower cost of ownership.New pre-configured installation options have been added to the Ubuntu Server. Mail Server, File Server, Print Server, and Database Server options join existing LAMP and DNS options for pre-configured installations, easing the deployment of common server configurations.
Ubuntu LAMP server Install the following Versions
Ubuntu Hardy Heron 8.04
Apache 2.2.8
Mysql 5.0.51a
PHP 5.2.4
First you need to download server version of Ubuntu version from here after that you create a CD and start booting with the CD Once it starts booting you should see the following screen in this you need to select your language and press enter
Now you need to select "Install Ubuntu Server" and press enter
Ubuntu Server CD is loading in Progress
Choose you language and press enter you can see we have selected english in the follwoing screen
Choose your location and press enter you can see we have have selected United Kingdom in the following screen
If you want to try to have your keyboard layout detected by pressing a series of keys you need to select yes option and if you don't want that and you want to choose from a list click no in this example we have selected no and press enter
Select Origin of keyboard and press enter
Select keyboard layout and press enter
Detecting hardware to find CD-ROM Drivers in progress
Scanning CD-ROM in Progress
Loading additional components progress bar
Detecting Network hardware is in progress
Configures the network with DHCP if there is a DHCP server in the network
Enter the Hostname of the system so in this example i enter here as ubuntulamp
Startingup the partitioner in progress
you have to partition your hard disk in this example i have selected use entire disk option if you want to edit manually you can choose manual and press enter
Warning message about data lost on your hard disk
Creating partitions in your hard disk is in progress
Write the changes to disk option here you need to select yes and press enter
Creating ext3 filesystem in progress
Installing base system is in progress
You need enter the Full name of the user you want to create for your server in this example i have created administrator user select continue and press enter
username for your account in this i have entered test select continue and press enter
Entered the password for test user select continue and press enter
Confirm the password for test user select continue and press enter
Configuring the package manager select continue and press enter
Configuring package mirror this will be related to your country option
Now it will start Installing software and here you need to select the server options here i have selected as LAMP and OpenSSH server for our LAMP server installation
At the time of software installation it will prompt for mysql server root password enter root password of your choice and select continue
Confirm mysql server root password and select continue
Software installation is in progress
Installing GRUB Boot loader in progress
Finishing installation in Progress
Installation complete message here you need to remove your CD select continue and press enter it will reboot your server
After rebooting you can see the following screen prompt for username
This will complete the Ubuntu LAMP Server Installation and your server is ready for installing applications which supports apache,mysql and php.
Configuring Static ip address in Ubuntu server
Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10):
sudo vi /etc/network/interfaces
and enter the following save the file and exit
# The primary network interface
auto eth0
iface eth0 inet static
address 172.19.0.10
netmask 255.255.255.0
network 172.19.0.0
broadcast 172.19.0.255
gateway 172.19.0.1
Now you need to restart your network services using the following command
sudo /etc/init.d/networking restart
You need to setup manually DNS servers in resolv.conf file when you are not using DHCP.
sudo vi /etc/resolv.conf
You need to add look something like this
search domain.com
nameserver xxx.xxx.xxx.xxx
GUI Installation for Ubuntu LAMP Server
Option1
If you are a new user and not familiar with command prompt you can install GUI for your ubuntu LAMP server for this you need to make sure you have enabled Universe and multiverse repositories in /etc/apt/sources.list file once you have enable you need to use the following command to install GUI
sudo apt-get update
sudo apt-get install ubuntu-desktop
The above command will install GNOME desktop if you want to install KDE desktop use the following command
sudo apt-get install kubuntu-desktop
Option2
Installing Webmin in Ubuntu Hardy Heron
Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.
You can install webmin for your server web interface to configure apache,mysql servers.Now we will see how to install webmin in Ubuntu 8.04
Preparing your system
First you need to install the following packages
sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
Now download the latest webmin using the following command
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.420_all.deb
Now we have webmin_1.420_all.deb package install this package using the following command
sudo dpkg -i webmin_1.420_all.deb
This will complete the installation.
Ubuntu in particular don't allow logins by the root user by default. However, the user created at system installation time can use sudo to switch to root. Webmin will allow any user who has this sudo capability to login with full root privileges.
Now you need to open your web browser and enter the following
https://your-server-ip:10000/
Now you should see similar to the following Screen
After login if you want to configure Apache,Mysql server you need to click on Servers on your lefthand side you should many servers are ready to configure
This is very Easy to configure most of the servers and Enjoy your new Ubuntu Hardy Heron LAMP Server.
I have almost completed option 2. The only problem I have is that I don’t know server IP Address. Can you tell me how to find out what it is?
Thanks
try to run the following command
ifconfig
if you have dhcp server in your lan or home it will pickup from there
Thanks for the interesting Howto. It would be great, if you’ll be able to publish a Howto which shows how to get access to the server from a different computer (e g Windows, Ubuntu) by using ssl, samba or whatever. Thanks!
I’ve been working on trying to get this installed all night, with little success. After each time I perform the installation, it reboots and then freezes at GRUB. I’ve tried several different partitioning methods of my 3 drives. I think 1 is dead, so I’ve left it unmounted for most of the tries. But, this is also the first drive (sda), so could that be a reason for GRUB to freeze? I’ve set the primary partition on sdb to / for the root file system and made it bootable, yet its still not working. Any ideas?
@Brad
Maybe you can switch the hard drives from place (inside you system) Or taking the dead out of your system. If that doesn’t work try to give your MBR (master boot record) his standard specifications and then try to install Ubuntu. I really hope that you can figure it out.
@Frank
Yep, I took the dead drive out of the system, re-ran the setup, and everything worked like a charm. I’m guessing the automated Grub installer setup the boot disk as the first disk in the system, and not the disk shown to be the boot drive in the setup. Now I just need to learn all the ins and outs of Webmin!
This kind of easy setup is *not* exclusive to Ubuntu Server Edition. I can easily set up a server using Ubuntu Desktop with this command –
sudo tasksel install lamp-server
You can install a lot of other “tasks” by simply typing in –
sudo tasksel
Hey,
I followed this tutorial (thoroughly, but with settings matching my network and computer) and installed it all on a virtal server on WMware Workstation 6. I get to the point after I have run wget http://prdownloads.sourceforge.net/webadmin/webmin_1.420_all.deb (which works fine), but when trying to install it with sudo dpkg -i webmin_1.420_all.deb</strong it says “No such file or directory”. Any ideas why he cannot find it?
For the record, I am running Ubuntu 8.04 Server Edition (latest, downloaded it off ubuntu.com today) on a Windows XP-SP2 machine with working internet through a router (I can also ping with IP and name through the virtual ubuntu server).
@Ole Henrik Hunstad Vik
you need to make sure webmin_1.420_all.deb package is located in the directory where you are trying the following command
sudo dpkg -i webmin_1.420_all.deb
try the following command
ls -l
Upon entering ls -l (lowercase L) I get this:
total 16
-rw-r–r– 1 adminstrator administrator 10377 2008-06-14 12:29 files
-rw-r–r– 1 adminstrator administrator 746 2007-08-08 12:06 files webadmin_1.420_all.deb
so I tried running sudo dpkg -i webadmin_1.420_all.deb (cause for unknown reasons, mine says webadmin instead of webmin), but then it just says dpkg-deb: ‘webadmin_1.420_all.deb’ is not a debian format archive.
Any idea why? And also, the name of the .deb file was marked in red. And any chance you could change my full name up there to just “Ole”?
@Ole Henrik Hunstad Vik
i suspect that you may be having corrupted .deb package.delete the existing file and download again now install the file with the following command
sudo dpkg -i
After following the instructions for installing KDE and WEBMIN…I get the following:
An error occurred while loading https://ubuntuserver:10000/:
Unknown host ubuntuserver
also tried this with the IP address, it complained about the port, so I tried 9100, still same problem.
“sudo apy-get install kubuntu-desktop”, did not work but…”sudo apt-get install kde”, worked.
Being a novice..I really need something like webmin to help me out.
try to use the following format
https://ubuntuserverip:10000/
example:
https://192.168.1.2:10000
check your ip using the following comamnd
ifconfig from command line
Hi,
I would like to use this LAMP server to test my CMS website. How can I access the PhpMyAdmin to manage MySql databases & what parameters can I use to ftp?
This will allow me to test/modify my website before uploading it to my ISP.
Thanks in advance,
C Dhanjal
Umm, I don’t know what to do from here, where do I put my website directory?
This was a totally easy walk-through thank you for taking the time to do it. And to all the commentators, I would not have gotten this far without you!!
bert
Thx for this, worked like a charm
To add to what Andrew stated about installing Tasks from Ubuntu Desktop version…
sudo tasksel install lamp-server
In Synaptic Package Manager, go to the Edit menu and select:
Mark Packages by Task…
This allows you to install Ubuntu’s LAMP configuration from your desktop in a click. As well as DNS, Mail, OpenSSH, Postgres, Kubuntu / KDE4, Xubuntu, Ubuntu Studio, etc…
Hey, I completed the installation, but when I go to log into my server it gives me an error and says it’s running in ssl mode.
My task is to make this into a fileserver with users and such.
I’m about to try this out, but I’m not sure what to do about the IP address. I want to put this after my router and only have it turned on when I want to use it (when I’m not at home and want to access the files on it). Since my router is assigning an IP address to the server, should I skip the step about changing to a static IP address?
@adam
If you have DHCP server in your router you don’t have to use static ip address router.If you want to use static ip address you can follow that section
Tried it, but couldn’t download all the Perl libraries. Keeps saying “Package libnet-ssleay-perl is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or
is only available from another source.
E: Package libnet-ssleay-perl has no installation candidate.”
As far as I know, the Universe and Multiverse are installed, but how can I check to be sure?
Great guide. A big thank you for sharing this. I followed it and everything worked perfectly. The only deviation I made was to run: sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoclean
before installing Webmin to make sure the installation was fully up to date.
Regards
david
First, I want to agree with comment #7 (Andrew). In fact, tasksel is implemented within synaptic so you don’t even need the command line:
System > Administration > Synaptic Package Manager > Edit > Mark Packages by Task > ‘LAMP Server’
Second, you can also avoid the command line when installing webmin:
System > Administration > Software Sources > Third-Party Software > Add
Then enter the webmin repository:
deb http://download.webmin.com/download/repository sarge contrib
(Also make sure ‘Universe’ is enabled on the ‘Ubuntu Software’ tab). At this point you can go back to synaptic, search for ‘webmin’ and install it – all dependencies will be automatically resolved and you can use apt (or synaptic) for updates.
Most of this is explained on the following Webmin page:
http://www.webmin.com/deb.html
All you people who say you don’t know your IP address, use localhost instead, ie
https://localhost:10000
Will access webmin on the machine you are using. (Naturally, you want to install a desktop first…)
type in at the end of the install https://xxx.xxx.x.xxx:10000 and I get no such file or directory I got a good ip addr when ifconfig can you help me on this?? if you can please do thanks
Wayne
I was looking for this..Noob in ubuntu.. I would like to admin torrents from work through the web. This should get me started
it was great! I needed that badly.
thanks man.
Error – Bad Request
This web server is running in SSL mode. Try the URL https://192.168.0.102:10000/ instead.
Getting this error.
@jake
if you trying to use http://serverip:10000 you will get this error so you need to try
https://serverip:10000
Good site! Used it without a hitch to setup u-server under vmware on (shudder ms vista)
and have a great working platform for the development I need!
TKS!!!