LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Building a small home/web server. Looking for Linux and Apache advice... (https://www.linuxquestions.org/questions/linux-newbie-8/building-a-small-home-web-server-looking-for-linux-and-apache-advice-4175421027/)

Aunnix 08-08-2012 10:15 AM

Building a small home/web server. Looking for Linux and Apache advice...
 
Hi All,

I recently just built a new computer system, and thought maybe I'd look into building a small home and web server out of the old computer. The computer specs for the server build are:

MSI K9N SLI motherboard
AMD Dual Core 3.1 X2 64 6000+ cpu
4GB RAM (have 8GB but haven't tested 4GB of it)
Radeon ATI HD 4650 video card (mobo has no onboard video)
Cooler Master 430 Elite case
and will most likely run 2 500GB HDDs to mirror one another
Dell 300W (maybe 350W) power supply

First of all, does anyone see any problems with this setup? I'm pretty sure it is capable of RAID so that I can mirror the hard drives.


Secondly, what I'd like to use the server for is:
1. website design development/testing (PHP & mySQL)
2. hosting websites for my personal and friends' personal websites (not looking to make money off hosting, just help out the needy every now and then)
3. accessing music and video files to play or stream on devices connected to my home network (such as a PS3 or a wireless laptop).

Is it possible for Apache to support all of these activities, and if so, all at once? For instance, can I stream a movie to my office computer while I'm also working on websites and messing with the server on the same computer (I run dual monitors)?

I've been told to just spend the money on a Windows Server program, but when I did a live chat with Microsoft's (dumb ass, uninformed) CSR they couldn't tell me if their software will run web servers. I know it would be fine and a bit more user friendly for a media and storage server, but I'm more interested in the web server.

How often would I need to update my Apache server and Linux OS? Is it difficult to do? You can say I've had an introduction to Linux and the command line stuff, but I'm not too savvy on the subjects, lol. Hopefully, the updates can be completed remotely? For example, I'd like to connect remotely to the server in my basement from my home office upstairs...

TroN-0074 08-08-2012 10:38 AM

The disvantage of running a web site out of your home network will be that the traffic generated by these sites will take some of your bandwidth and any connection you would do will be slower.
You still have to register those domains with a company that does that for business and that cost money even if you dont want to charge to your friends for hosting that company still will charge you for registration.

Linux for sure have all the tool you need for this project, and it will be good to do it for the learning purpose.

Setting up a file server will be fun too you and your friends can access these files from remote locations direct to your computer and there is not registration cost for that.

Good luck to you.

Aunnix 08-08-2012 11:21 AM

Quote:

Originally Posted by TroN-0074 (Post 4749052)
The disvantage of running a web site out of your home network will be that the traffic generated by these sites will take some of your bandwidth and any connection you would do will be slower.
You still have to register those domains with a company that does that for business and that cost money even if you dont want to charge to your friends for hosting that company still will charge you for registration.

Linux for sure have all the tool you need for this project, and it will be good to do it for the learning purpose.

Setting up a file server will be fun too you and your friends can access these files from remote locations direct to your computer and there is not registration cost for that.

Good luck to you.


Thanks for the info!

As for the hosting issues, I will ALWAYS have a real client actually purchase hosting from a host. I will never host their websites because (like you said) I'll run into bandwidth issues. As for clients that are friends, I will ALWAYS push them to buy hosting elsewhere, lol, as I don't want to give away all of my bandwidth..

Hosting off my home server will be for VERY select few people. For example, I created a website for my brother, but he can't really pay for hosting through Godaddy. So, I planned to host his website so that I can get rid of all of the Godaddy ads on his page.

I mostly want my own web server to archive the websites I build (for me or anyone else). I figured this way I can have the websites I've created live online somewhere so that I can use them for examples when sending out resumes/trying to find work... This way I'm not linking to websites that are changed, dead, or updated by someone other than me.

And, yeah, I already knew domains would be purchased through a registrar and I will be pointing them to my IP... but, at least domains are only $12 instead of $80-$150 like a year of hosting. It will save me cash.

chrism01 08-08-2012 06:41 PM

Quote:

How often would I need to update my Apache server and Linux OS? Is it difficult to do?
FOSS SW creators generally provide updates as and when they are ready, not to a schedule.
If for example you went with Centos (a free rebuild of RHEL), then the update daemon checks (by default) every 4 hrs, although this can be set to any value.
It can also be set to download updates only, but not automatically apply them.
I recommend considering that approach as you would want to know what has been updated & when.
The downside is you'd have to check eg daily to see if there are any updates waiting.

spazticclown 08-09-2012 08:02 AM

I have a very similar setup, I run a Linux Home Server with all of my archived music and videos as well as web development using apache, php5 and mysql.

Running Linux I would recommend using a Linux Software RAID as opposed to the onboard nVidia RAID. Mdadm is the program used to build and manage RAID.

If you have not chosen a distro I would recommend Cent OS or Ubuntu 12.04 LTS. Both of these will last you a good while before you need to update.

Your hardware is quite similar to what I started out with and should run just fine.

While you can do everything you need running Windows XP (no need for a server OS). Setting up a home server is a great way to get started in the Linux world. Oh and uptime is amazing with a Linux platform, no rebooting every update Tuesday when you are trying to get work done.

Have fun!

Aunnix 08-09-2012 08:06 AM

Quote:

Originally Posted by chrism01 (Post 4749401)
FOSS SW creators generally provide updates and when they are ready, not to a schedule.
If for example you went with Centos (a free rebuild of RHEL), then the update daemon checks (by default) every 4 hrs, although this can be set to any value.
It can also be set to download updates only, but not automatically apply them.
I recommend considering that approach as you would want to know what has been updated & when.
The downside is you'd have to check eg daily to see if there are any updates waiting.

Yeah, I'd like to know when and what is being updated. I'd probably set the daemon for to check only once (possibly twice) a day. No one will be using this computer so if I am a day or two behind on an update, I wouldn't think it'd be a big deal...? I'm sure I'd be logged into it almost daily, so checking for any waiting updates shouldn't be a big deal. They should only be waiting a day at most to be applied.

Are updates released often enough to where I'd need to check for them every few hours? Or, are they something that I could catch every night or so? The idea is to check the server before bed every night, lol, and if something needs updated I can let it run over night while asleep...

spazticclown 08-09-2012 08:13 AM

You will be totally fine checking updates every day or two. The system will check for updates (if using the graphical desktop) and alert you when updates are found. If you go with Cent OS you can also run a manual update from the command line using 'yum' to list what is available and choose to update or not. This can be done from a Windows computer using Putty and SSH or a Linux computer via shell.

Aunnix 08-09-2012 08:25 AM

Quote:

Originally Posted by spazticclown (Post 4749855)
I have a very similar setup, I run a Linux Home Server with all of my archived music and videos as well as web development using apache, php5 and mysql.

Running Linux I would recommend using a Linux Software RAID as opposed to the onboard nVidia RAID. Mdadm is the program used to build and manage RAID.

If you have not chosen a distro I would recommend Cent OS or Ubuntu 12.04 LTS. Both of these will last you a good while before you need to update.

Your hardware is quite similar to what I started out with and should run just fine.

While you can do everything you need running Windows XP (no need for a server OS). Setting up a home server is a great way to get started in the Linux world. Oh and uptime is amazing with a Linux platform, no rebooting every update Tuesday when you are trying to get work done.

Have fun!


That's good to know my hardware will be good. I have tested my other 4GB of RAM and it works, so I'll be running all 8GB of RAM (from my initial post). Will I run into problems/issues using the onboard RAID setup? What is the benefit of using Mdadm (besides that it is Linux based)?

I have not chosen a Linux build yet. I've been leaning towards Ubuntu, as I have a friend or two who are familiar with Linux and suggested it. Would you suggest one more than the other?

I know I can run an Apache server on XP, but I've always been told when I sign up for hosting always go Linux based. So, I figured I'd give it a shot. Also, if I can salvage my XP for a future build (or possibly even sell, lol) I'd like to. No sense in installing it on a computer that will hardly be used (by anyone other than me).

spazticclown 08-09-2012 08:52 AM

The onboard nVidia RAID is sufficient for Windows use because it is managed through Windows software (ie rebuilding the array). There is very little support for these processes inside of Linux, nVidia just doesn't make software to do this. Furthermore the Linux Software RAID through mdadm may actually out perform the nVidia RAID, as well as giving you access to rebuild the array, check SMART status of the hard drives to determine if failure is imminant and if necessary rebuild the array onto a new disk if one fails.

Ubuntu is a good place to start, it is very desktop oriented however using the Alternatives disk you can easilly setup the RAID (check your favorite search engine for "ubuntu 12.04 mdadm raid" for lots of tutorials). In my personal experience I found Ubuntu to be hard on the eyes by default, getting rid of the orange purple and black color scheme fixed that. Ubuntu has a large community and a lot of good documentation for how to set up everything.

Linux will have less overhead than Windows and far fewer security holes. Being a home based server with limited access online I doubt security is your number one priority however don't forget about it. Also you may want to see if your ISP prohibits hosting from home. Some just state you cannot do that in the contract and some will actually scan for open ports and then block access. This happened to me once and was very annoying.

Aunnix 08-09-2012 09:18 AM

Quote:

Originally Posted by spazticclown (Post 4749908)
The onboard nVidia RAID is sufficient for Windows use because it is managed through Windows software (ie rebuilding the array). There is very little support for these processes inside of Linux, nVidia just doesn't make software to do this. Furthermore the Linux Software RAID through mdadm may actually out perform the nVidia RAID, as well as giving you access to rebuild the array, check SMART status of the hard drives to determine if failure is imminant and if necessary rebuild the array onto a new disk if one fails.

Ubuntu is a good place to start, it is very desktop oriented however using the Alternatives disk you can easilly setup the RAID (check your favorite search engine for "ubuntu 12.04 mdadm raid" for lots of tutorials). In my personal experience I found Ubuntu to be hard on the eyes by default, getting rid of the orange purple and black color scheme fixed that. Ubuntu has a large community and a lot of good documentation for how to set up everything.

Linux will have less overhead than Windows and far fewer security holes. Being a home based server with limited access online I doubt security is your number one priority however don't forget about it. Also you may want to see if your ISP prohibits hosting from home. Some just state you cannot do that in the contract and some will actually scan for open ports and then block access. This happened to me once and was very annoying.


Thanks for the info!

Ubuntu is probably where I will start. I've been trying to decide if I should find a Linux build with a desktop UI. I wasn't really going to consider it since I don't plan to surf the web or anything with this machine, but since I'm new it may be helpful. I plan to remote into the server from my Windows 7 computer to do all of my maintenance and updating.

As for security, I don't plan to share my files with the web... just the home network. I'm hoping the software I install for all of this will take care of most of my security concerns. Also, I was hoping encrypting my router will block most (if not all) outsiders trying to access the network. I'm hoping that all I'll basically need to secure is file sharing by setting up some sort of firewall to only allow access from computers on the home network.

I will call my ISP today and find out what they say. I didn't think/wasn't told about this issue before now. I don't want to update/upgrade all of this for a server and find out my problems are with the ISP rather than my hardware/software, lol.

Aunnix 08-10-2012 10:10 AM

Also, how would I handle my system boot? Do I need to have a seperate (3rd) hard drive that holds the OS? Or, can I still load the OS onto one of the two 500GB hard drives and run the server?

I ask because I am not real sure how the mirroring works. I understand it basically just copies my primary HDD data to the secondary HDD, but does it copy the OS and it's files over to the secondary HDD? If so, is this how I'd want it? I would think so because if the the primary HDD fails at some point, everything should be ready to go on the secondary HDD. Is this correct?

If I can load the OS on the primary HDD, would it be better for me to partition the HDD out? Maybe set aside X amount of GB for the OS and any programs used, and leave the other partition to store files and websites and have that partition copied/mirrored to the secondary HDD?

theNbomr 08-10-2012 01:27 PM

The raid system exposes itself as a single disk device. When you install the OS, it will treat the raid system like a single drive, and will create partitions to separate various parts of the OS and your personal data. You should be given the opportunity to either directly specify how the partitioning is performed, or to allow the installation software to choose automatically. There are all kinds of strategies and everyone seems to develop their own preferences. Personally, I prefer to keep at least one partition that contains all and only 'my data'. 'My data' means, to me, anything that wouldn't be recoverable by installing Linux on some flavor. Quite often, there will be a partition where the /home directory tree is mounted.

Quote:

Originally Posted by Aunnix
Secondly, what I'd like to use the server for is:
1. website design development/testing (PHP & mySQL)
2. hosting websites for my personal and friends' personal websites (not looking to make money off hosting, just help out the needy every now and then)
3. accessing music and video files to play or stream on devices connected to my home network (such as a PS3 or a wireless laptop).

These are all distinct functions, and are all done with separate and distinct tools.
Quote:

As for security, I don't plan to share my files with the web... just the home network. I'm hoping the software I install for all of this will take care of most of my security concerns. Also, I was hoping encrypting my router will block most (if not all) outsiders trying to access the network. I'm hoping that all I'll basically need to secure is file sharing by setting up some sort of firewall to only allow access from computers on the home network.
Again, firewalling and routing functions are distinct and separate functions within the server host. Mostly, these functions are scripted with iptables rules. Acquiring music content and providing streaming music are separate and distinct from each other and from the other elements you've listed. File sharing can take several different forms, and there are servers and applications for each of them.

Start thinking about your server as a collection of components, all hosted on one platform. Resist the temptation to see it as one single system. The Linux philosophy of small tools that are very good at specific things is very germane here. Your web server is a single application. Your web design toolkit is probably a collection of other programs. Your network security is handled completely separately from the rest of the network applications. You can then focus on one thing at a time, and get each piece working individually.

Your server host is more than well enough equipped to be a home-based server. Once it is set up and running, you will rarely ever require use of any desktop/GUI to maintain it. Any existing Linux desktop will serve quite nicely as a remote access point to maintain your server. When I set up a home server, I usually set it up to boot a desktop, and use that until I've got most things configured to my liking, and then I take away the console (monitor, keyboard, mouse) and boot the server headlessly in level 2. After that, I just use ssh logins to do server maintenance and updates.

--- rod.

NyteOwl 08-10-2012 01:53 PM

I have mine running Slackware (though the server hardware is inferior to yours) with no problems. You might want to eb careful of your ISP's TOS when doing hosting from home, unless you have a business account. People have on occasion been cut off for doing so.

Aunnix 08-10-2012 02:08 PM

Quote:

Originally Posted by theNbomr (Post 4751084)
The raid system exposes itself as a single disk device. When you install the OS, it will treat the raid system like a single drive, and will create partitions to separate various parts of the OS and your personal data. You should be given the opportunity to either directly specify how the partitioning is performed, or to allow the installation software to choose automatically. There are all kinds of strategies and everyone seems to develop their own preferences. Personally, I prefer to keep at least one partition that contains all and only 'my data'. 'My data' means, to me, anything that wouldn't be recoverable by installing Linux on some flavor. Quite often, there will be a partition where the /home directory tree is mounted.


These are all distinct functions, and are all done with separate and distinct tools.

Again, firewalling and routing functions are distinct and separate functions within the server host. Mostly, these functions are scripted with iptables rules. Acquiring music content and providing streaming music are separate and distinct from each other and from the other elements you've listed. File sharing can take several different forms, and there are servers and applications for each of them.

Start thinking about your server as a collection of components, all hosted on one platform. Resist the temptation to see it as one single system. The Linux philosophy of small tools that are very good at specific things is very germane here. Your web server is a single application. Your web design toolkit is probably a collection of other programs. Your network security is handled completely separately from the rest of the network applications. You can then focus on one thing at a time, and get each piece working individually.

Your server host is more than well enough equipped to be a home-based server. Once it is set up and running, you will rarely ever require use of any desktop/GUI to maintain it. Any existing Linux desktop will serve quite nicely as a remote access point to maintain your server. When I set up a home server, I usually set it up to boot a desktop, and use that until I've got most things configured to my liking, and then I take away the console (monitor, keyboard, mouse) and boot the server headlessly in level 2. After that, I just use ssh logins to do server maintenance and updates.

--- rod.


Yeah, I'd like to basically only have the two partitions... one to store the OS and programs that control the functioning of my different "components" (web server, file server, etc...), and the second being the partition that will actually store the files, websites, and media. What I would like to do, is store everything on the server pull the files I need on my windows 7 computer work on them then upload them right back to the server and then I can upload them to the web (if they are websites or something). Speaking of which, can I install my programs (like MS Office, Starcraft, Photoshop...) on the server and access them from any computer on the network?

After chatting with you guys and looking around the web, I concluded that everything was separate of one another. Which is nice, because as you said I can focus on one function at a time. It will help learn Linux a bit better. What do you mean by acquiring music? Are you referring to just simply downloading a music file from the internet?

I knew I'd need a monitor and such to get Linux installed and I figured I'd just do the desktop application so that it's there in case I don't know or trust myself in command line, lol. I assumed it would be handy as well for configuring everything initially. Once everything is running, I do plan to "retire" the mouse, keyboard, and monitor. I don't want guests of the house thinking it's computer they can just jump on and go, lol. I plan for it to basically be a powered tower 24/7 with no one touching it. At this point, I won't even bother with it because I'll remote in for everything. What do you mean by "level 2?"

Aunnix 08-10-2012 02:23 PM

Quote:

Originally Posted by NyteOwl (Post 4751106)
I have mine running Slackware (though the server hardware is inferior to yours) with no problems. You might want to eb careful of your ISP's TOS when doing hosting from home, unless you have a business account. People have on occasion been cut off for doing so.


Yeah, someone else above mentioned I might have ISP problems. I called them last night to make sure I could run the server, and they didn't know so they transferred me to their IT team.. The dude sounded like a complete redneck moron.. I told him I wanted to run a web server to do design testing and such and wanted to know if they allow it. He asked me what my problem was, so I told him what I wanted to do again and I told him that I'm being told that some ISPs will scan my connection for open ports and close them if found, and this will cause issues with running a server. I asked if they do that or if I should be ok to set it up.. He sounded like he was stumped, and said something about a new modem... So, I asked "so if I setup a home web server I need to request/upgrade my modem?" He didn't know what I was talking about, haha... then he asked if there was anything else I needed (thinking he had answered me in the first place) and I said "no, not as long as I can run my server." Then he just kind of sat there then said "Just give us a call back when you do it and we'll help you as much as we can."


I don't know if it matters, but I won't be hosting websites as a business or for money. I will only be hosting my personal websites and maybe a couple friends' who can't pay for Godaddy or simiar. I know I can do the website hosting using apache on my Windows machine, but I want the server so it can server as a sort of "central hub" for my home network and the devices connected to it. Plus, I figured I'd have more freedom with Apache (and my network in general) this way rather than just installing it on Windows.


All times are GMT -5. The time now is 04:03 PM.