On Thu, Nov 09, 2006 at 06:39:50AM +0100, VeeJay wrote:

> Hello There,
> 
> I wonder if someone from you could spare few minutes and share your
> knowledge with me.
> 
> I love FreeBSD and use it time to time but I think I am still novice.
> 
> I have got an assignment to build a Multi-Task web server.
> 
> GOALS:
> A Multi Task Web Server for Virtual Hosting running Apache, MySQL, ProFTP,
> Mail Program, etc. All on this server. Traffic expected 100,000 visits a
> day.
> 
> .Ideal Space required for MySQL DBs: 140GB.
> (Contents: Many MySQL databases backing name based virtual websites)
> 
> .Ideal Space required for Virtual Hosted Websites: 140GB
> (Contents: HTML, PHP, Images, Mail, Logs, Sites Backups, etc)
> 
> Maximum space required for SWAP to get high performance.
> 
> 
> HARDWARE:
> 1 dell rack server with:
> 2 x Dual Core Intel(r) Xeon(r) 5160, 4MB Cache, 3.0GHz, 1333FSB
> 4 GB FB 533MHz Memory (4x1GB dual rank DIMMs)
> 4 x 146GB, SAS, 3.5-inch, 15.000 rpm Hard Drives (hot plug)
> RAID 10 using PERC 5/i, x6 Backplane, Integrated RAID Controller Card
> Intel(r) PRO 1000PT Dual Port Server Adapter, Gigabit NIC, Cu, PCIe x4
> etc.
> 
> 
> Questions:
> 1. Which Version of FreeBSD will be the best choice and would be 32bit or
> 64bit?

You want the latest RELEASE version - currently 6.1, soon to be 6.2
They use the ISO built for your CPU - looks like i386.

> 
> 2. How can I get required Space when doing partition during installation?
> 

You just divide up your disk the way you want it.  If the disk is
too small, you have to add more disk.

databases tend to be put in /var/db  by default, so if you must
have 140 GB database size, then you need a /var of more than 140 GB.

web pages tend to be homed in with /usr/local or /home, but can
be configured to be anywhere.   For the system main web page, I
tend to make a 'www' account whose home is /home/www  and then for
all the virtual hosted sites, make a separate account for each and put
them in /home/    such as /home/web1   /home/web2, etc  (use more
meaningful account names).   

Then in httpd.conf or an included httpd.conf.local make a virtual host
block for each and set each-s DocumentRoot to be that accounts home
directory + www (or web)   as in /home/web1/www.

So, then make the filesystem where you put that stuff big enough - 
greater than 140 GB according to your post.   In reality, to get 140 GB,
you need to go almost 15% over because of overhead used up in building
the filesystem and the amount of reserve for the amount of reserve for 
the system.    So, given your post, you would need 155 GB for both
the /var and the /home file systems.    NOTE, that is system GB and
not manufacturer rated GB.  It would take about a 167 GB drive according
to manufacturer rating to net 140 GB of usable disk space after building
the file systems.

An easier, or at least more flexible way to deal with it is to get
a very large second disk - about 340 GB - and make one big file
system on it.   I tend to either mount it as my /home filesystem or
as /work.   Then move your /var/db and /home or whatever to there
and make symlinks to them.   If you create that big file system
and mount it as /home, then you just leave that as is and move
the /var/db directory in to it and make the symlink.  I tend to 
use names for the moved directories that reveal their origins.
So, for /var/db, I would call the dir in /home  var.db  (eg full
path would be /home/var.db) and then within the /var directory
would make the link as follows:    'ln -s /home/var.db db'
Of course, that has to be done after moving that 'db' directory to /home.
 
All this is well documented.  It is all very copiously covered in 
previous posts to questions and in FAQs and online magazing articles.
So you need to do a lot more studying.

> 3. What would be ideal SWAP space to get performance?

Rule of thumb is 2-1/4 times the amount of memory on the machine.
But you can get by with less, if you must.
 
> 4. Which Mail Program is secure and easy to configure for Virtual Hosting?

All of them are if you follow the documentation.   People have their
favorites and get in to religious wars over them, but generally they
all can be made secure and made to do what you need.   
 
> 5. What is the flow of installation when preparing a machine for Virtual
> Hosting? I mean which program should be installed first and how should they
> setup (apache, ftp, mysql, mail) to talk with each other for a specific
> virtual name-based host?

Just install the system, including full src and ports tree.
Then cvsup to the RELENG you are installing to get all the latest
security fixes.    For 6.1 that would be  RELENG_6_1
Contents of you supfile should be:
  *default host=cvsup.FreeBSD.org
  *default base=/var/db
  *default prefix=/usr
  *default tag=RELENG_6_1
  *default release=cvs 
  *default delete use-rel-suffix
  *default compress
  src-all
  ports-all tag=.
  doc-all tag=.
you can put that file anywheres.  I tend to put it in /etc and name it
with the version, so mine for 6.1 is:   /etc/supfile61
The cvsup command would look like:
  cvsup -g -L 2 /etc/supfile61

Add  'SUPFILE=/etc/supfile61  to the /etc/make.conf file.

Check your /etc/passwd and /etc/group files against those in /usr/src/etc
to see if there any new or changed entries you need to accomodate.

Run the builds under script to capture output

  script /root/buildworkd.out     (you can put that file anywhere actually)
  cd /usr/src
  make buildworld
  make buildkernel KERNCONF=GENERIC   (or your own custom conf if you made one)
  make installkernel KNERCONF=GENERIC
reboot to single user
  fsck -p
  mount -u /
  mount -a
  swapon -a
  cd /usr/src
  make installworld

  mergemaster -cv 

then reboot to full system

Make sure things are running OK 
and then install ports

  cd /usr/ports/www/apache22
  make clean
  [make configure]
  make 
  make install

For all the ports you plan to put in.

Set up configuration files for apache and virtual hosts
and MySQL and whatever.

Add accounts and web sites and whatever

relax and enjoy.

////jerry
> 
> 
> -- 
> Thanks!
> 
> BR / vj
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to