apache php mysql
1、更新ports安装包
使用portsnap来更新步骤(可以修改/etc/portsnap.conf的配置文件SERVERNAME=portsnap.cn.FreeBSD.org,以提高你的下载速度)
a、没有执行过使用 portsnap fetch extract
b、执行过 portsnap update
使用cvsup安装更细步骤
a、首先安装cvsup
#cd /usr/ports/net/cvsup-without-gui
#make install clean
b、配置cvsup
#cp /usr/share/examples/cvsup/ports-supfile /etc/ports-supfile
修改配置文件*default host=CHANGE_THIS.FreeBSD.org修改为*default host=cvsup.cn.FreeBSD.org
#vi /etc/ports-supfile
c、执行cvsup
#cvsup -L 2 /etc/ports-supfile
或者将此命令加入到crontab里面去。怎么加以后进行讨论
2、安装mysql的步骤
a、安装步骤
#cd /usr/ports/databases/mysql51-server
#make WITH_CHARSET=GBK WTIH_XCHARSET=ALL install clean
#cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
b、设置自启动
vi /etc/rc.conf
mysql_enable="YES"
c、初始化
/usr/local/bin/mysql_install_db --user=mysql
chown -R mysql /var/db/mysql/
d、启动
/usr/local/bin/mysqld_safe -user=mysql &
e、修改密码
/usr/local/bin/mysqladmin -u root password 'newpasswd'
3、安装apache22的步骤
a、安装步骤
#cd /usr/ports/www/apache22
#make WITH_BERKELEYDB=db4 install clean //增加一个小的东西就是为了subversion得用的一个库
【有很多的默认配置信息,选择默认就可以了!】
b、解决兼容性的问题
这个时候启动会报一个警告信息,解决错误
#cd /usr/src/sys/modules/accf_data
#make
#make install clean
#cd /usr/src/sys/modules/accf_http
#make
#make install clean
#vi /etc/loader.conf
加入以下代码
accf_data_load="YES"
accf_http_load="YES"
c、添加配置信息并启动
#vi /etc/rc.conf
加入如下
#apache22
apache22_enable="YES"
apache22_http_accept_enable="YES"
启动
#reboot
#apachectl -k restart
4、安装php52
a、编译安装
#cd /usr/ports/lang/php52
#make install clean
安装过程当中需要配置信息如下
[X] CLI Build CLI version
[X] CGI Build CGI version
[X] APACHE Build Apache module
[ ] DEBUG Enable debug
[X] SUHOSIN Enable Suhosin protection system (not for jails)
[X] MULTIBYTE Enable zend multibyte support
[X] IPV6 Enable ipv6 support
[X] MAILHEAD Enable mail header patch
[ ] REDIRECT Enable force-cgi-redirect support (CGI only)
[ ] DISCARD Enable discard-path support (CGI only)
[X] FASTCGI Enable fastcgi support (CGI only)
[ ] FPM Enable fastcgi process manager (CGI only)
[X] PATHINFO Enable path-info-check support (CGI only)
b、COPY配置文件
#cd /usr/local/etc/
#cp php.ini-dist php.ini
c、配置apache22
#vi /usr/local/etc/apache22/httpd.conf
在<IfModule mime_module>模块当中加入如下代码
# PHP
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
将这一行
DirectoryIndex index.html
修改为
DirectoryIndex index.php index.htm index.html
d、重启apache22,测试php安装情况
#vi /usr/local/www/apache22/data/index.php
加入如下代码
<?php phpinfo();?>
e、测试
#rehash
在浏览器键入主机ip看是否有php的配置信息,如果有OK,配置成功,下一步我们开始安装php的扩展
5、安装php52-extensions
#cd /usr/ports/lang/phg52-extensions
#make install clean
配置信息如下(原则尽量多的打开功能防止以后会用到某个功能还得编译)
[X] BCMATH bc style precision math functions
[X] BZ2 bzip2 library support
[X] CALENDAR calendar conversion support
[X] CTYPE ctype functions
[X] CURL CURL support
[X] DBA dba support
[X] DBASE dBase library support
[X] DOM DOM support
[X] EXIF EXIF support
[X] FILEINFO fileinfo support
[X] FILTER input filter support
[ ] FRIBIDI FriBidi support
[X] FTP FTP support
[X] GD GD library support
[X] GETTEXT gettext library support
[X] GMP GNU MP support
[X] HASH HASH Message Digest Framework
[X] ICONV iconv support
[X] IMAP IMAP support
[ ] INTERBASE Interbase 6 database support (Firebird)
[X] JSON Javascript Object Serialization support
[X] LDAP OpenLDAP support
[X] MBSTRING multibyte string support
[X] MCRYPT Encryption support
[X] MHASH Crypto-hashing support
[ ] MING ming shockwave flash support
[ ] MSSQL MS-SQL database support
[X] MYSQL MySQL database support
[X] MYSQLI MySQLi database support
[ ] NCURSES ncurses support (CLI only)
[X] ODBC unixODBC support
[X] OPENSSL OpenSSL support
[ ] PCNTL pcntl support (CLI only)
[X] PCRE Perl Compatible Regular Expression support
[X] PDF PDFlib support (implies GD)
[X] PDO PHP Data Objects Interface (PDO)
[X] PDO_SQLITE PDO sqlite driver
[X] PDO_MYSQL PDO mysql driver
[X] PGSQL PostgreSQL database support
[X] POSIX POSIX-like functions
[X] PSPELL pspell support
[ ] READLINE readline support (CLI only)
[ ] RECODE recode support
[X] SESSION session support
[X] SHMOP shmop support
[X] SIMPLEXML simplexml support
[X] SNMP SNMP support
[X] SOAP SOAP support
[X] SOCKETS sockets support
[X] SPL Standard PHP Library
[X] SQLITE sqlite support
[X] SYBASE_CT Sybase database support
[X] SYSVMSG System V message support
[X] SYSVSEM System V semaphore support
[X] SYSVSHM System V shared memory support
[X] TIDY TIDY support
[X] TOKENIZER tokenizer support
[X] WDDX WDDX support (implies XML)
[X] XML XML support
[X] XMLREADER XMLReader support
[X] XMLRPC XMLRPC-EPI support
[X] XMLWRITER XMLWriter support
[X] XSL XSL support (Implies DOM)
[X] YAZ YAZ support (ANSI/NISO Z39.50)
[X] ZIP ZIP support
[X] ZLIB ZLIB support
6、安装samba34
#cd /usr/ports/net/samba34
#make install clean
进行默认配置,不进行任何改动
#cp /usr/local/share/examples/samba34/smb.conf.default /usr/local/etc/smb.conf
#vi /usr/local/etc/smb.conf
加入如下东西
[dev]
path = /usr/local/dev
public = yes
only guest = yes
writable = yes
printable = no
添加smbpasswd用户
#/usr/local/bin/smbpasswd -a username添加用户名,更具提示信息来进行操作
#vi /etc/rc.conf
加入
#samba3
nmbd_enable="YES"
smbd_enable="YES"
手动启动就是
#/usr/local/etc/rc.d/samba start
#/usr/local/etc/rc.d/samba stop
7、安装subversion
#cd /usr/ports/devel/subversion/
#make WITH_MOD_DAV_SVN=yes install clean
#vi /usr/local/etc/apache22/httpd.conf
在加入如下代码
<Location /svn>
DAV svn
SVNParentPath /usr/svn
AuthType Basic
AuthName "Welcome Svn"
AuthUserFile /etc/svn-auth-file
SVNListParentPath on
Require valid-user
</Location>
添加用户
#rehash
是创建用户文件并添加用户,创建第一个用户的时候使用
#htpasswd -c /etc/svn-auth-file accountname
添加用户
#htpaawd /etc/svn-auth-file accountname
创建版本目录
#mkdir /usr/svn
#svnadmin create /usr/svn/bianews_foxread
来源:http://cms.nn200.com/html/system/201010/1314512/
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/3923/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表