Gentoo emerge安装nginx+php+mysql

Standard
yemaosheng.com # nano /etc/portage/package.use
dev-lang/php cli cgi ctype mysql mysqli mssql pdo gd curl xml hash json soap sockets snmp
www-servers/nginx fastcgi ssl status
media-gfx/imagemagick jpeg png
yemaosheng.com # nano /etc/portage/package.keywords
www-servers/spawn-fcgi ~x86
dev-php5/pecl-memcache ~x86
 
yemaosheng.com # emerge php nginx spawn-fcgi
 
yemaosheng.com # nano /etc/nginx/nginx.conf
  http {
        ...
        ...
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 128k;
        ...
        ...
        server {
                listen          80;
                server_name     localhost;
 
                #access_log     /var/log/nginx/localhost.access_log main;
                #error_log      /var/log/nginx/localhost.error_log info;
 
                root /var/www/localhost/htdocs;
                index index.php index.html;
 
                location ~\.php$ {
                        fastcgi_pass    127.0.0.1:9000;
                        fastcgi_index   index.php;
                        include fastcgi_params;
                        fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs$fastcgi_script_name;
                }
        }
  }
 
yemaosheng.com # spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi
yemaosheng.com # /etc/init.d/nginx start
yemaosheng.com # emerge mysql
yemaosheng.com # ebuild /var/db/pkg/dev-db/mysql-5.0.70-r1/mysql-5.0.70-r1.ebuild config
yemaosheng.com # /etc/init.d/mysql start
yemaosheng.com # nano /etc/conf.d/local.start
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi
yemaosheng.com # rc-update add nginx default
yemaosheng.com # rc-update add mysql default

ps:
APC Memcache Imagick之类的PHP扩展存放在/usr/portage/dev-php5/目录下.
可直接 emerge pecl-apc pecl-imagick pecl-memcache 进行安装.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.