Freebsd6.2 install apache22 + php5.2.x + mysql5.x

Source: Internet
Author: User
I. Environment:

Dell
PiII 700 + 512 M + 20g
Freebsd6.2

2. Install CVSup and update ports
# Cd/usr/ports/NET/CVSup-without-Gui
# Make install clean

# Create the ports-supfile file and configure the CVS server closest to you
# Cp/usr/share/examples/CVSup/ports-supfile/root/ports-supfile
# Vi/root/ports-supfile
......
* Default host = cvsup.freebsdchina.org
# (Note that CVSup uses the tcp5999 port by default. Check whether port 5999 is enabled for the Intranet or local firewall)
......

# Start to update ports
# CVSup-g-L 2/root/ports-supfile
#-G -- Non-graphic interface
#-L 2 -- display detailed update status (0 ~ 2. 0 indicates that only the error message is displayed)

3. Install apach22
# Cd/usr/ports/www/apache22
# Make install clean
# In the displayed dialog box, use the default configuration.

4. Install php5.2.x
# Cd/usr/ports/lang/PhP5
# Make install clean
# In the prompt box that appears, select Apache
# After the installation is complete, a message is displayed:
# Make sure index. php is part of your directoryindex.
# You shoshould Add the following to your Apache configuration file:
# Addtype application/X-httpd-PHP. php (--- content to be added)
# Addtype application/X-httpd-PHP-source. PHPs (--- content to be added)

5. Install common PHP modules
# Cd/usr/ports/lang/php5-extensions
# Make install clean
# In the displayed dialog box, in addition to the preset projects, You must select the following Frequently Used projects: ctype, curl, EXIF, folter, FTP, Gd, getext, GMP, IMAP, mbstring, mcrypt, MSSQL, MySQL, PDF, PCRE, session, sockets, zlib, zip. These items are very common, especially sessions.
# Then a menu will appear, which can be left by default.
# Then jump out of the third prompt box and select whether to use utf8.
# After the PHP module is installed, the php. ini file must be created under/etc.
# Cp-RP/usr/local/etc/PHP. ini-Dist/usr/local/etc/PHP. ini

6. Install mysql5.x
# Cd/usr/ports/database/mysql50-server
# Make install clean
# Cd/usr/ports/database/php5-mysql
# Make install clean

VII. apache2.2.x basic configuration
# Vi/usr/local/etc/apache22/httpd. conf
Serveradmin you@example.com
Servername www.example.com: 80
DocumentRoot "/usr/local/www/apache22/Data"

After DocumentRoot, there are the following sections: (some # Missing comments in the middle)
Options indexes followsymlinks comment this
# Options indexes followsymlinks
AllowOverride none
Order allow, deny
Allow from all
You must change it (followsymlinks) to the root directory of Your webpage.

Directoryindex index.html index.htm index. php

Add PHP support
If you want to use PHP, you must add PHP support to httpd. conf. Add the following content around other addtypes In the httpd. conf file for classification:
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP-source. PHPs

8. Start aphche22 and MySQL 5.x at startup.
# Echo 'apache22 _ enable = "yes" '>/etc/rc. conf
# Echo 'mysql _ enable = "yes" '>/etc/rc. conf

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.