I’m not interested in using Linux for my desktop, Gnome and KDE really don’t do it for me and Windows XP is doing me fine - though I am looking forward to moving my studio onto a Mac Pro. Another big reason Linux as a desktop isn’t for me is that Adobe’s Creative Suite 3 does not, and won’t by the looks of things, support any flavor of Linux.
I’m after a new Server environment. I’m in the process of switching from Classic ASP (ASP3) over to PHP5. I’ve been using MySQL religiously for my dev work. But what I really want access to is the speed and reliability of Apache and PHP running on Linux. Also the chmod in ftp will save SO MUCH TIME when setting up blogs or any other site that requires permission changes.
So it’s time to learn - and by learning I mean command lines. Back to the good ‘ol DOS days.
I found Ubuntu 7.10 Server to be the solution for me. Why? Because a) It’s built on Debian and 2) they are the best at marking their flavor of Linux and bringing it to the attention of us Windows users.
Also a great feature that I found is that in around 15 minutes you can have a LAMP (Linux, Apache, MySQL and PHP) server up and ready to go! You just select it during installation!
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.
Here’s what will be installed
Installing Ubutnu Server I found to be really simple and once I did it a couple of times (due to errors on my behalf) I quickly found it even easier to install then Windows 2003 Server
You’ll need to first download Ubuntu Server from http://www.ubuntu.com/getubuntu/download. Burn the ISO or mount it in VMWare if you are installing it on a virtual machine. Insert the CD a make sure you BIOS is set to boot from the CD/DVD drive
Log into your server using the details you entered during install. I’m using 192.168.0.150 as my example IP)
Type
sudo su
and enter your password again
Then Type
nano /etc/network/interfaces
If you have typed it out correctly you’ll Also you will see the following:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet dhcp
Replace the last 3 lines with the following:
# The primary network interface
auto eth0
iface eth0 inet static
address 172.19.0.10
netmask 255.255.255.0
network 172.19.0.0Try Ctrl+O to write the file and then press enter
Type Ctrl+X to exit
To set your Nameservers, type
nano /etc/resolv.conf
Enter in your nameservers as required “nameserver xxx.xxx.xxx.xxx”
Type Ctrl+O to write the file and then press enter
Type Ctrl+X to exit
Now you need to restart your network service. Type the following
/etc/init.d/networking restart
You’ve now configured your network interface.
I also wanted to also install Webmin to manage my server remotely as well as SSH but I found that the install instructions on the above site just didn’t work for me. So here is how I installed Webmin on my Ubuntu Server.
You will need to enable the universe and universe and multiverse repositories in the /etc/apt/sources.list (https://wiki.ubuntu.com/AddingRepositoriesCliHowto)
This is also where I started to use Putty and SSH (http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe)
sudo su mkdir /opt/Webmin cd /opt/Webmin wget http://easynews.dl.sourceforge.net/sourceforge/webadmin/Webmin-1.390.tar.gz gzip -cd Webmin-1.390.tar.gz | tar xvf - sudo apt-get install libauthen-pam-perl libnet-ssleay-perl libpam-runtime openssl perl perl-modules
Note I had heaps of problems with this command and it was to do with my sources.list file. No matter what I uncommented it just didn’t seam to work. I had to generate a new sources.list file from this site (http://www.ubuntu-nl.org/source-o-matic/) and past that into /etc/apt/sources.list then run sudo apt-get update before the above command would run
cd Webmin* ./setup.sh
Basically just hit enter and choose SSL and the auto start the service at boot. Use these settings (or change as requried)
Web server port (default 10000): (Feel Free to change this) Login name (default admin): Login password: AReallyGoodONE Password again: AReallyGoodONE Use SSL (y/n): y Start Webmin at boot time (y/n): y
I found that the default instating module for PHP looks for the php.ini file in the Apache directory when it needs to look in the apache2 directory. After instating login into Webmin by visiting https://your-ip:10000 and click on “Other” in the right bar. Then click on “PHP Configureation” You should see that following:
/etc/php5/apache/php.ini=Configuration for mod_php /etc/php5/cgi/php.ini=Configuration for scripts run via CGI /etc/php5/cli/php.ini=Configuration for command-line scripts
Change the line /etc/php5/apache/php.ini=Configuration for mod_php to read /etc/php5/apache2/php.ini=Configuration for mod_php and click save
This should have configured the PHP moduble for Webmin for you.
FTP
Now were going to install ProFTPD FTP server.
Login into your Ubuntu Server via SSH, or how ever you wish to access the console, and type:
sudo apt-get install proftpd
When asked if you want to install the server as a inid or standalone, select standalone and continue.
Done! Now if you check back in Webmin under Servers you’ll see ProFTPD Server, if you click on that you should see the ProFTPd options up and running.
Adding a FTP user is done through the “System => Users and Groups” area in Webmin. You just click on “Create a new user” enter in the details and select the home directory to /var/www (make sure you click the check box next to the home directory text box as it stays checked at “Automatic” even once you enter something into the text box.)
Fire up your ftp client and login!
You should now have a working LAMP+F (Linux, Apache, MySQL, PHP and FTP) Ubuntu Server. Next I’ll be looking into securing the server. I’ve read that ProFTPD isn’t the most secure FTP Server to use with Linux, apparently VSFTPD is the way to go there, but for the purpose of simplicity for the first time, and the fact that this is not a live server, rather just a testing box, it’s not such a big deal.
Please post your comments on this, if you find it useful please let me know - anything that needs further clarification tell me - I’m new to Linux as you might be so this is a big change.
This entry was posted on Wednesday, January 16th, 2008 at 10:45 am and is filed under Linux, Tutorial. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Hi Gary,
Sorry for the late reply - Only just got back to my blog.
Permissions are a funny thing i’ve found with GNU/Linux and something i’m still getting my head around.
Once I do mate i’ll get something posted
the title says “Installing Ubuntu Server LAMP,SSH,FTP,Webmin and phpMyAdmin for a newbie” yet i see nothing about phpmyadmin
Jay, you are completely right! I’m sorry about that. I’ll write a tutorial on that one today
Worked a treat!
Thanks for the great tutorial, and please do do the ones on the other areas.
Thanks!
Thanks Swerve,
I’m glad you liked it. I’m planning on Creating another for setting up phpMyAdmin (which i forgot to finish in this post)
Keep checking back
Hey… I have installed Webmin a couple of times now and I seem to have an issue with it reporting that Apache is down when it is really working. Any ideas why this might be? Thanks!
Hi Nick,
I’m sorry but i have no idea! Never come across that. Try looking in the Ubuntu forums or wiki.
If you find the solution, please post a reply comment
I read similar article also named ing Ubuntu Server LAMP,SSH,FTP,Webmin and phpMyAdmin for a newbie -, and it was completely different. Personally, I agree with you more, because this article makes a little bit more sense for me
Hi Daniel,
I’m glad you liked it. I’m going to write an update to it soon as I’ve been working with Linux for a while now. Look out for it mate
Title : My Boy (1)
Media: Canon EOS 350D DSLR, Adobe Lightroom, Photoshop
Description : A day out in the park with my world.
Title : Tasmania Corrective Services Badge
Media: Adobe Illustrator, Stitch
Description : Badge for the Canine Drug Detection Unit
Title : Webb Martin Consulting Website Concept 1
Media: Blog/Website, flash, css, xhtml, php
Description : Website deisgn for Webb Martin Consulting
Title : Webb Martin Website Design Concept
Media: Wordpress, CSS, xhtml, php
Description : Concept website design for Webb Martin.
Gary Flores Says
Setting up the FTP user like that with the default options on proftpd lwt you right in the /var/www/ directory?
I’m having problems with the writing permisions… could you emailme?