0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VirtualBoxのcentosにTomcatをインストールしてサンプルアプリを動かしてみた

0
Posted at

Virtual Boxのcentos7にtomcatを導入したので手順をまとめた。

環境

  • VirtualBox 4.2.12
  • CentOS 7.4.1708
  • tomcat 7.0.76

1.Tomcatインストール

  1. Tomcatがインストールされているか確認

yum list installed | grep tomcat

結果が何も返ってこなければ、インストールされていない
 
2. Tomcat&サンプルページのインストール

    ```bash
yum -y install tomcat

「完了しました!」と表示されればOK

```bash

yum -y install tomcat-webapps

サンプルページ用のファイルを追加
「完了しました!」と表示されればOK
 
3. 動作確認

    ```bash
systemctl start tomcat

Tomcatを起動

```bash

systemctl status tomcat

「Active: active (running)」なら起動している

    ```bash
http://ゲストOSのIPアドレス:8080/

ホストOSのブラウザからアクセスし、猫の画面が表示されればOK

2.サンプルページ確認

  1. サンプルページを確認

「Sample "Hello, World" Application」のページが表示される
該当のプログラムは以下にある

    ```bash
/usr/share/tomcat/webapps/sample

JSPは「hello.jsp」、
Servletは「WEB-INF/classes/mypackage/Hello.class」にクラスファイルがある

3.その他:yumのエラー

Tomcatのインストールで以下のエラーが発生した
[Errno 14] curl#6 - "Could not resolve host:

具体的なメッセージは以下に詳しく記載されている
https://qiita.com/ponsuke0531/items/e036dfa4dd1e69086e13
解決策の参考に調査
http://toriaezu-engineer.hatenablog.com/entry/2017/01/08/095517

最終的にはネットワークを再起動すれば直った。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?