阿里云服务器PHP5.5.9+Ubuntu4.14+nginx,Ajenti控制面板,架设Drupal8环境

admin的头像

由于drupal8的PHP5.5.9的最低要求,在购买了阿里云的服务器后,曾尝试了几个免费的服务器环境,最后,在百度很多篇文章后,决定用Ajenti这个开源免费的服务器控制面板,架设适用于drupal8的运行环境。

首先,购买后,我们获得了root及终极后台密码。

下载putty0.65汉化版,解压缩,运行软件,输入我们获得的阿里云服务器IP,端口22,选择SSH连接,点击打开,输入root及密码后,敲击以下代码:

 sudo apt-get update
等待更新后,敲击以下代码:

 wget -O- https://raw.github.com/ajenti/ajenti/1.x/scripts/install-ubuntu.sh | sudo sh
 

 一步步仔细观看

完成。

具体的帮助信息在https://support.ajenti.org/forums/5-kb/topics/1121-installing-on-ubuntu/

nginx配置信息添加以下代码:

 

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    # Very rarely should these ever be accessed outside of your lan
    location ~* \.(txt|log)$ {
        allow 192.168.0.0/16;
        deny all;
    }

    location ~ \..*/.*\.php$ {
        return 403;
    }

    location ~ ^/sites/.*/private/ {
        return 403;
    }

    # Block access to "hidden" files and directories whose names begin with a
    # period. This includes directories used by version control systems such
    # as Subversion or Git to store control files.
    location ~ (^|/)\. {
        return 403;
    }

    location / {
        # try_files $uri @rewrite; # For Drupal <= 6
        try_files $uri /index.php?$query_string; # For Drupal >= 7
    }

    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
    }

    # Fighting with Styles? This little gem is amazing.
    # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
    location ~ ^/sites/.*/files/styles/ { # For Drpal >= 7
        try_files $uri @rewrite;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }
  

建立一个网站后,将以上nginx代码添加到“高级” “自定义配置”里;(重要)

另外在“内容”菜单里添加PHP规则“PHP fastCGI”(重要)

至此,安装环境配置完毕。

下一篇文章中,我们将写到“如何在Ajenti”面板下创建一个网站及注意事项;

下一篇文章中,我们将写到“在Ajenti”面板下,如何修改php.ini;

下一篇文章中,我们将写到,为了保证drupal8的运行效率,我只安装的几个必要模块

like0
0 points
向上
down