欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
FreeBSD Lighttpd PHP MySQL
第81行: | 第81行: | ||
“mod_access”, | “mod_access”, | ||
+ | |||
“mod_fastcgi”, | “mod_fastcgi”, | ||
+ | |||
“mod_accesslog” ) | “mod_accesslog” ) | ||
第87行: | 第89行: | ||
fastcgi.server = ( “.php” => | fastcgi.server = ( “.php” => | ||
+ | |||
( “localhost” => | ( “localhost” => | ||
+ | |||
( | ( | ||
+ | |||
“socket” => “/tmp/php-fastcgi.socket”, | “socket” => “/tmp/php-fastcgi.socket”, | ||
+ | |||
“bin-path” => “/usr/local/bin” ))) | “bin-path” => “/usr/local/bin” ))) | ||
测试: | 测试: | ||
+ | |||
touch test.php | touch test.php | ||
+ | |||
phpinfo(); | phpinfo(); | ||
+ | |||
?> | ?> | ||
# /usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf | # /usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf | ||
+ | |||
或者 | 或者 | ||
+ | |||
Usage: /usr/local/etc/rc.d/lighttpd [fast|force|one](start|stop|restart|rcvar|status|poll) | Usage: /usr/local/etc/rc.d/lighttpd [fast|force|one](start|stop|restart|rcvar|status|poll) | ||
+ | |||
http://localhost/test.php | http://localhost/test.php | ||
+ | |||
OK :) | OK :) | ||
———————————— | ———————————— | ||
在 FreeBSD 6.1 上安装 Lightttpd,PHP, MySQL 过程异常简单 | 在 FreeBSD 6.1 上安装 Lightttpd,PHP, MySQL 过程异常简单 | ||
+ | |||
1. install mysql 5 | 1. install mysql 5 | ||
+ | |||
# cd /usr/ports/databases/mysql5-server | # cd /usr/ports/databases/mysql5-server | ||
+ | |||
# make install | # make install | ||
+ | |||
后面步骤同上 | 后面步骤同上 | ||
+ | |||
2. install php5 | 2. install php5 | ||
+ | |||
下载ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/php-5.1.2.tar.bz2 | 下载ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/php-5.1.2.tar.bz2 | ||
+ | |||
后面步骤同上 | 后面步骤同上 | ||
+ | |||
3. bind php5 and mysql (mysql的库加载成功) | 3. bind php5 and mysql (mysql的库加载成功) | ||
+ | |||
cd /usr/ports/databases/php5-mysql | cd /usr/ports/databases/php5-mysql | ||
+ | |||
make | make | ||
+ | |||
make install | make install | ||
+ | |||
4. install lighttpd (同上) | 4. install lighttpd (同上) |
2006年7月16日 (日) 21:13的版本
在 FreeBSD 5.5, 6.1 上安装 Lightttpd,PHP,MySQL
今天在一台跑 FreeBSD 5.5 的 Intel 至强服务器上成功安装 MySQL,PHP,Lighttpd等软件包, 现整理如下与大家分享. 随后还有在FreeBSD 上 Java 系统的安装等. (注意: 在FreeBSD下有 Packages , Ports 两种安装软件包的方式供用户选择)
1. install mysql 4.1 mysql41-client // version is 4.1.18
pkg_add -r mysql41-server
pkg_add -r mysql41-client
/usr/local/bin/mysql_install_db
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
/usr/local/bin/mysqld_safe -user=mysql &
/usr/local/bin/mysqladmin -u root password ‘newpassword’
2. install php4,并support fastcgi
cd /usr/ports/distfiles
fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/php-4.4.2.tar.bz2
or http://download.freelamp.com/LAMP/
bunzip2 php-4.4.2.tar.bz2
tar xvf php-4.4.2.tar
./configure –enable-fastcgi –enable-force-cgi-redirect
make
make install
— php -v
PHP 4.4.2 (cgi-fcgi) (built: Jun 23 2006 01:26:36) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
3. bind php4 and mysql (这步有问题,mysql的库总加载不上)
cd /usr/ports/databases/php4-mysql
make
make install
The following line has been added to your /usr/local/etc/php/extensions.ini
configuration file to automatically load the installed extension:
extension=mysql.so
4. install lighttpd
pkg_add -r lighttpd
touch /var/log/lighttpd.error.log
touch /var/log/lighttpd.access.log
chown www:www /var/log/lighttpd.*
config php.ini, lighttpd.conf
- cd /usr/local/etc/
- cp lighttpd.conf.sample lighttpd.conf
- cp php.ini-recommended php.ini
修改 lighttpd.conf
server.modules = (
“mod_access”,
“mod_fastcgi”,
“mod_accesslog” )
server.document-root = “/usr/local/www/demo/”
fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/usr/local/bin” )))
测试:
touch test.php
phpinfo();
?>
- /usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf
或者
Usage: /usr/local/etc/rc.d/lighttpd [fast|force|one](start|stop|restart|rcvar|status|poll)
OK :)
———————————— 在 FreeBSD 6.1 上安装 Lightttpd,PHP, MySQL 过程异常简单
1. install mysql 5
- cd /usr/ports/databases/mysql5-server
- make install
后面步骤同上
2. install php5
下载ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/php-5.1.2.tar.bz2
后面步骤同上
3. bind php5 and mysql (mysql的库加载成功)
cd /usr/ports/databases/php5-mysql
make
make install
4. install lighttpd (同上)