LoginSignup
5
6

More than 5 years have passed since last update.

nginxをyumでインストールして、bootstrapもインストールする

Posted at

完全に個人資料です

リポジトリのダウンロード

# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

nginxのインストール

# yum install nginx

nginxを起動

# /etc/init.d/nginx start

動作確認

# curl http://localhost                                                                                                                  
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

bootstrapのインストール

bootstrapのダウンロード

wget https://github.com/twbs/bootstrap/releases/download/v3.2.0/bootstrap-3.2.0-dist.zip

取得したファイルをサーバに転送

# unzip [転送したファイル]
   creating: bootstrap-3.2.0-dist/
   creating: bootstrap-3.2.0-dist/css/
  inflating: bootstrap-3.2.0-dist/css/bootstrap-theme.css  
  inflating: bootstrap-3.2.0-dist/css/bootstrap-theme.css.map  
  inflating: bootstrap-3.2.0-dist/css/bootstrap-theme.min.css  
  inflating: bootstrap-3.2.0-dist/css/bootstrap.css  
  inflating: bootstrap-3.2.0-dist/css/bootstrap.css.map  
  inflating: bootstrap-3.2.0-dist/css/bootstrap.min.css  
   creating: bootstrap-3.2.0-dist/fonts/
  inflating: bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.eot  
  inflating: bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.svg  
  inflating: bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.ttf  
  inflating: bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.woff  
   creating: bootstrap-3.2.0-dist/js/
  inflating: bootstrap-3.2.0-dist/js/bootstrap.js  
  inflating: bootstrap-3.2.0-dist/js/bootstrap.min.js 

ディレクトリをリネーム

# mv bootstrap-3.2.0-dist bootstrap

とりあえず、テンプレ的なものを放り込む

cat << '_EOT_' > /usr/share/nginx/html/bootstrap/index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <h1>Hello, world!</h1>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>
_EOT_
5
6
0

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
5
6