国产精品吹潮在线播放,日韩一区二区三区在线播放,啊级免费黄片视频,66av视频

網(wǎng)站首頁
手機(jī)版

FreeBSD7.0編譯安裝nginx+php+mysql

更新時(shí)間:2024-06-01 00:08:08作者:未知

FreeBSD7.0編譯安裝nginx+php+mysql

環(huán)境
系統(tǒng):FreeBSD7.0
軟件:mysql-5.0.51a,nginx-0.6.30,lighttpd-1.4.19,php-5.2.6
所有軟件都安裝到/usr/local/vhost,如果需要請(qǐng)自行修改
一、下載源代碼

cd /usr/ports/databases/mysql50-server/
make fetch

cd /usr/ports/www/nginx-devel/
make fetch

cd /usr/ports/lang/php5
make fetch

cd /usr/ports/www/lighttpd
make fetch

二、編譯安裝
MySQL

cd /usr/ports/distfiles/
tar -jxf mysql-5.0.51a.tar.gz
cd mysql-5.0.51a
./configure --prefix=/usr/local/vhost/mysql --with-charset=utf8 --with-extra-charsets=all --with-big-tables --with-pthread
make &&make install

Nginx

cd /usr/ports/devel/pcre
make install clean

cd /usr/ports/distfiles/
tar -jxf nginx-0.6.30.tar.gz
cd nginx-0.6.30
./configure --prefix=/usr/local/vhost/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_sub_module
make &&make install

Lighttpd
(安裝lighttpd是為了得到啟動(dòng)fastcgi進(jìn)程)

cd /usr/ports/distfiles/
tar -jxf lighttpd-1.4.19.tar.bz2
cd lighttpd-1.4.19
./configure --prefix=/usr/local/vhost/lighttpd

Php

cd /usr/ports/textproc/libxml2
make install clean

cd /usr/ports/ftp/curl
make install clean

cd /usr/ports/graphics/jpeg
make install clean

cd /usr/ports/graphics/png
make install clean

cd /usr/ports/devel/gettext
make install clean

cd /usr/ports/distfiles/
tar -jxf php-5.2.6.tar.bz2
cd php-5.2.6
./configure --prefix=/usr/local/vhost/php --with-mysql=/usr/local/vhost/mysql -enable-fastcgi --enable-sockets --enable-ftp --enable-zip --enable-mbstring --enable-mbregex --enable-calendar --with-curl=/usr/local/clude --with-curlwrappers --disable-debug --enable-inline-optimization --with-zlib --with-gd --with-kerberos --with-gettext --enable-force-cgi-redirect --with-jpeg-dir=/usr/inlocal/clude --with-png-dir=/usr/local/include --with-bz2 --enable-pcntl --with-iconv
make && make install
cp php.ini-dist /usr/local/vhost/php/lib/php.ini

三、配置

MySQL

cd /usr/local/vhost/mysql
pw adduser mysql -d /dev/null -s /sbin/nologin
bin/mysql_install_db
cp share/mysql/mysql.server ./
chmod +x mysql.server
chown -R mysql ./

啟動(dòng)
引用:/usr/local/vhost/mysql/mysql.server start

配置nginx

cd /usr/local/vhost/nginx/
pw adduser webuser -d /dev/null -s /sbin/nologin
cp /usr/local/vhost/lighttpd/bin/spawn-fcgi ./sbin/
rm -rf /usr/local/vhost/lighttpd

vi sbin/php.sh

#!/bin/sh
/usr/local/vhost/nginx/sbin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 8 -u webuser -f /usr/local/vhost/php/bin/php-cgi

引用:chmod +x sbin/php.sh

啟動(dòng)php for fast-cgi
引用:sbin/php.sh

vi conf/enable_php

location ~ /.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/vhost/nginx/html$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
}

vi conf/nginx.conf

user webuser webuser;
worker_processes 1;

events {
worker_connections 4096;
use kqueue;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] $request '
# '"$status" $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
client_max_body_size 5m;

client_header_buffer_size 1k;
large_client_header_buffers 4 4k;

gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;

output_buffers 1 32k;
postpone_output 1460;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
send_lowat 12000;

keepalive_timeout 75 20;

server {
listen 80;
server_name localhost;

location / {
root html;
index index.php index.html index.htm;
}

if (-d $request_filename){
rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
}
location /nginx_status {
stub_status on;
access_log off;
}

include enable_php;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

}
}

測(cè)試配置文件
引用:sbin/nginx -t
2008/05/08 11:50:19 [info] 3336#0: the configuration file /usr/local/vhost/nginx/conf/nginx.conf syntax is ok
2008/05/08 11:50:19 [info] 3336#0: the configuration file /usr/local/vhost/nginx/conf/nginx.conf was tested successfully

vi html/phpinfo.php

<?php
phpinfo();
?>

啟動(dòng)測(cè)試
引用:/usr/local/vhost/nginx/sbin/nginx

在瀏覽器里輸入
引用:http://192.168.29.128/phpinfo.php

安裝配置phpMyadmin

cd /usr/ports/databases/phpmyadmin/
make fetch

cd /usr/ports/distfiles
tar -jxf phpMyAdmin-2.11.6-all-languages.tar.bz2
mv phpMyAdmin-2.11.6-all-languages /usr/local/vhost/nginx/html/dbadmin

此時(shí)MySQL的root沒有密碼,如果一切正??梢杂?br /> http://192.168.29.128/dbadmin/index.php來管理MySQL了

本文標(biāo)簽: 測(cè)試  可以用  所有軟件  

為您推薦

Windows 7任務(wù)欄圖標(biāo)的功能問題解答

Windows 7任務(wù)欄圖標(biāo)的功能問題解答 Windows 7任務(wù)欄圖標(biāo)的功能小白與老牛,小白最近用上了新系統(tǒng)——Windows 7.Windows 7的桌面非

2024-10-06 00:10

Windows 7數(shù)據(jù)備份還原技術(shù)詳細(xì)介紹

Windows 7數(shù)據(jù)備份還原技術(shù)詳細(xì)介紹 曾幾何時(shí),NTFS分區(qū)格式讓Ghost略顯無奈,不過最新的Ghost已經(jīng)支持了NTFS分區(qū),但是在Windows 7

2024-10-06 00:09

windows 7接內(nèi)外網(wǎng)出現(xiàn)沖突解決方法

windows 7接內(nèi)外網(wǎng)出現(xiàn)沖突解決方法 Windows 7雙網(wǎng)卡同時(shí)接內(nèi)外網(wǎng)時(shí), 會(huì)發(fā)生兩個(gè)默認(rèn)網(wǎng)關(guān)沖突的情況,導(dǎo)致兩個(gè)網(wǎng)絡(luò)都不能訪問。 因此解決方法就是只

2024-10-06 00:09

如何使用五種windows密碼設(shè)置 windows密碼怎么設(shè)置

如何使用五種windows密碼設(shè)置 我們?cè)谑褂脁p系統(tǒng)電腦的過程中,難免要與各類密碼打交道,以下九種密碼可能是大家用的最多的:BIOS密碼、安裝密碼、用戶密碼、

2024-10-06 00:08

Windows 7的啟動(dòng)項(xiàng)有哪些?

Windows 7的啟動(dòng)項(xiàng)有哪些? 我們知道,Windows中有自帶的啟動(dòng)文件夾,它是最常見的啟動(dòng)項(xiàng)目,但很多人卻很少注意仔細(xì)檢查它。如果把程序裝入到這個(gè)文件夾

2024-10-06 00:08

WindowsNT技術(shù)簡介(windowsNT的特點(diǎn))

WindowsNT技術(shù)簡介 Windows NT 技術(shù)簡介 NT:New Technoly(新技術(shù),因比DOS、WIN9X采用了很多新技術(shù)而得名) Window

2024-10-06 00:08