LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to setup Linux web servers? (http://www.linuxquestions.org/questions/linux-server-73/how-to-setup-linux-web-servers-721279/)

stay92 04-23-2009 07:12 PM

How to setup Linux web servers?
 
Hello,

I want to setup a Linux web server. I am Windows guy so I donít know anything about Linux.


1. Only one website will be running on that Linux Box.

2. 5,00000 users visit that website every day

3. 5,000 users login into that website every day

4. Restricted users canít be login into that website

5. Full security (hardware firewall or software firewall)

6. Hacking implementation

7. Need to create one Fail over server (Clustering) for the same server on other Linux server

8. How to do Synchronization of data?

9. Also The website only accessible from INDIA

So can anyone help me for the same? Please let me know which Linux OS should I use, about which security steps I should apply on the server, how can I deal with Hacking implementation for the same, how can I create Fail over server (Clustering), is there any tool for data Synchronization, which services I need to running on that server, how to make the web site only accessible from India?

Also if 5,00000 users visit that website every day and 5,000 users login into that website every day so which CPU & RAM I should use. I mean what will be the server hardware configuration?

Thanks,

linus72 04-23-2009 07:44 PM

Dont know much about servers...but
a couple distro's for you-

Slampp and Slampp Lite
( http://slampp.abangadek.com/wiki/wik...wakka=HomePage )

Slack-Mini-Server
( http://sms.it-ccs.com/ )

stay92 04-23-2009 08:18 PM

linus72,

Thanks for your reply. But i don't think that will help me.

yancek 04-23-2009 08:24 PM

Two of the more popular distributions for servers are CentOS and Opensuse. You can find numerous tutorials for setting up a LAMP server with either.

voyvf 04-23-2009 08:33 PM

Quote:

Originally Posted by stay92 (Post 3519034)
hello,

i want to setup a linux web server. I am windows guy so i don’t know anything about linux.
  1. only one website will be running on that linux box.
  2. 500,000 users visit that website every day
  3. 5,000 users login into that website every day
  4. restricted users can’t be login into that website
  5. full security (hardware firewall or software firewall)
  6. hacking implementation
  7. need to create one fail over server (clustering) for the same server on other linux server
  8. how to do synchronization of data?
  9. also the website only accessible from india.

so can anyone help me for the same? Please let me know which linux os should i use, about which security steps i should apply on the server, how can i deal with hacking implementation for the same, how can i create fail over server (clustering), is there any tool for data synchronization, which services i need to running on that server, how to make the web site only accessible from india?

Also if 500,000 users visit that website every day and 5,000 users login into that website every day so which cpu & ram i should use. I mean what will be the server hardware configuration?

Thanks,

Synchronization of data really depends on how you're storing it. If it's a MySQL or PostgreSQL DB, you can have them clustered as well. For that kind of load, though, I'd really suggest having a separate server on hand for handing the database load.

A daily or bi-daily rsync between the primary and fail-over servers might be a good idea, too. Just make sure cron is set to run it outside of your peak hours.

shorewall is a pretty good frontend for the software firewall (ipchains), and properly configured can make your website only accessible from India. There were a slew of great suggestions for security software when LQ ran its "Best of Year" thing, I'd suggest looking into that thread.

fail2ban or similar is pretty much a must for any server, security-wise.

As far as restricting users that can log in, that's really more the software you'll be running on top of the web server. I'd need more information regarding what you'll be running on the machine to give advice.

Also, apache's pretty darn tough, but you might consider splitting it up between apache for the main request handler and a media server like lighttpd or tux for graphics/css/js. That way your apache process isn't tied up with essentially simple tasks - that is, serving a static file - when it could be handling the programming logic behind the site. This methodology has worked for me for Python, PHP, and Perl sites, but again your mileage may vary depending on your software stack.

Honestly, for high traffic sites, I usually prefer actually having a completely separate machine for static files like that, but that's really implementation specific.

The biggest thing you'll need to focus on, especially with a site that will likely grow in traffic, is loose coupling. You'll need to be able to add services or servers as quickly and painlessly as possible, and software that's closely tied into other software will be the bane of your existence.

That's all I have time for tonight. There's a lot more to it, believe me, but I've tried to cover some of the basics. Hope it helps.

Edit: Oh, and learn to use memcached. It rocks. :D

stay92 04-23-2009 08:57 PM

Thanks Voyvf,

Can you please let me know which OS should I use? I am using mysql and DB size is around 3 GB. This web site is like eBuy got it?

stay92 04-23-2009 09:00 PM

Hello Yancek,

CentOS is also Linux OS? And can you please help me to find that tutorial?

yancek 04-24-2009 12:06 AM

CentOS is the free version of Red Hat Ent. Linux. Here are links to two :

http://www.howtoforge.com/centos-5.1...-ftp-ispconfig

http://www.mysql-apache-php.com/centos-lamp-server.htm

And for Opensuse:

http://en.opensuse.org/LAMP

http://www.howtoforge.com/perfect-server-opensuse11

stay92 04-24-2009 02:38 PM

Hello,

Can anyone please help me more?

Thanks,

salasi 04-24-2009 04:40 PM

Quote:

Originally Posted by stay92 (Post 3519034)
Hello,

I want to setup a Linux web server. I am Windows guy so I don’t know anything about Linux.


1. Only one website will be running on that Linux Box.

2. 5,00000 users visit that website every day

3. 5,000 users login into that website every day

This sounds like a serious level of traffic, although a lot depends on what the users do (there is a big difference between serving up a few static web pages and having some serious, high bandwidth, database stuff going on).

Quote:

4. Restricted users can’t be login into that website
Which presumably means something, but, as you haven't explained what you mean by restricted users and what the restrictions might be, no one reading this will know anything useful about it.

Quote:

5. Full security (hardware firewall or software firewall)
Hmmm, so one of the things that you might want is to use a separate firewall (which isn't a bad idea, necessarily) but you don't think that it comlicates the server sizing aspect not knowing whether it will be the firewall, or not.

For the security bit to work, someone, somewhere, will have to understand the system completely to configure things. Is that you? I think, if it is, you a fair amount of studying to do.

Otherwise, you have to hire someone who does know (and that part of this question is a waste time, because you will be hiring someone who knows).

Quote:

6. Hacking implementation
I don't know what this means. But then it isn't a question, so it doesn't really matter that I don't know what it means.

Quote:

7. Need to create one Fail over server (Clustering) for the same server on other Linux server
There's another area that you could spend quite a time becoming an expert on. Did you have a question about it, or were you intending searching on clustering in a well known search engine?

Quote:

8. How to do Synchronization of data?
Well, you haven't said enough about which data gets synchronised to which computers and when, how much data there is and how much changes, but you would probably want to use rsync or unison for the actual synchronisation.
Quote:

9. Also The website only accessible from INDIA
There are probably a number of ways of doing this, but he simplest would be to ask users at registration. That would mean that you would have to trust the users not to lie, but that may be acceptable.

Quote:

Please let me know which Linux OS should I use
The least of your problems, honestly, but, any of the established server variants would work.

Quote:

about which security steps I should apply on the server, how can I deal with Hacking implementation for the same, how can I create Fail over server (Clustering), is there any tool for data Synchronization, which services I need to running on that server, how to make the web site only accessible from India?
Have you thought about making as much of this as someone else's problem as you can by buying managed hosting?

stay92 04-24-2009 06:34 PM

Hello Salasi,

Thanks for your reply,

4. Restricted users can’t be login into that website
 I mean that if the users don’t have the login details to login into that website even after that some how if users will manage to login into that website then how can I stop them for the same?

5. Full security (hardware firewall or software firewall)
 Can you please let me know some Application firewall name along with user guide which can work on Linux?

7. Need to create one Fail over server (Clustering) for the same server on other Linux server
 Can you please help me to create this Fail over server? Like I just want to understand the stricture of my Fail over server logically. Please tell me the steps and some logic things.


8. How to do Synchronization of data?
Mysql DB size is around 3 GB and Web data size is around 4 GB and we update oure website every day may be in DB or may be on Web data.


Please let me know these things.

Thanks,

stay92 04-25-2009 02:45 AM

Hello,

Thanks everyone for helping me.

Thanks yancek,
Your last reply was useful for me.

stay92 04-25-2009 02:45 AM

Hello,

Thanks everyone for helping me.

Thanks yancek,
Your last reply was useful for me.

giftlftr_23 04-25-2009 03:28 AM

Quote:

Originally Posted by stay92 (Post 3520079)
4. Restricted users canít be login into that website
 I mean that if the users donít have the login details to login into that website even after that some how if users will manage to login into that website then how can I stop them for the same?

I think the creator of website is in charge of its security.

Quote:

Originally Posted by stay92 (Post 3520079)
5. Full security (hardware firewall or software firewall)
 Can you please let me know some Application firewall name along with user guide which can work on Linux?

The iptables will do the work for software firewall

Quote:

Originally Posted by stay92 (Post 3520079)
8. How to do Synchronization of data?
Mysql DB size is around 3 GB and Web data size is around 4 GB and we update oure website every day may be in DB or may be on Web data.

MySQL has clustering you may look the MySQL website for details.

salasi 04-25-2009 06:14 AM

Quote:

Originally Posted by stay92 (Post 3520079)

4. Restricted users can’t be login into that website
 I mean that if the users don’t have the login details to login into that website even after that some how if users will manage to login into that website then how can I stop them for the same?

All I have understood is that you want users to log in in order to have access. That is a fairly straightforward thing (although that may not be the end of the story, as i am in no position to tell whether this would offer adequate security ) and someone on the project needs to be able to code this. I'm not sure what about this is obscure.

If you are actually asking either how people log in or what a log in is, I think there are bigger problems than I can deal with here.

Quote:

5. Full security (hardware firewall or software firewall)
 Can you please let me know some Application firewall name along with user guide which can work on Linux?
OK, this has moved again to 'application firewall' (although I think that you are just making a mistake in terminology - maybe you meant firewall application - and your earlier statement was more accurate, although not as informative as it could be). I would make several points:
  • if you think security is identical to 'use a firewall', think again.
  • Using linux, you will use iptables (at least until it is superseded). There are many gui apps that give you an 'easy' front end to iptables, but it is not clear whether you are asking about that
  • If you cannot understand iptables rules directly, you will have to use some 'easier' approach, but if you cannot understand iptables rules it is probably a result of not being able to understand networking well enough to be safe doing this. This may or may not be a concern to you.
I need also to emphasise that there are people who specialise in security or even particular aspects of security; I don't see how a few answers to some somewhat ill-defined questions in a forum can replace the expertise of a good security consulatant, prticularly as the basis system is poorly defined and so it is almost impossible to avoid overlooking some aspects.

Systems architecture makes a big difference to which problems you have to solve at a detail level; this is engineering and you have to make decisions in the light of what problems you are prepared to solve; discussing the system in this patchy and inadequately defined way, stores up problems for the future.

Quote:

7. Need to create one Fail over server (Clustering) for the same server on other Linux server
 Can you please help me to create this Fail over server? Like I just want to understand the stricture of my Fail over server logically. Please tell me the steps and some logic things.
There are many tutorials available on fail over and high availability; they would be better than anything that I can tell you.
Quote:

8. How to do Synchronization of data?
Mysql DB size is around 3 GB and Web data size is around 4 GB and we update oure website every day may be in DB or may be on Web data.
You still haven't said what you want to synchronise (admittedly, knowing how much is potentially a useful thing, but its not the same thing); do you prepare an offline copy of the data that you want to sync in, are you sync-ing out (as, maybe, a backup) or amongst the various servers (either load sharing or hot standby)?

What happens if you have a worst-case data loss (ie, after whatever the sync time minus a short period)? Is it a minor inconvenience, or do you go bankrupt? Do you lose vital, unreconstructable, information? do all of your users leave?


Quote:

Please let me know these things.
I know I cannot answer all of your questions, but I would have more confidence about the possibility of achieving a succesful outcome if I was convinced that you understood the problems well enough to ask directed questions. It may that this is primarily a terminology problem in something other than your first language and, if it is, I apologise for having unfounded doubts.


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