FreeBSD下WEB服务器安装

2009-05-13 09:45:01来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

1、安装Apache:
freebsd# cd /usr/ports/www/apache2
freebsd# make install clean
编辑 /etc/rc.conf加入:
apache2_enable="YES"
2、安装Mysql:
freebsd# cd /usr/ports/databases/mysql40-server
freebsd# make install clean
也可以安装别的版本的mysql。
安装完成后,在/etc/rc.conf里加入:
mysql_enable="YES"
mysqllimits_enable="NO"
freebsd# /usr/local/etc/rc.d/mysql-server.sh start
freebsd# mysqladmin -u root password 123456
3、安装PHP_MOD:
freebsd# cd /usr/ports/www/mod_php5
freebsd# make install clean
在安装时一定要选:APACHE2,如果用APACHE2的话。
安装完后编辑/usr/local/etc/apache2/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
加入“index.php”到DirectoryIndex里:
DirectoryIndex index.php index.html index.html.var
4、安装PHP Extensions :
freebsd# cd /usr/ports/lang/php5-extensions
freebsd# make config
选择:MYSQL、PCRE、POSIX、SESSION。
freebsd# make install clean
安装后要重起apache
freebsd# apachectl restart
5、安装zend
freebsd# fetch
http://downloads.zend.com/optimizer/2.5.10/ZendOptimizer-2.5.10a-freebsd4.3-i386.tar.gz
freebsd# tar zxvf ZendOptimizer-2.5.10a-freebsd4.3-i386.tar.gz
freebsd# cd ZendOptimizer-2.5.10a-freebsd4.3-i386
feeebsd# ./install.sh
freebsd# grep -v "#" httpd.conf.bak > httpd.conf
附1、安装phpmyadmin
freebsd#cp /usr/src/ecorpmail/source/phpmyadmin.tar.gz /usr/local/www/data/
freebsd#tar zxvf phpmyadmin.tar.gz
freebsd#ee config.inc.php
修改$cfg['Servers'][$i]['password']      = '******';
就可以用phpmyadmin在web界面来管理mysql了。
附2、安装phpSysInfo
freebsd#cd /usr/ports/www/phpSysInfo
freebsd#make install
freebsd#cd /usr/local/www/data/phpSysInfo
freebsd#cp config.php.new config.php
freebsd#apachectl restart
安装完成后可以查看服务器的信息。
附3、设置Apache用户验证:
freebsd#ee /usr/local/etc/apache/httpd.conf
加入:
Alias /mrtg "/usr/local/www/data/mrtg"
    AuthType Basic
    AuthName "This is a private directory. Please Login:"
    AuthUserFile /usr/local/www/data/.passwd
    Require user lingfeng
freebsd#htpasswd -c /usr/local/www/data/.passwd lingfeng
New password:
Re-type new password:
freebsd#apachectl restart
附4、设置Apache虚拟主机:
freebsd#ee /usr/local/etc/apache/httpd.conf
在最后加入:
NameVirtualHost *:80
    ServerAdmin
master@lingfeng.cn
    DocumentRoot /usr/local/www/data/lingfeng
    ServerName
www.lingfeng.cn
    ServerAdmin
master@lingfeng.cn
    DocumentRoot /usr/local/www/data/webmail
    ServerName mail.lingfeng.cn
freebsd#apachectl restart

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:freebsd下ping脚本

下一篇:FreeBSD下zebra安装及配置