Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Help Setting Up Server


  • Please log in to reply

#1
Troy

Troy

    Tech Staff

  • Technician
  • 8,841 posts
Hi all,

Time I asked another question and gained valuable insight from the wonderful helpers we have here... :D

I've just finished setting up an old box that's going to be my server. It's an old Compaq 6230AN with a few upgrades to help it last a good while - new Antec Earthwatts 380W PSU, new Seagate IDE HDD, near-new Pioneer DVD Burner, new Kingston 1GB RAM, new FX 5200 graphics card (old one had bad artifacts), and a wireless card so it can sit under my desk and draw as little attention as possible to the rug rat. :) Sure it's probably way overkill, but I'm a hardware junkie, what can I say? I may as well have just built a whole new computer, but this one already runs pretty good and is more than powerful enough, so it suits me fine.

I have purchased a domain name. :)

My friend has helped me set up the domain name to point to my static IP address. :)

I know how to open ports 80 (HTTP) and 25 (SMTP) on my router, and will do so when everything is set up and ready to go. :)

I don't have a completely built website just yet, that's still in the works (and you'll probably get some questions on that later!), but I do have an index.html file all ready to go explaining the website is under construction. Simple, and it should work. ;)

Anything missing yet? :)

So now down to the nitty gritty... What OS should I use as a server? I want a GUI - this is a must. I am experienced (a bit) with Ubuntu, and can get the wireless card working properly, so that would be a plus. The box does have the original XP Home Edition product key, but as the original hard drive carked it and there's been a few hardware changes, the Compaq recovery discs will most probably not work.

Here's what I want:
  • People to access the html files on my computer that contain the website
  • People to be able to email me at any name @mydomainname.com.au and it comes through to me somehow
It's not that big a list, but I've never done this kind of thing before, and would greatly value any input people have. I should be able to achieve all this from the one server box, right?

A friend has said to try Ubuntu with Apache, anybody have experience with this? I've got a lot of reading to do on it, and not a lot of reading time to do it in, but any links or help would be nice.

Cheers

Troy
  • 0

Advertisements


#2
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Alright, lets start with what starts a complete flame far once a month on Linux server forums:

[quote]So now down to the nitty gritty... What OS should I use as a server? I want a GUI - this is a must. I am experienced (a bit) with Ubuntu, and can get the wireless card working properly, so that would be a plus.[/quote]

Linux server are not meant to have GUIs. Absolutely no administration should be done via GUI tools. A couple reasons why:

Security - less code, less potential holes.

Power and flexability - GUI tools are nothing more than a "crutch". Everything that can be done in a GUI can be done faster and more efficiently via the command line.

Remote Access - Linux servers meant to be ran headless and remotely managed via SSH or Webmin. Webmin is the recommended administration method for people who really want GUIs

My own personal experience - I spent three days trying to get openLDAP to work via a GUI tool. On that 3rd I found the GUI wasn't making any changes to config file. I changed the config file myself and in minutes openLDAP was up and running.

If you have noticed my guide for Exim4 is entirely CLI.

OS - My recommendation is Debian Etch. Mostly because it's been around the server market a bit longer that Ubuntu. CentOS is also a very popular server OS. If you hardware works well with Ubuntu that is also a good choice. My Exim4 guide will work with both Ubuntu or Debian Etch.

[quote]* People to access the html files on my computer that contain the website
* People to be able to email me at any name @mydomainname.com.au and it comes through to me somehow[/quote]

Change A records to point to your static IP for website. Change MX records for your domain for your email. Apache is trivial and I would begin with that. Make sure you look at Ubuntu or Debian specific documentation if you go with one of their OSes because their config file is unlike the other Linux distros (uses multiple config files instead of one large one).

[quote]I know how to open ports 80 (HTTP) and 25 (SMTP) on my router, and will do so when everything is set up and ready to go.[/quote

This will get your server to receive and send mail, however, you will need to also forward the POP or IMAP port if you wish to view that mail from outside of your network. I recommend IMAP, especially if you have the storage space.


Any more questions, feel free to ask.


Edit: Also, remember that I am here to help you make the transition from GUI "crutch" administration to CLI. I know from experience relearning to use a computer is not easy.

Edited by Titan8990, 03 September 2008 - 11:28 AM.

  • 0

#3
Troy

Troy

    Tech Staff

  • Topic Starter
  • Technician
  • 8,841 posts
Hi Titan8990, thanks for your response.

Remote Access - Linux servers meant to be ran headless and remotely managed via SSH or Webmin. Webmin is the recommended administration method for people who really want GUIs

I understand that a linux server is supposed to be run headless and accessed remotely, but this computer does not support a headless boot. I have purchased a KVM switch to use with it and any other computer I'm working on at the time. This will all be in my workshop (in the garage), separate from my main computer office area. If ever I need to access it, I can just switch over the KVM switch. I can manage it manually direct to the server in this manner, correct?

OS - My recommendation is Debian Etch. Mostly because it's been around the server market a bit longer that Ubuntu. CentOS is also a very popular server OS. If you hardware works well with Ubuntu that is also a good choice. My Exim4 guide will work with both Ubuntu or Debian Etch.

If your recommendation is Debian Etch, and you are prepared to help me work through this thing, then I'm prepared to have a go at it! The only if I have is for the wireless to work (I have two different wireless card options) - wired is not an option to the garage.

After having a quick look at Debian Etch, I can't make sense of this thing... I'm downloading a server (without a GUI) and it's going to be 3 DVDs worth? :)

After having a second look, only the first disc (CD) is needed to make a bootable OS, and then I can work from there and get the rest that I need (if it isn't already there).

Is there a specific server version to install? I can't seem to find anything...

I'm downloading the first CD, so here goes nothing... :)

Troy

Edited by troy, 04 September 2008 - 04:26 AM.

  • 0

#4
Troy

Troy

    Tech Staff

  • Topic Starter
  • Technician
  • 8,841 posts
Hi again Titan,

Is this any good?

Cheers

Troy
  • 0

#5
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
That looks good, however, I have never used POSTFIX and will not be much help if you run into issues with it. I would skip the steps on Bind9 and proftpd. If you would like to also host a file server I strongly recommend WebDAV for security reasons (ftp has been around since mid 1970s and hasn't improved at all in the security area). If you only need to share files for yourself then I recommend SCP (secure copy over a SSH tunnel).

Personally, I don't like commands like this:

echo server1.example.com > /etc/hostname


I prefer to edit the config file myself to ensure that nothing goes wrong. For example, if you run the above command with something already in /etc/hostname your computer will either a) get two names b) both names will catenate together.

Also, I everywhere he uses VI I personally would use nano. Many old schoolers love VI but I think they are crazy. For simple tasks nano is much more practical due to it's ease of use. I don't really care that VI has commands to delete a line and etc.....


I can manage it manually direct to the server in this manner, correct?


Even if it is not headless you can still administer it remotely: sudo apt-get install ssh

Then you can get a remote terminal via ssh on another Linux box or PuTTy in Windows.


With the combination of my guide and the one you have found I don't think you will come across many issues.

I'm not really sure what the other discs do as I have only tried the single DVD. If I had to guess I would say they were packages you can install from a CD instead of using the apt-get system.

As far as wireless goes I would search for their compatibility with ndiswrapper. Drivers that manufactures write for Linux are crap. Just yesterday I bought a wireless PCI card for a friends Ubuntu system. I had the local computer store download the Linux drivers for the PCI card to my thumb drive. When I tried to compile the drivers It gave an error due to multiple undeclared variables. This is typical when you do not have the correct libraries needed. No where in their documentation did they mention the use of a non-standard library. I called up their 24/7 tech support and I was told that not only do they not support Linux but they didn't even write the drivers. I was told they were up there out of "curtsy". Anyways, I installed the Windows drivers using ndiswrapper and I was up and running in 5min.

Edit: My primary reason for recommending Debian over Ubuntu is updates. Ubuntu often rushes updates out the door and I have seen them many times cause stability issues or even break installations. Debian, being a more server oriented OS does not do this.

Edited by Titan8990, 04 September 2008 - 11:29 AM.

  • 0

#6
Troy

Troy

    Tech Staff

  • Topic Starter
  • Technician
  • 8,841 posts
Hi Titan,

Thanks for the help so far.

I am now installing the Ubuntu server edition, I couldn't make any sense out of Debian as I've never used it before.

I understand what you're saying about the updates, I'll have to make sure I set it up right and keep another hard disk with an up-to-date image in case of instability issues.

So you recommend nano instead of VI?

You can walk me through editing the config file?

You recommend EXIM for the mail server still? I will follow your guide, if so.

----------------------------------------

I am using Ubuntu because I know I can get the wireless working (I think it's picked it up already during installation, actually!). I have the proper driver files to work with ndiswrapper. This is the most important, and I couldn't get it to happen with Debian.

I don't need a file server, just something that will serve the html files and work email wonders for me. :)

Cheers for your help so far.

Troy
  • 0

#7
Troy

Troy

    Tech Staff

  • Topic Starter
  • Technician
  • 8,841 posts
Here is the tutorial I have started working through for Ubuntu Server:

http://www.howtoforg...-ubuntu8.04-lts

Currently I'm up to page 3, step 5. Any comments or tips from here will be appreciated.

Troy
  • 0

#8
Troy

Troy

    Tech Staff

  • Topic Starter
  • Technician
  • 8,841 posts
Hi again Titan,

I think you need to check this thread more often, I'm getting impatient. :)

I now know that my wireless is not working. I have the required .inf I used to set up the wireless card under Ubuntu (with GUI) ndiswrapper, the file is on my USB stick. How do I get it on there to install it? Does USB work with CLI? How do I get it to access the directory I want?

I can burn it to a CD if that would be better.

I want to install the driver using ndiswrapper - how do I even know if ndiswrapper is installed? If it isn't then how do I do that?

This is why I wanted a GUI. :)

Troy
  • 0

#9
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Sorry, for the delay troy. At your request, I will now begin my teachings of mounting and unmounting storage devices in Linux :).


First to see what devices are mounted we give the mount command:

jordan@einstein:~$ mount
/dev/sdb1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /media/backup type ext3 (rw)
securityfs on /sys/kernel/security type securityfs (rw)

Here I can see that I have two devices show as beginning with /dev. Here is an internal RAID1 (/dev/sdb1) and a external backup drive /dev/sd1. Even in CLI mode usb devices should automount so check mount first. Typical automount will go to the directory /media/NAMEOFDEVICE

Now, How do you know which device is which? You have two options here. One is to label the drive using udev rules (much harder than it should be). The other is the method I always use, by looking at the filesystem and the size of the storage device. We do this with the very handy fdisk utility and give it a -l flag:

jordan@einstein:~$ sudo fdisk -l
[sudo] password for jordan:

Disk /dev/sda: 500.1 GB, 500106780160 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x10c310fa

   Device Boot	  Start		 End	  Blocks   Id  System
/dev/sda1			   1	   60801   488384001   83  Linux

Disk /dev/sdb: 250.0 GB, 250057219584 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b3151

   Device Boot	  Start		 End	  Blocks   Id  System
/dev/sdb1   *		   1	   29920   240332368+  83  Linux
/dev/sdb2		   29921	   30401	 3863632+  82  Linux swap / Solaris


The majority of thumb drives are formatted in FAT32 so that is a red flag as to which device is your thumb drive.

What to do if your thumb drive did not automount? Lets assume that your thumb drive is sdb1.

sudo mkdir /media/sdb1
sudo mount /dev/sdb1 /media/sdb1

In the first line we made a directory to mount the drive to. On the second line we mounted it. You can now view it's contents by going to /media/sdb1.

If you need more information you can type in: man mount.

Also, don't forget to unmount your devices before removing them:

sudo umount /dev/sdb1

  • 0

#10
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Wow, I just typed a ton more than that.....

Well, lets go back over it again......


So you recommend nano instead of VI?

You can walk me through editing the config file?



For simple tasks I recommend nano. Easier to use and in many situations vi just is not practical. It is, however, more of a "standard". Most Linux distros include nano but many BSD and Solaris distros do not. To edit a config file:

sudo nano /etc/myconfigfile

Then you make your necessary changes as if it were a graphical text editor. When you are finished hit CTRL+X to exit and you will be prompted to save. Hit y to save and then enter to save it to the same location as you opened.

In vi you switch between command mode and insert mode via the insert key. Make your changes from insert mode then switch back to command mode and type the following to save and quit:

:wq


I am using Ubuntu because I know I can get the wireless working (I think it's picked it up already during installation, actually!). I have the proper driver files to work with ndiswrapper. This is the most important, and I couldn't get it to happen with Debian.


If your drivers will work with ndiswrapper in one distro it will work in all distros that support ndiswrapper. All the Linux distros use a similar kernel (really different version of the same kernel) and ndiswrapper is nothing more than a module loaded in to the kernel.

Currently I'm up to page 3, step 5. Any comments or tips from here will be appreciated


Do not do steps #4 and #9. Step #4 is opening a security flaw out of pure and total pointlessness. On Debian OSes there is almost nothing you can not do without unlocking the root account. This is because of the sudo command. If you went on the Ubuntu forums and asked "How do I unlock root?" they will close your thread because it is against their policy to tell people how to unlock root.

Also, no point to changing your default shell from BASH for ISPConfig when you won't be using ISPConfig.

I had typed more but it didn't go through and now I can't remember when else I talked about....

Hopefully, this will move you along some more. Good luck :).

edit: If you have already done step 4 then do the following command:

sudo passwd root -l

This will lock root's passwd again.

Quick tutorial on installing drivers via CLI ndiswrapper assuming that the driver is on the root of your thumb drive:

cd /media/sdb1
sudo ndiswrapper -i DRIVERS.inf
sudo ndiswrapper -l ---- this will show that it was installed correctly
sudo modprobe ndiswrapper
sudo iwconfig --- shows wireless networks

If your internet works properly then add this line to /etc/modules:

ndiswrapper

Do not add this line until after you have tested it and it works properly. I made the mistake of adding it without testing and it sent the kernel into a panic and toasted the machine.

Edited by Titan8990, 05 September 2008 - 11:23 AM.

  • 0

Advertisements


#11
silverbeard

silverbeard

    Trusted Tech

  • Member
  • PipPipPip
  • 791 posts
Why not install X if you can afford the over head? "sudo aptitude install x-window-system-core gnome-core"
You don't like Gnome (I don't) use the kde-core or another windows manager.
It's much more comfortable to use your favorite text editor. (Launch from terminal with the sudo command)

It make for a nice desktop with all the server capabilities and access to GUI tools where available.
  • 0

#12
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
And now we have conflicting opinions....


IMO if you are going to install Window manager it should be something lighter than Gnome such as XFCE or Flux. I personally like XFCE.
  • 0

#13
silverbeard

silverbeard

    Trusted Tech

  • Member
  • PipPipPip
  • 791 posts
Agreed. Gnome and kde are resource heavy. XFCE is a good choice. Enlightenment is another light manager I like. I run my Ubuntu Server with KDE but I use it mainly for testing and the core apps are lighter than the full install.

You still end up doing most of your config in terminal because as pointed out the GUI tools don't exist or fall short of what is needed.
  • 0

#14
Troy

Troy

    Tech Staff

  • Topic Starter
  • Technician
  • 8,841 posts
Hi Silverbeard, nice to meet you. :)

I like that link in your signature! Although I'm not so sure about the command line being fun, I'm still learning that one... :)

I tried to install X "sudo aptitude install x-window-system-core gnome-core" but it just gave me a whole bunch of errors... :) I would write them all down for you, but it's more than one page and I don't know how to make it scroll up and see what I'm missing... How do I do that?

The same thing happened with the fdisk command you gave me, Titan. There were more things listed than a page. It was talking about a whole bunch of partitions, from what I could gather. I've only got the one HDD in there, and the USB drive was inserted also. I guess that the Ubuntu Server disc made all the partitions on install, because I set it to automatic (I didn't manually partition it.)

Here's my thoughts so far: To wipe the lot and install Ubuntu server edition with a GUI (how do I do that?), and then when it's all finished and working, uninstall the GUI.

Can I do it that way, and will it work? As a bit of a newbie to all this, and definitely I've got no idea with just using the CLI for now, it sounds good to me.

I'll do as much as I can with the terminal, to practice the "CLI way".

Cheers for all the great information so far.

Troy
  • 0

#15
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts

Here's my thoughts so far: To wipe the lot and install Ubuntu server edition with a GUI (how do I do that?), and then when it's all finished and working, uninstall the GUI.

Can I do it that way, and will it work? As a bit of a newbie to all this, and definitely I've got no idea with just using the CLI for now, it sounds good to me.


Reinstalling doesn't fix problems like it does in Windoze. If you want a GUI then install one. Here is my recommended command:

sudo apt-get install xubuntu-desktop




Fdisk -l <------lower case L

shouldn't have that much to say about it, especially with only one drive.


If you ever get something longer than a page than you can pipe it trough less. Example:


sudo fdisk -l | less

ls -al | less

Another option is send standard output to a file. You do this with a greater than sign:

sudo fdisk -l > fdiskresults.txt

That will put the results of fdisk in fdiskresults.txt
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP