LNMP展開サーバー

はじめに:オンラインの展開プロジェクト

1、サーバー上のプロジェクトのコードは、この場所は、ここでは、さまざまなオプション(整頓することにより、次回のために外観を)持っているコードを管理するためにSVNを使用することを選択します

  • 自分の環境LNMP個別にインストールすることができ、あなたはまた、キーのインストールを見つけることができます
  • ビルドにSVNは、サーバー上のコードのリポジトリのバージョンSVNコード、ローカルプロジェクトコードA、B、3つのバージョンがあることに注意して、サーバC上のオンラインアクセスコードは、私を得た原理は、更新にB、Cにアップロードし、維持するために、 Bと同期

2は、configure nginxの

server
    {
        listen 8083;#监听端口号
        server_name  _;#域名
        index index.html index.htm index.php;#默认打开文件
        root  /home/wwwroot/smartcloud/public;#网站根目录

        #定义变量
        set $root /home/wwwroot/smartcloud/public;

        location ~ [^/]\.php(/|$)
        {
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            #设置PATH_INFO
            fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
            fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
            #引入fastcgi配置
            include fastcgi.conf;
        }

        #从URL中去掉index.php入口文件
        location /
        {
            if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?s=/$1  last;
                break;
            }
        }

        #error_page   404   /404.html;
        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
        include enable-php.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/access.log;
    }

図3に示すように、発生する可能性のあるシステムの問題

  • 禁断のアクセス:アクセスが拒否されました
    • ソリューション:オープンphp.iniの以下のcgi.fix_pathinfo = 0 1に保存して終了のリブートLNMP
  • サーバー500
    • 解決策:ONにphp.iniのはdisplay_errors =オフを入れて保存し、終了のリブートLNMP
  • open_basedirのエラー
    • 解決策:最後の行アウトnginxの/ confに/ fastcgi.confファイルの下のコメントを見つけます
  • エラーが、その後、stream_socket_server無効を開始する場合ワークマンの問題が生じる可能性があります
    • 削除されたphp.iniの最後stream_socket_serverのdisable_functionsへのソリューション

4.データベースのインポート

  • 最初のMySQLデータベースのMySQLに外部ネットワークまたは直接導入にアクセスするように構成
  • データベースポートのファイアウォール設定
  • 読み取り専用のアカウントを作成します。
	进入sql修改
    grant all privileges on *.* to '用户名'@'%' identified by '密码' with grant option;
	创建只读用户
	GRANT select ON *.* to 'read_user'@'%' identified by 'apld#$%666';
	创建所有权限
	GRANT all privileges ON *.* to 'root'@'%' identified by '746382';
	刷新权限
	flush privileges;
  • この新しい接続、アカウントデータベースを使用してインポートおよびエクスポート操作

図5に示すように、そのようなランタイムなどのランタイムディレクトリ所与777の権限の数に

6は、再び実行し、展開を成功した後、スクリーン内部にプロジェクトサイトを維持することをお勧めします

公開された13元の記事 ウォンの賞賛1 ビュー1945

おすすめ

転載: blog.csdn.net/qq_37029718/article/details/105067957