Ubuntu Server 10.10版安装LNMP终极安装日记+排错记录[服务器安全]
本文“Ubuntu Server 10.10版安装LNMP终极安装日记+排错记录[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
首先在Ubuntu Server 10.10安装以下文件,安装不用多讲了:
apt-get install mysql
apt-get install php5-mysql
apt-get install nginx
apt-get install php5-cgi
apt-get install spawn-fcgi
apt-get install vsftpdfast-cgi的安装:
root@Ubuntu:/var/www/nginx-default# /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 15 -u nginx -g nginx -f /usr/bin/php-cgi
spawn-fcgi: child spawned successfully: PID: 3042
root@Ubuntu:/var/www/nginx-default# netstat -an|grep 9000
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
改正nginx的配置文件:
root@Ubuntu:/# vim /etc/nginx/nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
#----------------------------------------------------------------------
# Events Module
#
# http://wiki.nginx.org/NginxHttpEventsModule
#
#----------------------------------------------------------------------
events {
worker_connections 1024;
}
#----------------------------------------------------------------------
# HTTP Core Module
#
# http://wiki.nginx.org/NginxHttpCoreModule
#
#----------------------------------------------------------------------
http {
include /etc/nginx/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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /var/www/html;
index index.html index.htm index.php;
}
error_page 404 /404.html;
location = /404.html {
root /var/www/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
}接下来VSftpd的配置:
1.增添用户:
useradd –d /var/www/html face
2.改变网站目录权限:
chown –R face /var/www/html
chmod 755 /var/www/html #这一步最好看一下,比方我改成777的时刻反而会无法上传!
3.vim /etc/vsftpd.conf
local_umask=022 #这行要注释掉
phpmyadmin的问题汇总:
无法加载 mcrypt (外链,英语) 扩大,请查抄您的 PHP 配置.
问题办理
1.安装apt-get install php5-mcrypt
2.编辑php配置文件vim /etc/php5/cgi/php.ini找到mcrypt并在下面增添红色行:
[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=
mcrypt.algorithms_dir=/etc/bash_completion.d/mcrypt
3.增添完成后注意要重启fast-cgi:
root@Ubuntu:/# killall -9 php-cgi
root@Ubuntu:/# /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 20 -u nginx -g nginx -f /usr/bin/php5-cgi短语密码配置.
问题办理
配置文件目前需求一个短语密码$cfg['blowfish_secret'] = ‘malu’;
将phpmyadmin/libraries/config.default.php 中的
$cfg['blowfish_secret'] = ”; 改成 $cfg['blowfish_secret'] = ‘malu’;
注:此中的’malu’为随便的字符.
链接表的附加功效还没有激活.
问题办理
1.利用phpMyAdmin的导入功效导入scripts文件夹中的create_tables.sql文件.
2.改正config.inc.php文件,在此中增添:
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'malu';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
以上是“Ubuntu Server 10.10版安装LNMP终极安装日记+排错记录[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |