hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Hosting Security and Technology Tutorials : FreeBSD Kernel
Reply

Hosting Security and Technology Tutorials Tutorials related to server security or the like.
Forum Jump

FreeBSD Kernel

Reply Post New Thread In Hosting Security and Technology Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 01-20-2004, 02:24 AM
Crucial Crucial is offline
Boston Colocation and VPS
 
Join Date: Dec 2003
Location: Boston, MA
Posts: 592

FreeBSD Kernel


If your running FreeBSD and need to add something to the kernel this is how its done. We will be adding ipfw firewall in this example:

(Change to the kernel config directory)
# cd /usr/src/sys/i386/conf

(rename the DEFAULT config file to a NEWNAME, For this purpose we will call it WEB)

# cp DEFAULT WEB

(we always want to make sure we dont remove the DEFAULT FILE, incase you need it in the future or want to resort to it for reference, if you mess something up)

(Lets edit the config file now, use edit, pico, vi or any text editor on your machine, for learning purposes I will use pico)

# pico WEB

(Under all the option lines towards the top of the config, add the following lines, OR EDIT the KERNEL)

options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=1000
options IPFIREWALL_DEFAULT_TO_ACCEPT
options IPDIVERT
options DUMMYNET

(Now its time to CONFIG the kernel, if this errors please re-edit the config and verify its content you added is correctly added)

# /usr/sbin/config WEB

(Now lets CD to the compiled directory)

# cd ../../compile/WEB

(Ok, ALWAYS do a make depend, dont skip this step a lot of people think its wortless please take the time and run it)

# make depend
# make

(Install the new kernel.)

# make install

(If everything completed there will be NO ERRORS, now reboot the system "reboot", "shutdown -r now kernel update)

Enjoy! and be CAREFULL when editing the kernel


FAQ:

Q: The dir "cd /usr/src/sys/i386/conf" dont exsist?
A: You need to isntall cvsup and sup the src. If you have ports installed, "whereis cvsup". cd to the dir, and make install. Once completed it will create example files, goto the files and edit the proper file usally "stable-supfile". Uncomment the src-all and read the entire configuration file, then run the cvsup program (If you read the config, you will know how to run the cvsup program).

Q: Why does make depend give me errors?
A: Check the content of the file, sometimes you added something that wasn't soposed to be added, remove it and run "make clean" and "make depend", please continue the other steps as well..


Last edited by Crucial; 01-20-2004 at 03:02 AM.
Reply With Quote


Sponsored Links
  #2  
Old 01-21-2004, 09:05 PM
eBoundary eBoundary is offline
Web Hosting Master
 
Join Date: May 2003
Location: Philadelphia
Posts: 968
Just FYI, the default kernel on FreeBSD is GENERIC, not DEFAULT.

< Admin Note: Edited to remove signature. >


Last edited by Rochen; 01-26-2004 at 03:39 PM.
Reply With Quote
  #3  
Old 01-26-2004, 03:25 PM
chris_lynch chris_lynch is offline
New Member
 
Join Date: Jan 2004
Posts: 0
Everyone forgets these:


OPTIONS NMBCLUSTERS set this to a high number , LINT has 1024, but, I've seen some servers with 16384

OPTIONS NMBUFS, 4 Times your NMBCLUSTERS.

Basically, those options will help out things when your server does tons of traffic.

Reply With Quote
Sponsored Links
  #4  
Old 01-27-2004, 01:55 AM
Crucial Crucial is offline
Boston Colocation and VPS
 
Join Date: Dec 2003
Location: Boston, MA
Posts: 592
Yeah users can add whatever they wish to the kernel, this how to was to inform them how to actually compile/setup the kernel.

I do recomend each user to do some research on each option and make sure there setup properly and you install something you really need.

Reply With Quote
  #5  
Old 01-27-2004, 05:20 AM
IRCCo Jeff IRCCo Jeff is online now
CISSP, CISA
 
Join Date: Aug 2002
Location: Los Angeles, CA
Posts: 5,054
Its good to know that people are writing tutorials that actually make sense without hours of translation

Reply With Quote
  #6  
Old 01-27-2004, 07:20 PM
rjerina rjerina is offline
WHT Addict
 
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 147
dont forget to enable quota in the kernel, if you plan on using cpanel or keep user quotas.

Reply With Quote
  #7  
Old 01-29-2004, 04:53 AM
Cirrostratus Cirrostratus is offline
Web Hosting Master
 
Join Date: Jul 2003
Location: Texas
Posts: 785
Another trick for FreeBSD custom kernels is to edit the KERNCONF file like was described above and then instead of doing the cd ../../ && confg KERNCONF && make depend && make etc etc you can


% cd /usr/src
% make buildkernel KERNCONF=YOURKERNFILENAME
% make installkernel KERNCONF=YOURKERNFILENAME
% reboot

Enjoy your custom kernel.

Reply With Quote
  #8  
Old 01-31-2004, 02:51 AM
CR- CR- is offline
Junior Guru
 
Join Date: Sep 2003
Posts: 215
Quote:
Originally posted by delo-
Another trick for FreeBSD custom kernels is to edit the KERNCONF file like was described above and then instead of doing the cd ../../ && confg KERNCONF && make depend && make etc etc you can


% cd /usr/src
% make buildkernel KERNCONF=YOURKERNFILENAME
% make installkernel KERNCONF=YOURKERNFILENAME
% reboot

Enjoy your custom kernel.
nod. that's how i've always done it.

J.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host Rackspace Adds FreeBSD 9, CentOS 6.3 Support to Cloud Servers Web Hosting News 2012-07-30 12:47:10
NYI Network Administrator Launches New Version of Network Analysis Tool Net Sensor Web Hosting News 2012-06-26 13:53:47
Colocation Provider NYI Launches East Coast Mirror for FreeBSD Foundation Web Hosting News 2012-05-25 10:37:18
Host Virtual Expands Cloud Service in TelecityGroup London Data Center Web Hosting News 2012-02-02 16:55:29
Linux Foundation Website Down After Security Breach Last Week Web Hosting News 2011-09-12 20:32:11


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 On
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?