LoginSignup
0

More than 5 years have passed since last update.

Dockerでubuntu bashを起動してnginxを起動するまで(失敗編)

Posted at
  • dockerコマンドでubuntuを起動
    $ docker run -it ubuntu bash

  • ubuntuが起動する

/etc/os-release
root@xxxxxxxxxx:/# cat /etc/os-release 
NAME="Ubuntu"
VERSION="16.04 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
  • apt-get update
    # apt-get update

  • nginxのインストール
    # apt-get install nginx

  • vimのインストール
    # apt-get install vim

  • nginx.confの編集
    # vim /etc/nginx/nginx.conf

  • nginxの起動
    # service nginx start

 * Starting nginx nginx                                        [ OK ] 
  • プロセス確認 # ps -ef | grep nginx
root       825     1  0 06:00 ?        00:00:00 nginx: master process /usr/sbin/nginx
www-data   826   825  0 06:00 ?        00:00:00 nginx: worker process
www-data   828   825  0 06:00 ?        00:00:00 nginx: worker process
www-data   829   825  0 06:00 ?        00:00:00 nginx: worker process
www-data   830   825  0 06:00 ?        00:00:00 nginx: worker process
root       837     1  0 06:03 ?        00:00:00 grep --color=auto nginx
  • browser 起動したけどブラウザで見るための起動オプションをつけなかったのでブラウザで確認できなかった。 →やり直し

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0