Lighttpd + php + mysql + openssl

Source: Internet
Author: User
Tags configuration settings
Build the Web environment in lighttpd + php + mysql + openssl FreeBSD.

1. install MySQL
Here we will compile and install the SDK using the source code.
You need to download MySQL-4.0.25 source package.

Cd/opt/distfiles
Wget xxx
Tar-zxvf mysql-4.0.25.tar.gz-C src
Mysql-4.0.25/cd src/
./Configure? Prefix =/opt/modules/mysql
? Enable-cycler
? 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. install 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. install lighttpd

Cd/usr/ports/www/lighttpd/
Make install clean

After the command is executed, some options are displayed as long as OPENSSL is selected. other options are not required.

4. integrated configuration

4.1 modify the default website file path
Server.doc ument-root = "/opt/data/www /"

4.2 enable fastcgi module support
Remove # of "mod_fastcgi"

4.3 set PHP support
#### Fastcgi module
# Read fastcgi.txt for more info
Fastcgi. server = (". php" =>
("Localhost" =>
(
"Socket" => "/tmp/php-fastcgi.socket ",
"Bin-path" => "/opt/modules/phpcgi/bin/php ",
# If your website is busy, add the following settings
# "Bin-environment" => (
# "PHP_FCGI_CHILDREN" => "16 ″,
# "PHP_FCGI_MAX_REQUESTS" => "10000 ″
#)

# "Bin-path" => "/usr/local/bin/php"
)))

4.4 create a log file and set permissions

Touch/var/log/lighttpd. error. log
Touch/var/log/lighttpd. access. log
Chown www: www/var/log/lighttpd .*

4.5 set SSL support
4.5.1 create a certificate
Cd/opt/etc/
Openssl req-new-x509-keyout server. pem-out server. pem-days 365-nodes
4.5.2 enable SSL support
#### SSL engine
Ssl. engine = "enable"
Ssl. pemfile = "/opt/etc/server. pem"

4.6 set listening port
The default listening port is 80. if you need to change the port, you can modify the configuration settings.
# Bind to port (default: 80)
# Server. port = 81

5. start
5.1 set automatic start
Vi/etc/rc. conf
Lighttpd_enable = "YES"
5.2 Manual start
/Usr/local/etc/rc. d/lighttpd. sh start
Note: If/etc/rc. conf is not added to/etc/rc. conf, it cannot be started. Therefore, you need to add it first.

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.