1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

Ubuntu低内存VPS架设Nginx+Php-Fpm+MariaDB+phpMyAdmin

本帖由 SHARED2014-02-16 发布。版面名称:应用交流

  1. SHARED

    SHARED VIP会员

    注册:
    2013-05-30
    帖子:
    37
    赞:
    9
    在lowendbox上看到一篇文章,讲的是如何在低内存的ubuntu上架设Nginx+Php-Fpm+MariaDB
    觉得不错收录下来,后面phpMyAdmin原文中是没有的。当然你还可以自行安装vsftpd。

    安装步骤如下:

    一、安装配置NGINX和PHP-FPM
    代码:
    sudo apt-get update
    sudo apt-get purge apache2* libapache2*
    sudo apt-get install nginx php5-fpm php5-mcrypt php5-curl
    打开 /etc/nginx/sites-available/default 文件看到如下内容
    代码:
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ .php$ {
    # fastcgi_split_path_info ^(.+.php)(/.+)$;
    # # NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini
    #
    # # With php5-cgi alone:
    # fastcgi_pass 127.0.0.1:9000;
    # # With php5-fpm:
    # fastcgi_pass unix:/var/run/php5-fpm.sock;
    # fastcgi_index index.php;
    # include fastcgi_params;
    #}
    修改为
    代码:
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ .php$ {
    fastcgi_split_path_info ^(.+.php)(/.+)$;
    # NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini
    
    # # With php5-cgi alone:
    # fastcgi_pass 127.0.0.1:9000;
    # With php5-fpm:
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    }
    打开 /etc/php5/fpm/pool.d/www.conf 文件

    代码:
    listen = 127.0.0.1:9000
    修改为
    代码:
    listen = /var/run/php5-fpm.sock
    之后重启php5-fpm和nginx
    代码:
    sudo service php5-fpm restart
    sudo service nginx restart
    二、安装配置MariaDB
    代码:
    sudo apt-get install python-software-properties
    sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
    sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main'
    如果上面执行出现错误,请访问官网查找正确的命令。
    网站名称:MariaDB.org
    网站地址:https://downloads.mariadb.org/mariadb/repositories
    代码:
    sudo apt-get update
    sudo apt-get install mariadb-server php5-mysql
    返回的信息中会出现下面命令行中的版本提示「10.0.7」
    代码:
    sudo apt-get install mariadb-server libmysqlclient18=10.0.7+maria-1~precise mysql-common=10.0.7+maria-1~precise php5-mysql
    重启php5-fpm
    代码:
    sudo service php5-fpm restart
    三、安装配置phpMyAdmin
    代码:
    sudo apt-get install phpmyadmin
    之后选择lighttpd
    安装完成后执行
    代码:
    sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/www
    四、nginx配置
    phpMyAdmin安装成功后你访问的话会出现403错误
    我们需要对nginx进行配置才能访问
    编辑 /etc/nginx/sites-available/default
    在server{}中添加
    代码:
    location /phpmyadmin/ {
    alias /usr/share/nginx/www/phpmyadmin/;
    index index.php;
    }
    我这里把WORDPRESS程序放在根目录/usr/share/nginx/www中了
    以此为例配置一下域名
    假使域名是 shared.cc
    在server{}中添加找到
    #listen 80; 去掉前面的#
    代码:
    listen 80;
    找到index index.html index.htm;
    添加修改为
    代码:
    index index.html index.php index.htm;
    找到server_name行修改为
    代码:
    server_name shared.cc www.shared.cc;
    修改
    代码:
    location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to index.html
    try_files $uri $uri/ index.html;
    # Uncomment to enable naxsi on this location
    # include /etc/nginx/naxsi.rules
    }
    为(该规则适用于Wordpress)
    代码:
    location / {
    if (-d $request_filename){ rewrite ^/(.*)([^/])$ $1$2/ permanent; }
    if (-f $request_filename/index.html){ rewrite (.*) $1/index.hrml break; }
    if (-f $request_filename/index.php){ rewrite (.*) $1/index.php;}
    if (!-f $request_filename){ rewrite (.*) /index.php;}
    }
    五、重启NGINX
    代码:
    sudo service nginx restart
    转自分享地
    http://shared.cc/ubuntu-nginx-php-fpm-mariadb-phpmyadmin.html
     
    已获得 admin 的点赞。
  2. Audrey

    Audrey 入门会员

    注册:
    2018-11-06
    帖子:
    2
    赞:
    0
    What are the main parameters of the transformer? Different types of transformers have corresponding parameters, the main parameters are : voltage ratio, operating frequency, rated voltage, rated power, no-load current, no-load loss, insulation resistance and moisture resistance; magnetic shielding and electrostatic shielding, efficiency, etc. ( 1 ) Rated voltage This parameter refers to the voltage applied on the primary winding of the transformer and the voltage applied on the primary winding of the transformer at normal operation shall not be greater than the specified value. ( 2 ) the ratio of the primary and secondary voltage of transformer to transformer is called the ratio of transformer. The transformer ratio is divided into no-load and load transformer ratio. Generally speaking, the ratio of the transformer to no-load is greater than that of the load. The nominal value given by the manufacturer refers to the load transformer ratio under the rated load condition. ( 3 ) Frequency characteristic frequency characteristic refers to the transmission capability of the transformer to different frequency components of the transmission signal. At the low end of the frequency, the inductance of the primary coil is related to the inductance of the primary coil, and the smaller the inductance of the primary coil is, the greater the loss of the low frequency component is, the smaller the range; at the high end of the frequency, the leakage inductance of the transformer is concerned, and the greater the feeling, the greater the loss of high-frequency components in the signal, the smaller the amplitude. In order to reduce the leakage inductance, the transformer can adopt the no-leakage inductance winding method. ( 4 ) When the efficiency of the transformer is rated, the ratio of the output power of the transformer to the power of the transformer is called the efficiency of the transformer. The efficiency of the transformer is related to the material used, such as wire core or core material of enameled wire. The materials used are suitable, and the copper loss and iron loss of the instrument can be greatly reduced, thereby improving the efficiency ( 5 ) The rated power rating refers to the frequency specified by the transformer the output power of the secondary side at the rate and voltage for a long time without exceeding the specified temperature rise. ( 6 ) Insulation resistance This parameter represents the insulation between the coils of the transformer and between the coils and the core. The insulation resistance is related to the performance, temperature and humidity of the insulation material used. ( 7 ) When the secondary side of the no-load loss transformer is open, the power loss measured at the primary side is the no-load loss. ( 8 ) When the secondary winding of the transformer is open-circuit, there is still a certain current in the secondary winding, which is called no-load current. No-load current consists of magnetizing current ( generating magnetic flux ) and iron loss current ( caused by core loss ). For 50 Hz power transformer, the no-load current is basically equal to the magnetizing current.

    This article is from ALLICDATA ELECTRONICS LIMITED.
     
正在加载...