Secure and efficient Web server under FreeBSD platform

Source: Internet
Author: User

FreeBSD is a UNIX operating system that can be executed on a computer with an Intel compliant, DEC Alpha, or PC98 architecture. Because FreeBSD is a branch of UNIX, it has the characteristics of UNIX and can do the work that UNIX can do. At the same time, FreeBSD is also a set of free operating system, it can make our personal computer become advanced workstation, more stable provide you need network service. Next, this article will focus on how to set up a Web server under the FreeBSD platform.

First, access to the Internet

First let FreeBSD access to the Internet and set a good proxy service. The use of ADSL access to the Internet in two cases, that is, through dial-up access to dynamic IP or ISP provided static IP. The following describes the dynamic IP configuration process.

The method is simple, through directly edit/etc/ppp/ppp.conf file and/etc/rc.conf file can realize access to the Internet, and support the NAT way transparent proxy.

When you open the Ppp.conf file to implement the configuration, use the following command:

# vi/etc/ppp/ppp.conf

Configuration instance (Note that there are spaces before set):

Default

Set Log Phase Tun command

Set IFADDR 10.0.0.1/0 10.0.0.2/0

ADSL: # Configuration Code

Set Device Pppoe:vr0 # VR0 to the name of the network card you connect to the ADSL modem

Set MRU 1492

Set MTU 1492

Set AuthName Username # username is a dial-up user name

Set Authkey Password # password is a dial-up password

Set dial

Set Login

Add default Hisaddr

Then, when you open the Rc.conf file to implement the configuration, use the following command:

# vi/etc/rc.conf

Configuration instance:

#--Sysinstall generated Deltas--# Tue June 15 21:20:28 2006

# Created:tue 15 21:20:28 2006

# Enable Network daemons for user convenience.

# Please make all changes to this file, not to/etc/defaults/rc.conf.

# This file now contains just the overrides from/etc/defaults/rc.conf.

Hostname= "Www.usweb.com" # Your Host domain name

ifconfig_fxp0= "inet 192.168.0.1 netmask 255.255.255.0" #内网网卡ip地址, Fxp0 is the network card name

Inetd_enable= "YES" # Boot load inetd

Kern_securelevel_enable= "NO"

Linux_enable= "YES"

Nfs_reserved_port_only= "NO"

Sendmail_enable= "NO"

Sshd_enable= "YES"

Usbd_enable= "NO"

Gateway_enable= "YES"

Firewall_enable= "YES" #启用防火墙

firewall_script= "/etc/rc.firewall"

Firewall_type= "Open"

firewall_quiet= "YES"

Firewall_logging_enable= "YES"

Ppp_enable= "YES" # power-on AutoDial

Ppp_mode= "Ddial"

Ppp_nat= "YES" Enable transparent proxy

Ppp_profile= "ADSL" # Configuration Code

#--Sysinstall generated Deltas--# Wed June 16 06:52:13 2006

By modifying and restarting the two files above, you can dial the Internet and implement a transparent proxy. The client needs to set DNS to the DNS address provided by the service provider, and the gateway is set up as the intranet IP address of the proxy server, this example is 192.168.0.1. and remove all check boxes for connection settings in Internet Options for IE. If you cannot resolve the domain name, check that the/etc/resolv.conf file is properly configured with the DNS server address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.