Web Server Setup Raiders for FreeBSD Platform

  

In FreeBSD systems, network capabilities are important. For a standard FreeBSD system, at least one web interface is required to communicate with other computers. It supports Token Ring and FDDI, as well as WAN connection methods such as ordinary telephone dial-up connections, ISDN, and ATM. About the installation of the FreeBSD system, the previous has been introduced for readers, this article will discuss the establishment of the WEB service based on this system platform, the use version of FreeBSD is 4.7.

a. The first step access Internet


configuration of FreeBSD is to allow access to the Internet and set up a proxy service. We know that there are two situations in which the machine uses ADSL to access the Internet, that is, the dynamic ip obtained by dialing or the static ip provided by the ISP. The following mainly introduces the configuration process of dynamic IP.

method is very simple, by directly editing the "/etc/ppp/ppp.conf" file and "/etc/rc.conf" file to achieve access to the Internet and support transparent proxy NAT mode.

open PPP.conf implementing its configuration file, use the following command:

# vi /etc/ppp/ppp.conf

a simple configuration example (note There must be a space before the 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 Change to the name of the network card you are connecting to the ADSL modem
set mru 1492
set mtu 1492
set authname username # username is the dial-up username
set authkey password # password is the dial-up password
set dial
set login
add default HISADDR

rc.conf file and then open its implementation configuration, using the following command:

# vi /etc/rc.conf < BR>
A simple configuration example:
# -- sysinstall generated deltas -- # Tue Jul 15 21:20:28 1997
# Created: Tue Jul 15 21:20:28 1997
# Enable ne Twork 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 address, fxp0 is the network card name
inetd_enable="YES # #启动加载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" #Enable Firewall
firewall_script="/etc/rc.firewall"
firewall_type="open"
firewall_quiet="YES "
firewall_logging_enable="YES"
ppp_enable="YES" # Power Auto Dial
ppp_mode=" Ddial"
ppp_nat="YES" # Enable transparent proxy
ppp_profile="adsl" # Configure code
# -- sysinstall generated deltas -- # Wed Jul 16 06:52:13 1997
< BR> After modifying and restarting the personality of the above two files, you can dial up and implement transparent proxy. The client needs to set the DNS to the DNS address provided by the service provider. The gateway is set to the IP address of the internal network card of the proxy server. In this example, it is 192.168.0.1. And clear all the check boxes on connection settings in IE's "Internet Options". If the domain name cannot be resolved, check that the "/etc/resolv.conf" file is correctly configured with the DNS server address. //This article from the application of computer hardware and software network www.45it.com reproduced please specify

II. Installation and set up Installation and set up a web server


Web server, please refer to the following steps:

first step: Turn off the Squid service, remove Ipfw transparent proxy port forwarding statements The command consists of:
# cd /usr/local/etc/rc.d
# ./squid.sh stop
# mv squid.sh squid.sh.bak
# ipfw del 500 fwd 127.0.0.1,3128 tcp from 192.168.0.0/24 to any 80

Step 2: install ports. Using it makes it easy for FreeBSD to install a variety of software. (If you already have the /usr/ports directory, you have already installed it), the command format is:
# /stand/sysinstall
Then select "Configure_Distributions-ports", the ports are installed in "/In the usr/ports directory.

third step: then install apache1.3.27 + modssl (about the installed version of the software you can choose according to the actual situation, the same below). After installation, the system will automatically generate the startup script apache.sh, in the /usr/local/etc/rc.d directory. Can be run by running apache.sh start| Stop to start or stop apache. The command format is:


# cd /usr /ports /www /apache13-modssl
# make install #FreeBSD automatically downloaded from a network and installing

fourth step: Install mysql3.23. Upon completion, the startup script "/usr/local/etc/rc.d/mysql-server.sh" will be created. The command format is:
# cd /usr /ports /databases /mysql323-server
# make install

Step 5: Install apache module mod_php4, command format is:
# cd /Usr/ports/www/mod_php4 #FreeBSD will automatically download and install
from the network. Then edit the "configure.php" file in the scripts directory and add support for OpenSSL. The command format is:
# vi scripts/configure .php
After opening this file, find this sentence: OpenSSL "OpenSSL support" ON and then change it to: OpenSSL "OpenSSL support" YES After modifying "configure.php", edit the apache configuration file
/usr/local/etc/apache/httpd.conf , add the following:
DirectoryIndex index.php index.html # Set the default home page name to use
AddType application/x-httpd-php .php
AddType application /x-httpd-php-source .phps #'ll need to add these two

step Six: start and restart testing

Log in as root and execute the command "top" (thread view command). If you see the following, it means everything is ready:
PID USERNAME PRI NICE SIZE RES STATE COMMAND
69 root 2 0 440K 296K select natd # network address translation process
132 root 2 0 3692K 3052K select httpd # apache process
166 mysql 2 0 27480K 4824K poll mysqld # mysql process

in the browser address bar enter http: //192.168. 0.1, if the apache welcome page is displayed, the web server installation is successful! The web page file is stored in the /usr/local/www/data directory. Just copy your own web page to this directory and you can access your home page!

Copyright © Windows knowledge All Rights Reserved