lighttpd+php+mysql+openssl
FreeBSD 下Web环境的构建.
1 安装MySQL
这里是自己使用源码编译安装。
需要下载MySQL-4.0.25源码包。
cd /opt/distfiles
wget xxx
tar -zxvf mysql-4.0.25.tar.gz -C src
cd src/mysql-4.0.25/
./configure ?prefix=/opt/modules/mysql
?enable-assembler
?with-mysqld-ldflags=-all-static
?with-charset=gb2312
?without-debug
make
make install
/opt/modules/mysql/bin/mysql_install_db
chown -R mysql.mysql /opt/modules/mysql/var
chgrp mysql /opt/modules/mysql
2 安装PHP
./configure
?prefix=/opt/modules/phpcgi
?enable-fastcgi
?enable-force-cgi-redirect
?enable-bcmath
?enable-inline-optimization
?enable-magic-quotes
?enable-wddx?disable-debug
?enable-sysvmsg
?enable-sockets
?enable-mbstring
?enable-calendar
?with-trans-sid
?with-ldap
?with-ldap-sasl
?with-mysql=/opt/modulels/mysql
3 安装lighttpd
cd /usr/ports/www/lighttpd/
make install clean
执行后,将会提示一些选项只要选中OPENSSL 就可以了,其他的不用选。
4 整合配置
4.1 修改默认网站文件路径
server.document-root = “/opt/data/www/”
4.2 打开fastcgi模块支持
将 #”mod_fastcgi”, 的#去掉
4.3 设定PHP支持
#### fastcgi module
## read fastcgi.txt for more info
fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/opt/modules/phpcgi/bin/php”,
# 如果你的网站很繁忙,可以加入如下设置
#”bin-environment” => (
# “PHP_FCGI_CHILDREN” => “16″,
# “PHP_FCGI_MAX_REQUESTS” => “10000″
#)
#”bin-path” => “/usr/local/bin/php”
)))
4.4 创建日志文件及设置权限
touch /var/log/lighttpd.error.log
touch /var/log/lighttpd.access.log
chown www:www /var/log/lighttpd.*
4.5 设置SSL支持
4.5.1 创建证书
cd /opt/etc/
openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
4.5.2 打开SSL支持
#### SSL engine
ssl.engine = “enable”
ssl.pemfile = “/opt/etc/server.pem”
4.6 设置监听端口
默认的监听端口是 80,如果需要更改端口,可以修改配置设定。
## bind to port (default: 80)
#server.port = 81
5 启动
5.1 设置自动启动
vi /etc/rc.conf
lighttpd_enable=”YES”
5.2 手工启动
/usr/local/etc/rc.d/lighttpd.sh start
注意,如果没有在/etc/rc.conf添加 /etc/rc.conf ,是不能启动的。所以需要先添加。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio
