Windows環境でのredis、nginx、mysqlの設定

Redisのバックグラウンド構成

1. DOS ウィンドウに入る

2. Redis のインストール ディレクトリを入力します。

3. 入力: redis-server --service-install redis.windows.conf --loglevelverbose (redis サービスのインストール)

4. 「redis-server --service-start (サービスの開始)」と入力します。

5. 「redis-server --service-stop (サービスの停止)」と入力します。

nginxのバックグラウンド設定

1 winsw ツール
Windows Service Wrapper ガジェットをダウンロードします: https://github.com/winsw/winsw/releases

2 ツールのインストールと使用
ステップ 1: ダウンロード後、ツールを Nginx インストール ディレクトリに置き、名前を nginx-service.exe に変更します;
ステップ 2: nginx インストール ディレクトリに新しいサービス ログ フォルダを作成します。 nginx サービス関連のログを保存します。
ステップ 3: このディレクトリに新しい nginx-service.xml ファイルを作成し、設定情報を書き込みます。設定後、これを通じて Nginx を Windows サービスとして登録できます。
ファイル構成の内容は、ログファイルの場所、起動コマンド、終了コマンドの3点がポイントで、猫を追って虎を描くだけです。

<!-- nginx-service.xml -->
<service>
    <id>nginx</id>
    <name>nginx</name>
    <description>nginx</description>
    <logpath>D:\work\nginx\nginx -1.18.0\server-logs\</logpath>
    <logmode>roll</logmode>
    <depend></depend>
    <executable>D:\work\nginx\nginx-1.18.0\nginx.exe</executable >
    <stopexecutable>D:\work\nginx\nginx-1.18.0\nginx.exe -s stop</stopexecutable>
</service>
3 Windows サービスに登録します
。 上記の内容を設定したら、nginx インストールの下で管理します。ディレクトリ スタッフはコマンド .\nginx-service.exe install を実行して、Windows サービスとして正常に登録します。現時点では、Windows タスク マネージャーのサービスで nginx サービスを表示できます。サービスを右クリックして実行、停止、再起動できるほか、タスクマネージャーから直接操作することもできます。サービスを右クリックし、スタートアップの種類が自動かどうかを確認します。通常は自動です。自動であれば、自動的に開始されます。

おすすめ

転載: blog.csdn.net/jiulinghouxiao/article/details/130088437