LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2015, 02:54 AM   #1
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 280

Rep: Reputation: Disabled
CentOS 7 on a vps account


I am learning Linux, and I am planning to set up my first unmanaged hosting account (VPS). It will be CentOS 7 based. I read 10+ good books about Linux and I have good theoretical knowledge by now, and I am wondering what would be the steps that I would need to take in reality, after I get this account.

1) I log in through SSH
2) CentOS 7 will be already installed there. If I have something else, can I delete it all, and install CentOS 7 by myself?
3) I want to have Apache / Nginx Web server, FTP, email, and probably not much more than this. I guess I would delete all programs that are not needed to fine tune it and make it more robust. Is this correct?
4) I know that I can work on modifying the kernel too (tuning it, getting rid of things that are not needed, for what I need). Would this be needed, or would I rather leave it alone?
5) I dont want to have GUI on a remote web / ftp / email server, correct? Leave more resources for what is needed there... Or maybe it would be helpful and it would speed some of the things up? I've been reading - servers like this - no GUI.
6) I would have root account, and I would create a regular account, which I would use most of the time, and I would be switching to root with su / sudo.
7) I would set up Apache / Nginx web server, FTP, email, and all other configurations that are needed for this. This can be more advanced, I am planning to read books just on this (Apache Web Server / Nginx). I am not planning to be using cPanel or WHM
8) After I have my files there, and websites / domains are working, I would need to schedule backups. What are the best tools / methods for this?
9) I would need to look into security, like firewall, tcp wrappers possibly, scan ports to see if everything is secure, and in general be good in securing this computer, over time.

Is this more or less what I would need to be doing? I read books and like I said, my theoretical knowledge is good, but I need to switch to working on this in reality. What other things are needed, what are the smaller things that I would need to know (in practice), and what other info and aspects could be useful for this?

I have CentOS 7 on Virtual Box, and I will be getting a cheap VPS account with it too. I will be moving website files from one account (I already have one, but managed) to another, and testing how things work. What would I use for this, by the way, would people use RSYNC?

Thanks.
 
Old 08-30-2015, 03:38 AM   #2
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 280

Original Poster
Rep: Reputation: Disabled
One more thing that I can think of right now is partitioning the disk, during the installation. Assigning directories like /boot, /var, /home to different partitions. There is more options for this, like 8 or more separate directories for partitioning like this. Is this a necessary part on a one user vps plan?
 
Old 08-30-2015, 05:48 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545
Quote:
Originally Posted by AdultFoundry View Post
1) I log in through SSH
You log in over SSH as unprivileged user, then su to root and proceed to check the logs in /var/log (best first reflex), then secure SSH before doing anything else.


Quote:
Originally Posted by AdultFoundry View Post
2) CentOS 7 will be already installed there. If I have something else, can I delete it all, and install CentOS 7 by myself?
Depends on what access the provider grants you because you'll have to be able to boot an installer image. (Or do more dangerous stuff which I won't be advocating here and now ;-p)


Quote:
Originally Posted by AdultFoundry View Post
3) I want to have Apache / Nginx Web server, FTP, email, and probably not much more than this. I guess I would delete all programs that are not needed to fine tune it and make it more robust. Is this correct?
Correct. Know that you should use Yum to do that and never remove stuff without testing dependencies first (meaning don't use "-y"). One way to weed out stuff could be to make a list of packages and go over it ('rpm -qa --qf="%{name} %{group}\n";'), the other to sort by and check by group ('rpm -qa --qf="%{name} %{group}\n"|sort -k2;') and another to install GNU/Tiger and see what it comes up with.


Quote:
Originally Posted by AdultFoundry View Post
4) I know that I can work on modifying the kernel too (tuning it, getting rid of things that are not needed, for what I need). Would this be needed, or would I rather leave it alone?
Depends. *If you use documentation found on the 'net always make backups (or better: create separate files in /etc/sysctl.conf.d/ for modifications), always check the date it was written, the purpose it was written for and the perceived expertise level of the writer as many people blithely blog away without clue. The Linux kernel does pretty decent Virtual Memory Management so I'd leave rmem / wmem alone. Apart from stuff that should be disabled / avoided please only tune TCP/IP stack behaviour when you've actually tested baseline values.


Quote:
Originally Posted by AdultFoundry View Post
5) I dont want to have GUI on a remote web / ftp / email server, correct? Leave more resources for what is needed there... Or maybe it would be helpful and it would speed some of the things up? I've been reading - servers like this - no GUI.
Correct. Headless server equals no GUI.


Quote:
Originally Posted by AdultFoundry View Post
6) I would have root account, and I would create a regular account, which I would use most of the time, and I would be switching to root with su / sudo.
Yes.


Quote:
Originally Posted by AdultFoundry View Post
7) I would set up Apache / Nginx web server, FTP, email, and all other configurations that are needed for this. This can be more advanced, I am planning to read books just on this (Apache Web Server / Nginx).
After initial hardening (ensuring nobody has unauthorized access) and enabling and testing your backup scheme, while you test services set the firewall to only allow requests from your management IP or range for testing purposes.


Quote:
Originally Posted by AdultFoundry View Post
I am not planning to be using cPanel or WHM
Congratulations. Best decision ever.


[QUOTE=AdultFoundry;5413099]8) After I have my files there, and websites / domains are working, I would need to schedule backups.
Not after: before. Also set your update scheme.


Quote:
Originally Posted by AdultFoundry View Post
What are the best tools / methods for this?
How about plain old rsync?


Quote:
Originally Posted by AdultFoundry View Post
9) I would need to look into security, like firewall, tcp wrappers possibly, scan ports to see if everything is secure, and in general be good in securing this computer, over time.
Yes but please harden before installing more software and enabling services. Follow CentOS / RHEL / SANS Reading Room / OWASP documentation and test with Cisecurity benchmark, GNU/Tiger, OpenVAS.


Quote:
Originally Posted by AdultFoundry View Post
I have CentOS 7 on Virtual Box, and I will be getting a cheap VPS account with it too. I will be moving website files from one account (I already have one, but managed) to another, and testing how things work. What would I use for this, by the way, would people use RSYNC?
Yes. BTW it would be good to use your VirtualBox CentOS 7 as Staging area. That way you can safely test and revert (snapshots) changes so you hopefully won't lock yourself out of your Production environment ;-p


Quote:
Originally Posted by AdultFoundry View Post
One more thing that I can think of right now is partitioning the disk, during the installation. Assigning directories like /boot, /var, /home to different partitions. There is more options for this, like 8 or more separate directories for partitioning like this. Is this a necessary part on a one user vps plan?
This isn't about a "one user vps plan" but about server purpose and therefore server usage. Although human users make mistakes in unfathomable ways there's some things you can do to curb damage. For example a separate /tmp (use a tmpfs if you have ample RAM), a separate /home with appropriate quota and a separate /var make sense for about any server. (Those that shrug the latter off will find out when they can't log in any more because /var is full ;-p) I'd propose /boot, /, /tmp, /home, /var. Also note a CentOS minimal install uses only about 800 megs in / of which the most will be in /usr.
*Also next time use the "edit" button on your post. You reply to your own thread dropped it off of the 0-reply list and you do not want that.

HTH, have fun!
 
Old 08-30-2015, 06:01 AM   #4
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 280

Original Poster
Rep: Reputation: Disabled
Thanks. I dont want to work as system administrator, and the only reason I started learning this is cheaper self-managed hosting (could be around $100 per month, instead of up to $350, and I can also negotiate better pricing if I know how to do it all). It seems like a lot of work, and a lot of additional knowledge that is needed, but it can be done. It seems like, when I would start making any good money (meaning, being able to afford that), I would consider switching to fully managed hosting again (by somebody else). It is a good knowledge to have though, and I should be able to use it too. In the end, I will figure out what I need, and it is probably like 20 of general Linux knowledge (and the amount of commands that I will be using) that I will need, on a daily / weekly basis (just server / ftp / email / backups / some security / updates).
 
Old 08-30-2015, 06:10 AM   #5
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Well. You certainly have thought this out well. You are already one step ahead of many.

$100 for hosting. I am curious, is it possible for you to run your own box by any chance? Right now I am doing that with my small one man company and the internet and extra electricity cost me about $100. The benefit is that my system has as much resources available as I can possibly squeeze out of it.

But anyhow... your own server or VPS it is an interesting experience either way. Hope you have lots of fun.
 
Old 08-30-2015, 06:23 AM   #6
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 280

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ericson007 View Post
Well. You certainly have thought this out well. You are already one step ahead of many.

$100 for hosting. I am curious, is it possible for you to run your own box by any chance? Right now I am doing that with my small one man company and the internet and extra electricity cost me about $100. The benefit is that my system has as much resources available as I can possibly squeeze out of it.

But anyhow... your own server or VPS it is an interesting experience either way. Hope you have lots of fun.
So you have your computer at home, 24/7 and host your websites from there? I knew it was possible, but I've never thought about working on something like this. I want to work on an xxx tube site with like 100,000 or even 500,000 videos, all self hosted, and get like 2,000,000 visitors a day. Would something like this be possible with a regular Internet plan from an ISP (good and fast plan through cable modem)? I can probably get whatever hardware would be needed, electricity is obviously here, and like I said, it is an ISP through coaxial cable / cable modem, but the company is good.

Last edited by AdultFoundry; 08-30-2015 at 06:38 AM.
 
Old 08-30-2015, 07:05 AM   #7
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
To start you will be fine. You will need some serious power to do that. You will have to upgrade to corporate accounts once you get to that level, but even with VPS, that sort of juice will certainly not cost a max of $350.

First find out if you have a public IP and if you can do port forwarding on the router the ISP gave you.

But none the less. It is going to take a fair while for 2 million daily visits.
 
Old 08-30-2015, 07:14 AM   #8
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 280

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ericson007 View Post
To start you will be fine. You will need some serious power to do that. You will have to upgrade to corporate accounts once you get to that level, but even with VPS, that sort of juice will certainly not cost a max of $350.

First find out if you have a public IP and if you can do port forwarding on the router the ISP gave you.

But none the less. It is going to take a fair while for 2 million daily visits.
Ok, so I can basically set up hosting at home (this could be cloud storage + hosting), and run a computer 24/7 from home, and everything would just work (assuming it would be configured correctly, maintained, and all other things like that)? And with this, this would be cheaper than anything that I can get from somebody else on the Internet? What about website speed and performance, would it be ok?
 
Old 08-30-2015, 08:50 AM   #9
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Well, the last two sentences are what you should be aware of. Cheaper, yes and no. You need to remember that server hardware is not free. Electricityis not free and isp is not free.

In my case the first 4 months it worked out more expensive. I started adding elearning, vps could not cope with those services so i boughthardware and never looked back. Depending on location, isp would be the limiting factor. I pay around 9000 (80usd) a month for a 1gbps connection. Unlimited download and max 30gb upload a day. Well you can go over but they threaten to cut the connection after too many times busting 30 gigabytes data a day.

The benefit of hardware ownership is you get all the resources. The problem doing it this way is you have 1 connection. If it fails, you are offline. Your isp probably does dhcp and can be a dns nightmare if ip always changes. What are your effective up and down speeds.

I get about 100mbps up and 250 down. Not even close to 1gbps but not bad and more than enough for what I need. Sometimes higher but never more than 20 lower. Remember, in Japan we are lucky. We do not have the monthly data caps like in many other countries.

Those speeds with vps and extra storage and more cpu and ram will add dollars with vps but they have super solid connections so if one of their isp pipes fail, there is always a backup. If their power fails there is always a backup. If your vps hardware crashes, it will be automatically migrated and continue to work. So even though you say self managed, the provider still takes care of all those little background issues. Believe me, they can get customers pretty upset.

It all just depends on what you want and at what stage you are. But seeing you already pay the isp, you already have a machine. I think that yeah, the extra electricity would make it cheaper over all.

I Pay about 3500 for electricity on my server a month. Roughly about 28USD. In the US utilities tend to be cheaper though so maybe it will add less than 20 a month.

Last edited by ericson007; 08-30-2015 at 08:52 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Install CentOS Web Panel on a CentOS 6 Linux VPS LXer Syndicated Linux News 0 03-24-2015 10:42 AM
Help with CentOS VPS Dugga1 Linux - Server 9 03-17-2014 06:26 PM
CentOS 6.3, VPS, IP FAILOVER Hirogens Linux - Networking 0 09-03-2012 04:24 AM
Want FileZilla access to newly created VPS account with PureFTPd JazzcatCB Linux - Newbie 2 09-14-2011 06:35 AM
CentOS 5.3 VPS and RealVNC TheN00B Linux - Server 1 03-11-2010 11:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration