LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Newbie setting up Linux home network (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-setting-up-linux-home-network-4175493817/)

dakoris73 02-05-2014 11:07 AM

Newbie setting up Linux home network
 
Hello everyone,

Needless to say, I'm a newbie coming into the world of Linux, and so far, its been quite a learning process. However, I'm kinda stuck as to what to do next, and looking for ideas / suggestions on how to get past my "mental block" and learning more about Linux.

Over the last 3 months, I've been reading alot of different websites and manuals about linux, and since everyone says "just do it and you'll love it" without exactly explaining HOW TO DO IT, I'm submitting this post for some direction on where to go. I've also been using VMWare to test out 18 different versions of linux from ubuntu, SuSe, CentOS, ect.... and have narrowed down the "flavors" of choice to the following: Linux Mint 16 w/Mate for my desktop usage, and looking at setting up a home network with a file server, firewall, DNS server and web server, but haven't fully decided whether to use Ubunutu Server 12.04 LTS or CentOS 6.5 exclusively. My thinking is that I would like to try out both server setups and eventually see which one I like better.

My equipment is this: I have an older Desktop PC that will run the Linux Mint, and I also have an older Dell Poweredge 600SC server that I will be using for my server setup. I also have a laptop that has been running my VMware machines, but not looking for this to be on this network at this time.

My question is this: Can I setup this one server to be used as a File server, firewall, possibly DNS Server AND a web server? if so, what skills / info will be needed to set this configuration up, and how much networking info will I need to know? Currently my network sits behind a router to my ISP's modem, but when I setup my webserver, will I need a dedicated IP address that is outside my router / ISP?

I realize this is a large post, but I'm kinda stuck and not exactly sure where or what to do next. Any and All comments or suggestions would be appreciated, or if you know of a manual that you would recommend, that would be awesome too......

Thank you.
Mikey

TroN-0074 02-05-2014 01:47 PM

Keep in mind that older computers were not that much smart when it comes to saving energy so watch out for the monthly electrical bill

Here is the link on setting up Ubuntu as server

https://help.ubuntu.com/10.04/serverguide/index.html


I dont know if your ISP would set you up with an static IP at no charge but they usually cost a little bit more.

Here is another link with some information about servers

https://wiki.archlinux.org/index.php...e_Server_Guide

taylorkh 02-05-2014 02:20 PM

Hello Mikey,

An old Dell Poweredge 600SC!!! I am running an ancient 400SC (with 10 TB of disks crammed into it :) I am sure you will have enough horse power to run all the desired services on the box. One BIG question. Are you planning to expose your web services to the outside world or just use the web server for playing/testing/development within your home network?

If you are planning to run a public web server... 1) I would not recommend it as a beginner project 2) Your ISP will probably not be happy and may pull the plug on you 3) To make your ISP happy you will probably need to pay them more money (static IP etc.) 4) I would still not recommend it as a beginner project.

VMWare is a great way to experiment with and learn your way around Linux. I use it a lot. You can build a "server" within VMWare and play around with it before building one on your physical server. Ubuntu Server is certainly reasonable for home use - or even commercial use. Download the 12.04 LTS server .iso file if you do not already have it. You can build a VM directly from it. As I recall the installation process - all text based - will allow you to choose what server services you want. For example a LAMP (Linux Apache MySQL PHP) server. You can also have it install ssh, dns etc. at the same time. It only takes a few minutes to build a virtual server so that might be a good way to start. Be aware that the server is command line - no gui (unless you add one).

I am running Ubuntu server 12.04 on my "big disk drive in the sky" Poweredge. I installed the gnome-session-fallback gui but NO "greeter". I then installed vncserver. The machine boots to the command line - as a good server should - no need to waste resources on a gui. In fact I do not have a monitor nor keyboard connected to it. I then access it over the network with ssh from a terminal. If I wish to access it with a gui I invoke my vnc session and connect to that with a remote desktop viewer (from my CentOS desktop). The gui makes it convenient so shovel large amounts of date between drives with gnome-commander and Beyond Compare (my favorite utilities).

Another random recommendation... obtain, learn to use and USE FREQUENTLY clonezilla or another backup tool. Keep the operating system (root) partition small and back it up before making large (or small and potentially dangerous) changes to the server install.

As far as dns, firewall etc. I would get the Poweredge setup and running behind your router. Provided you have two network cards in the server and another router or a switch you can setup another network behind your server (as a dns, firewall) and connect your laptop as a test client. This way you can connect your laptop to the original router when you need to get to the Internet while you are getting the server configured.

Sounds like you are going to have a lot of fun and learn a lot provided you stick with your project. The LinuxQuestions community is always here to help you over the hard spots.

Ken

pointer2null 02-06-2014 07:30 AM

As a newbie I did the same about a year ago.

Apache is easy to install and setup for a web server - I've since expanded it so that it uses virtual hosts and servers two websites. To get round the static ip issue, I use dyn-dns (or similar) and I've registered a domain (I used zone edit). My site is private (password protected & https), it's just got me so I don't get enough traffic to worry the ISP. I se port frowarding from my router to direct traffic to my server. (I've got Serviio media server, Http, Subversion and Pydio file browser setup).

For the file server side of things, samba is your friend, easy to install and configure.

If you want to use the server as a firewall you'll need to route the incoming internet connection via your box, i.e. two ethernet ports and bridge them. Most linux distro's come with iptables, which is the default and powerful firewall. It's also releativly straightforward to understand and configure.

Main lessons I learned were a) choose an OS that is stable and not one of the rapid turnaround ones (i.e. use centos not fedora) and b) lvm is a pain the arse, so best setup the partitions manually.

chrism01 02-06-2014 11:44 PM

Some useful HOWTOs for server setups:

http://www.linuxhomenetworking.com/ - literally HOWTOs of the sort you're asking about
www.linuxtopia.org - lots of manuals for reference and how to do stuff in a more formal manner

dakoris73 02-07-2014 03:41 PM

Hello everyone,
Thank you for the responses to my conundrum. I appreciate all the info listed so far.

Taylor - if your ancient 400 can do all that, then my old 600 shouldn't have much of an issue with my "small and simple" setup.... I wish I had that much hard drive space available, but not yet... Also, my initial thinking was to setup a public web server to play with, but after some consideration and speaking with my ISP, I'm thinking that I don't want to pay THAT much extra a month for the dedicated line. I am also very interested in how to setup my server so that I can access it remotely without having a monitor, keyboard, or mouse attached to manage it. That would be a very good thing to learn.....

As for using VMWare to set these up and practice with them, the problem I was having with this is on the networking side. I haven't quite figured out how to get this setup so that my linux side can talk to my windows side, or to another VM running as well. If I could get that part figured out, then I would go this route temporarily to practice setting this up before actually setting this up on my server...... but for just installed and trying out the many different distro's out there, I've enjoyed using the VMWare for this......

I will definitely be reading up on these other links submitted, and always looking for any and all comments on this new adventure.

chrism01 02-07-2014 11:08 PM

A public webserver would open you up to exploitation unless you do some serious reading etc.
Start with a private one, then check the Security forum if you're thinking of going public.

taylorkh 02-08-2014 08:07 AM

Here is how I setup my server (in brief)
Quote:

install Ubuntu Server 12.04
sudo apt-get update
sudo apt-get upgrade

sudo apt-get install gnome-shell vncserver synaptic

Now setup vnc session

vncserver (this creates the vnc session config file which you will edit next)
vncserver -kill :1 (your vnc session is the first thue :1 close it so you can edit the config file)

vim .vnc/xstartup (or use your favorite text editor - may have to install vim - here is what my file looks like)

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
gnome-session --session=gnome-classic &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
# x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &


(last two lines load a terminal on top of the desktop if they are executed - they were placed in the file by default - comment out or delete them)

connect with ssh and start vnc session as needed with the following command

vncserver -geometry 1400x850 -depth 24
Once the vnc session is running you can connect to it with the remote desktop viewer provided in most gui Linux distros.

Ken

p.s. I do not have a local gui session on the server. If I had one I could tweak the config file to use that session rather than an independend one. I used to remember how to do that. Ask and I will scratch my head a little.

schneidz 02-08-2014 10:50 AM

for file server i use sshfs.

for a web server i think on mint you can enable apache by running
Code:

sudo /etc/init.d/apache2 start
then setting up you html pages.

taylorkh 02-08-2014 04:14 PM

To continue with my reply...

The vnc configuration I am using allows the physical console - connected to the server - to only run the command line. I can therefore remove the monitor etc. once the OS is installed. If I install the server to boot to a gui - by also installing a greeter (sudo apt-get install lightdm-greeter) or if I install the whole ubuntu-desktop package the server will in fact come up in a gui and allow me to login. I have found some issues with this if I wanted to run "headless" (no monitor).

In Ubuntu 8.04 I had to have the server auto login and then share the desktop. In my environment not a security concern but in the real world...

Ubuntu 10.04 would not boot to a gui if I did not have a monitor installed (and I think it had to be powered on!)

My 12.04 install which I have described goes back to the way a REAL computer should work. The computer chugs away doing its thing without benefit of a local console. A user may access it from the command line with ssh from a terminal on another machine (putty on a Windows machine) or they may invoke a vnc gui session on the server and access it with a remote viewer (vinagre on Linux or VNC Viewer on Windows). There are ways to tunnel to the gui session over a secure connection such as TightVNC. There are also various other VNC like programs available. Of course you can have multiple VNC sessions with different users at the same time.

Another option to administer your server is to install a program called Webmin. It runs a mini-web server/service on the server and allows you to connect from a web browser. If you use this you may need to be careful with the version you install. I ran it on 10.04 but one upgrade caused it to fail. I uninstalled and installer the prior version and just let that one run until I upgraded 10.04. I have not tried it recently.

As to VMWare and networking... I always configure the virtual machine network interfaces to be "bridged" mode. This allows the VM to get its IP address dynamically from my router with DHCP. As I do not have a DNS server running on my network - and I do not have a lot of machines - I reserve IP addresses in the router for my physical machines. I then can enter those addresses in the /etc/hosts files on the Linux VMs or in the hosts file which I hidden somewhere on the C drive of the Windows VMs (I used to know where - I just access the machines as \\IP address when I am in Windows). You can determine the assigned IP address in a Linux machine with the ifconfig command. As you build DNS and DHCP on your server you can allow it to translate names to addresses.

That said... a couple of useful tips. Get a copy of putty and WinSCP and install them on your Windows machines and VMs. These will allow you to connect to and graphically move files between your Linux and Windows machines.

Tip 2 - I try to follow this - keep a log as you build your server. What did you install, how, where did you get the package from (apt-get or yum from the distro repositories, a third party repository, a downloaded package?) what configuration changes did you make. Believe me this will come in handy when you need to rebuild or build another install.

Tip 3 - Partition off a chunk of your hard drive (or a second hard drive) for backup. As you do your install stop every so often and do a snapshot with Clonezilla or some similar tool. I also make a Clonezilla snapshot of the operating system and /home partitions on my CentOS desktop at the end of each month. This has saved my butt on more than one occasion when a routine update has hosed the works. Such as the update to Centos 6.4 which rendered the driver for my video card rubbish. Turned out that the video card was no longer supported. I restored the most recent snapshot while I obtained a different card. Or when an update caused VMWare tools to lock up the entire computer when I launched a Windows VM!

Best of luck and keep the forum updated on you progress.

Ken

salasi 02-08-2014 04:30 PM

This is a multi-part answer, but
Chrism01 has already quoted 'linuxhomenetworking'; given its focus and what you want, you have to read this! (Side note: it is also available as dead-tree-ware (a book) and the book itself has been available as a .pdf in the past from various sources (distrowatch and at least one other site, IIRC) - worth a search, to see what you can find!

Quote:

Originally Posted by dakoris73 (Post 5112135)

My question is this: Can I setup this one server to be used as a File server, firewall, possibly DNS Server AND a web server?

To the part of that question that is 'will my computer have enough throughput for...', the answer is very probably. You haven't really given us anything to base a workload estimation on (is this a single user/low number of users, what about the usage level of the webserver; for the DNS server, you are only going to provide resolutions to your internal net, for the webserver, what you have written doesn't exclude the possibility that you want a simple serving of static webpages, but you could easily want a system that serves up dynamic webpages from a CMS (and thereby involves a database), and that's the kind of thing that can scale up quite rapidly), so all you can reasonably say is that at a fairly minimalistic interpretation of your requirements there should be no problem, but that there other, more expansive, interpretations that would make this less likely.

Quote:

Originally Posted by dakoris73 (Post 5112135)
if so, what skills / info will be needed to set this configuration up, and how much networking info will I need to know?

Skills:
General Unix Admin Skills
Fault finding
Testing

You'll need a little bit of networking, but nothing particularly hard (at least, at first) and nothing you won't find in linuxhometworking, the iptables tutorial, or the first part of DNS and Bind (borrow a copy, probably; its Cricket Liu and Albitz, and published by O'Reilly).

You didn't say what you wanted to do with DNS, but, if you want an easy life, BIND is probably not recommended; look at whether the easier-to-configure and learn Dnsmasq does what you want, but there are other options. (Providing name look ups to the rest of the internet is probably not a good idea; unclear if you meant that, or not.)

And as far as a webserver is concerned, consider whether you want a CMS. You can get the software stack for one of the popular CMSs that can get you up and running in a few minutes (after you have spent a month evaluating the options, of course). The disadvantages are that these things tend to be a heavyweight general solution to the problem of getting your webpage displayed, and your contact with the app are a bit indirect, so your learning might be limited, but it is a quick way to get from the start point to the finish line. (If getting the webpage is really the finish line; maybe it isn't and the learning is.)

Security: don't know where to start, but this is a subject that never really ends. The 'security references' on this very site is pretty solid, but it might be a bit over-facing if you try to look at too much of it at once.

Quote:

Originally Posted by dakoris73 (Post 5112135)
Currently my network sits behind a router to my ISP's modem, but when I setup my webserver, will I need a dedicated IP address that is outside my router / ISP?

What is the website for? If the aim is to serve webpages to users on your internal network, then you don't really have to change anything significant. If you want the whole internet to come knocking on your door, then it really might not be a good solution, for a variety of reasons.

schneidz 02-08-2014 07:38 PM

I use dyndns.com to track changes to my IP address.

dakoris73 10-15-2014 11:35 PM

update and progress
 
Hello everyone,

I realize its been a while since I commented on this post, but thought that I would post my progression into this linux world.

Since my last post several months ago, despite some work and family issues, I finally got around to getting back to my home network. I've since installed Ubuntu 12.04 and currently have this running as a file server using Samba on my Poweredge 600, which has worked pretty good so far. I've also added a second server using Ubuntu 14.04 LTS server on it, and also using it as a file server for the time being. I haven't gone much past this point so far, despite my wanting to get further into this.......

My next project / process, is to consider how best to setup an FTP server that can be accessed remotely using an FTP client such as CoreFTP so that members of my RC club can upload pics and videos to be used in a monthly newsletter and possible website integration. I have been reading up on how to setup an FTP server using Ubuntu 14.04, but now trying to figure out how to make it accessable to the outside world.......

Also, I've been trying to read up on how to setup a backup server / repository so that I can backup all my files just in case....... I know that there are alot of options available to do this, but with a limited budget, options tend to decrease quite significantly. I don't move or manipulate too many files at a time presently, but I know my wife is constantly editing and uploading new pics to the image share setup, therefore, requiring the need to figure out some sort of backup option there..... but thats another story for another thread / discussion.......

Anyways, enough of my ramblings.... just thought I would let everyone know I haven't forgotten about this thread, or my plans... just got a little sidetracked with life........

As always, any suggestions / options or anything that can help make my learning easier and more efficient are always welcome.......

Mikey

schneidz 10-16-2014 08:36 AM

i would consider sftp rather than ftp.

dakoris73 10-06-2015 06:50 AM

Mikey's 1 year update
 
Hey Guys,

I realize that its been almost a year since my last post on this forum, but thought I would let you know of my progress at this time.......

For my laptop, I'm currently using the Centos 7 Deskttop OS on this, and my main home desktop is a dual boot of Windows 7 and Centos 7, but primarily using the Centos7 for all my computing needs. I've also upgraded both my servers to Ubuntu 14.04 LTS versions and both are running headless at this time. I have also managed to get Samba setup for my personal files and picture storage for my wife to access. I've also managed to get a working FTP server running using proftpd package and haven't had any problems with this at all. I've also setup a working PLEX media server with multiple clients having access to my service and no problems at all with this either, other than running low on disk space for all the movies I wanted to put on there. (LOL)

As for a backup solution, I'm still working on this and haven't fully got it all worked out, but slowly working to get it right..... I'm also slowly working on trying to get a working web server up and running with Wordpress on it as a test bed to learn this particular platform with the Apache Web server, but still need to read a bit more on where to put the wordpress files and such.......

Because of my practice on these servers and such, I'm looking forward to moving to my new position of becoming an Application Support programmer supporting applications built and run on linux servers at work.

I've appreciated all the help I've recieved on this site, and looking forward to adding more questions and learning a whole lot more about this great operating system in my new job.......


All times are GMT -5. The time now is 06:51 PM.