LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Starting a server build (http://www.linuxquestions.org/questions/linux-newbie-8/starting-a-server-build-4175422206/)

Aunnix 08-15-2012 09:51 AM

Starting a server build
 
Hi Everyone,

I will be starting to install Linux on my previous computer tomorrow evening, and was looking for any ideas, help, advice, etc. that anyone has to offer.

Firstly, the specs of the server machine:
MSI k9n SLI ready motherboard
8GB 800mhz OCZ RAM
Dell 300W (maybe 350W) power supply
AMD Athlon 64 X2 6000+ 3.1 Dual Core processor
2 X 750GB Western Digital Caviar Black SATA hard drives (plan to run in a raid setup to mirror)
Radeon ATI HD 4650 Video Card (mobo has no on board video)


So far, my intentions for this server are:
1 - website hosting (my few personal websites, and maybe a few "pro bono" sites for friends/family members

2 - website development / testing (php and mysql, etc.)

3 - file sharing on my home network (not looking to share online with strangers)

4 - music and video streaming (not necessarily streaming from various online sources... I want to be able to stream my own music and video files that I've downloaded to devices on my own home network

5 - of course, security... I need all of this to be secured so no one can have access to my data outside of my home network. I don't want my server to download random files, or allow anyone outside of the home network to access the server and download random (potentially threatening) files to my server (I don't know if this one is possible anyway).

6 - once I have the OS installed and running smoothly, I plan to begin accessing the server remotely from main, everyday use, computer.



I will be heading to Micro Center in a couple hours to pick up a few SATA cables and prepare to do the install and raid setup. The functions above are the basic / main functions I can think of and / or care about right now. I'm sure once I start diving into the world of servers I'll find more for it to do?

Please, any advice on the system, how to run it, issues I may run into, Linux distributions, or anything that comes to your mind, share it. I figured I'd throw up this post to see if it will help me with keeping the installation(s) as smooth and simple as possible. It could also help me find some other interesting server functions to run / install..

* I've had a pretty basic introduction to Linux, but haven't played around with it much at all.. So, I'm not too positive of what all I'm capable of doing with it and how to go about it.


Thanks much!!

sjreilly 08-15-2012 11:36 AM

Aunnix,

I would heartily recommend Debian Stable. Does all the things you are after, plus a lot more.

Steve

Aunnix 08-15-2012 11:58 AM

Quote:

Originally Posted by sjreilly (Post 4754772)
Aunnix,

I would heartily recommend Debian Stable. Does all the things you are after, plus a lot more.

Steve



Thanks. I've also been told to check out Ubuntu (12.04 or something?) as it is supposed to be very easy to install and setup, and I've been told about Cent OS or something. Any comments on these builds?

ks8 08-15-2012 01:32 PM

ks8
 
I have debian squeeze (stable) running on my older single core desktop with one GB of ram. I use it for my photo web server. Debian is easy to install. Just download the netinstall. When it comes to partitions, I recommend using one single partition, or 2 (/root with 15-20 GB and /home for the balance of the space in your HDD). You also need to have a small swap (e.g., 1 GB).

Ubuntu is based on debian, so most commands are alike.

GregJetter 08-15-2012 01:50 PM

Put a little time into developing your firewall , if your going to be exposing the server to the world your going to get whacked as soon as it connects to the world. figure out what ports you need and how to control access . learn what a "host.deny" file is and how to use it. Learn how to use the log files to ferret out problems. running a server is a lot of fun , I've had a linux server for my home running for the last 15 years. Have a back up plan and do your data backups. For each service you run there is going to be some type of configuration file , learn to read them and how to tighten them up , as they all come with default settings that need to be tailored to your own situation.

and don't forget a backup power supply UPS , and consider using detachable drives instead of mirroring , physically rotating the drives with spares pre configured and ready. RAID is great but a pain in the ass to restore from.

have fun

Greg

ks8 08-15-2012 02:16 PM

Yes, secure server is important once it is open to the internet. I followed this tutorial to install the apache server:
http://aboutdebian.com/internet.htm

There are other useful how-to in there.

Aunnix 08-15-2012 03:01 PM

Quote:

Originally Posted by ks8 (Post 4754850)
I have debian squeeze (stable) running on my older single core desktop with one GB of ram. I use it for my photo web server. Debian is easy to install. Just download the netinstall. When it comes to partitions, I recommend using one single partition, or 2 (/root with 15-20 GB and /home for the balance of the space in your HDD). You also need to have a small swap (e.g., 1 GB).

Ubuntu is based on debian, so most commands are alike.


Care to elaborate on the partitioning? I assume the /root would be what houses the OS/Linux distro? does the /home partition just the rest of the HDD space where I'll be storing my files? I'm confused about the "balancing of space" comment, lol.

ks8 08-15-2012 03:22 PM

Yes, /root is for the system files. 20GB is plenty. You can back up the image with GParted-Clonzilla easily and fast (clonzilla is a package inside GParted). /home is where the user data are. You can back it up with grsync which can do incremental backup(come as debian package).

I also use ext3 (partition type) for /root, and ext4 for /home. You can read about them in aboutdebian.com

Aunnix 08-15-2012 03:24 PM

Quote:

Originally Posted by GregJetter (Post 4754866)
Put a little time into developing your firewall , if your going to be exposing the server to the world your going to get whacked as soon as it connects to the world. figure out what ports you need and how to control access . learn what a "host.deny" file is and how to use it. Learn how to use the log files to ferret out problems. running a server is a lot of fun , I've had a linux server for my home running for the last 15 years. Have a back up plan and do your data backups. For each service you run there is going to be some type of configuration file , learn to read them and how to tighten them up , as they all come with default settings that need to be tailored to your own situation.

and don't forget a backup power supply UPS , and consider using detachable drives instead of mirroring , physically rotating the drives with spares pre configured and ready. RAID is great but a pain in the ass to restore from.

have fun

Greg


I assume I should develop the firewall before setting up the configurations / functions? So far, I'm under the impression that once I install the OS I'm basically ready to go online. Also, can you refer me to any good resources on reading up / figuring out the ports issue(s)? I assume for a backup power supply, there is some type of external PSU? I can't run a second in the ATX tower I'm using, lol, and I don't want to spend any more money on this, hahaha.

I will probably start out mirroring (so I can get everything running for as little cost as possible) and once I start moving data around significantly I'll have to look into the detachable drives. Is this the same thing as "hot swappable"?

Aunnix 08-15-2012 03:31 PM

Quote:

Originally Posted by ks8 (Post 4754933)
Yes, /root is for the system files. 20GB is plenty. You can back up the image with GParted-Clonzilla easily and fast (clonzilla is a package inside GParted). /home is where the user data are. You can back it up with grsync which can do incremental backup(come as debian package).

I also use ext3 (partition type) for /root, and ext4 for /home. You can read about them in aboutdebian.com

Cool. I plan to use as little partitions as possible. I figured it will make it easier for storing files and mirroring. Incremental backup?


Quote:

Originally Posted by ks8 (Post 4754933)
You also need to have a small swap (e.g., 1 GB).

What do you mean small swap? I need a third hard drive?

---------- Post added 08-15-12 at 04:32 PM ----------

Quote:

Originally Posted by ks8 (Post 4754880)
Yes, secure server is important once it is open to the internet. I followed this tutorial to install the apache server:
http://aboutdebian.com/internet.htm

There are other useful how-to in there.

Thanks! I do plan to use apache so this should come in handy.

ks8 08-15-2012 04:21 PM

Incremental backup = backing up only the new files, and files that has been changed since the last backup. This speeds up the backup process.

Swap - is a third partition that is required. It is like a page file in MS. Since you have so much memory, you will probably never use swap, so make it small, 1 GB is plenty.

chrism01 08-15-2012 06:54 PM

Definitely check out the Security forum.
I'd also recommend looking at Centos as the OS (free rebuild of RHEL).
Lots of manuals here www.linuxtopia.org; you probably want the SysAdmin list http://www.linuxtopia.org/online_boo...ion_index.html

You might find this tutorial useful as a good starter http://rute.2038bug.com/index.html.gz

Aunnix 08-15-2012 07:49 PM

Quote:

Originally Posted by ks8 (Post 4754978)
Incremental backup = backing up only the new files, and files that has been changed since the last backup. This speeds up the backup process.

Swap - is a third partition that is required. It is like a page file in MS. Since you have so much memory, you will probably never use swap, so make it small, 1 GB is plenty.

Ok, so I'll actually have 3 partitions? Above (in earlier post) you said you recommend only one or two partitions...

---------- Post added 08-15-12 at 08:50 PM ----------

Quote:

Originally Posted by chrism01 (Post 4755067)
Definitely check out the Security forum.
I'd also recommend looking at Centos as the OS (free rebuild of RHEL).
Lots of manuals here www.linuxtopia.org; you probably want the SysAdmin list http://www.linuxtopia.org/online_boo...ion_index.html

You might find this tutorial useful as a good starter http://rute.2038bug.com/index.html.gz


Thanks!

padeen 08-15-2012 08:35 PM

If it was me, I wouldn't bother about separate partitions under /, especially since you will be serving large multi-media files, so the size of, say, /var or /srv could be quite big.

I also would use a smaller swap partition than 1GB, that seems big to me. You will likely never use it, and 512MB would be plenty.

I run Debian Squeeze on two servers, FreeBSD on another, and RHEL on another. I've tried CentOS, and found Debian easier to administer for a server that is for my own use. FreeBSD is great as a server (and OpenBSD even more so) , but if you're a linux newbie you may find the BSDs a bit intimidating.

sjreilly 08-16-2012 04:20 AM

I run a number of servers (Debian, Ubuntu and CentOS), but I chose to run Debian at home because of the huge number of packages available, the fact that it a rolling-update install (ie no need to reinstall when the next version comes out) and it just keeps going with little (no) maintenance.

My preference would be to go for a 5 partitions;

10G /
5G /tmp
5G /var
RAM+2G swap
/home "the rest"

Given that you have 750G drives the amount taken up by the OS is small. You might even want to consider using an SSD drive for the OS then use the two 750G drives for /home mirror.

I would have a good long "play" with setting things up. Try different setups and just enjoy the experience.
I don't have a firewall running on my server as I have a NAT firewall on my DSL router, so only WWW and SSH ports are directed to that machine (and SSH is on a none-default port, away from prying eyes)

Saying that, I do use fail2ban to drop connections from people trying too hard to access my server.

Don't put all your data on the machine until you've had a GOOD LONG PLAY!

and BACKUP your data!!!!! (rdiff-backup is great for incremental backups, and clonezilla (mentioned previously) is great for taking a snapshot image of the OS).

padeen - I have never used a /srv partition. Today was the first day I've ever looked in that dir and there is nothing in it.


All times are GMT -5. The time now is 04:45 AM.