deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free deb http://www.deb-multimedia.org stable main non-free deb http://packages.dotdeb.org squeeze all deb-src http://packages.dotdeb.org squeeze all deb http://nginx.org/packages/debian/ squeeze nginx deb-src http://nginx.org/packages/debian/ squeeze nginx
apt-get update && apt-get install deb-multimedia-keyring wget http://www.dotdeb.org/dotdeb.gpg -O- |apt-key add - gpg --keyserver hkp://keys.gnupg.net --recv-keys ABF5BD827BD9BF62 gpg -a --export 7BD9BF62 | apt-key add -
apt-get update && apt-get upgrade
apt-get install -t squeeze-backports linux-image-3.2.0-0.bpo.3-amd64
reboot
apt-get install nginx php5-cli php5-common sqlite php5-sqlite php5-suhosin php5-cgi php5-fpm\ fcgiwrap mysql-server php5-mysql php5-gd php5-apc memcached php5-memcached siege
mkdir /var/www mkdir /var/log/nginx/ chmod -R a-rwx,u+rwX,g+rX /var/www && chown www-data:www-data -R /var/www # mkdir /tmp/fcgi-cache/ chown www-data:www-data -R /tmp/fcgi-cache/
# nginx user www-data; # worker_processes 4; pid /var/run/nginx.pid; worker_rlimit_nofile 8192; events { # worker- worker_connections 1024; # , Linux 2.6+ use epoll; } http { ## # # FastCGI , ram fastcgi_cache_path /tmp/fcgi-cache/ levels=1:2 keys_zone=one:10m; # sendfile, , , # sendfile sendfile on; # #output_buffers 32 512k; # # sendfile_max_chunk 128k; # postpone_output 1460; # . server_names_hash_bucket_size 64; # post client_max_body_size 15m; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # nginx server_tokens off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # gzip on; gzip_disable "msie6"; ssi on; ## # include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }
mkdir /etc/nginx/sites-enabled mkdir /etc/nginx/sites-available mkdir /etc/nginx/templates mkdir /var/www/htdocs
# ( ) ## index index.html index.php; # "" Drupal ( CMS) location / { try_files $uri $uri/ /index.php?q=$uri&$args; } # .htaccess .htpassword location ~ /\.ht { deny all; } location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; }
# PHP- PHP-FPM location ~ \.php$ { try_files $uri =404; #PHP-FPM Unix fastcgi_pass unix:/tmp/wwwpool.sock; # cache one fastcgi_cache one; # , 3- . # fastcgi_cache_min_uses 3; # fastcgi_cache_valid 200 301 302 304 5m; # - nginx fastcgi_cache_key "$request_method|$host|$request_uri"; # - # fastcgi_hide_header "Set-Cookie"; # nginx # fastcgi_ignore_headers "Cache-Control" "Expires"; fastcgi_index index.php; # fastcgi_intercept_errors on; # # /etc/nginx/fastcgi_param include fastcgi_params; # , php-fpm fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_ignore_client_abort off; }
# pl cgi location ~ \.(pl|cgi)$ { # gzip off; try_files $uri =404; # fcgiwrap fastcgi_pass unix:/var/run/fcgiwrap.socket; # include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_ignore_client_abort off; } # ScriptAlias location /cgi-bin/ { gzip off; try_files $uri =404; root /var/www/; fastcgi_pass unix:/var/run/fcgiwrap.socket; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_ignore_client_abort off; }
location /phpmyadmin { root /var/www/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /var/www/; fastcgi_pass unix:/tmp/wwwpool.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /var/www/; } }
cgi.fix_pathinfo=0
server { # (, ) root /var/www/htdocs/; # , - access_log /var/log/nginx/default-access.log; error_log /var/log/nginx/default-error.log; # , . include /etc/nginx/templates/default; include /etc/nginx/templates/php; include /etc/nginx/templates/phpmyadmin; include /etc/nginx/templates/perlcgi; }
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/000-default
rm /etc/nginx/conf.d/default
service nginx reload
<?php phpinfo(); ?>
chmod 755 /var/www/htdocs/test.php && chown www-data:www-data /var/www/htdocs/test.php
#!/usr/bin/perl -w print "Content-type: text/html\n\n"; print "<html><head><title>Hello World!! </title></head>\n"; print "<body><h1>Hello world</h1></body></html>\n";
chmod 755 /var/www/htdocs/test.cgi && chown www-data:www-data /var/www/htdocs/test.cgi
location / { try_files $uri $uri/ /index.php?q=$uri&$args; }
# , , , . ;listen = 127.0.0.1:9000 listen = /tmp/wwwpool.sock # , .. # PHP-FPM pm = dynamic # . pm.max_children = 7 # , . .. # , 1, pm.start_servers = 3 # . # pm.start_servers = pm.min_spare_servers. pm.min_spare_servers = 3 # . , pm.max_children # pm.min_spare_servers. . pm.max_spare_servers = 4 # , "" request_slowlog_timeout = 3s # "" ( , request_slowlog_timeout) slowlog = /var/log/php-slow.log
listen = 127.0.0.1:9000
listen = 127.0.0.1:9001
listen = /tmp/newpool.sock
service php5-fpm restart
wget http://dl.cihar.com/phpMyAdmin/master/phpMyAdmin-master-latest.tar.gz
tar -xzf phpMyAdmin-master-latest.tar.gz -C /var/www/ mv /var/www/phpMyAdmin-master- /var/www/phpmyadmin chown www-data: /var/www/phpmyadmin -R
cp /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php nano /var/www/phpmyadmin/config.inc.php
$cfg['blowfish_secret'] = 'e%o$fd3}tC9[HxY_$zY+dxstdsZ[i*JG]#GHt]alv' $cfg['Servers'][$i]['auth_type'] = 'http'; $cfg['Servers'][$i]['controluser'] = 'pma'; $cfg['Servers'][$i]['controlpass'] = 'DZMkI4vZ1'; // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; $cfg['Servers'][$i]['relation'] = 'pma_relation'; $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; $cfg['Servers'][$i]['history'] = 'pma_history'; $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; $cfg['SuhosinDisableWarning'] = 'true';
mysqladmin -p create phpmyadmin mysql -p CREATE USER 'pma'@'localhost' IDENTIFIED BY 'DZMkI4vZ1'; GRANT ALL ON phpmyadmin.* TO 'pma'@'localhost'; exit;
mysql -p phpmyadmin < /var/www/phpmyadmin/examples/create_tables.sql
Source: https://habr.com/ru/post/164401/
All Articles