質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

HTTP

HTTP(Hypertext Transfer Protocol)とはweb上でHTML等のコンテンツを交換するために使われるアプリケーション層の通信プロトコルです。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

Q&A

解決済

1回答

3159閲覧

「Testing 123」 の画面を出したい

Masalu_Kudou

総合スコア91

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

HTTP

HTTP(Hypertext Transfer Protocol)とはweb上でHTML等のコンテンツを交換するために使われるアプリケーション層の通信プロトコルです。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

0グッド

1クリップ

投稿2020/08/03 14:27

編集2020/08/06 13:05

お世話になっております。

ちょっとWordpressを触ってみたいなと思い、ちょうど自分のCentOS7のサーバーがあるため、そこにインストールをしようと思いました。
そこで下記のサイトを見ながら、Wordpressのセッティングを始めました。

■ サイト
https://qiita.com/cherubim1111/items/1e1f227a0a495bc14a11

しかし、どういうわけかhttpdをインストール後も、ブラウザにIPアドレスを入力した後、「Testing 123」が表示されず、「このサイトにアクセスできません 〇〇の応答時間が長すぎます」と出てしまいます。

何かfirewallが邪魔しているのかなと、systemctl stop firewalld でファイアーウォールを止めましたが、結果は同じでした。

他に原因として考えられるのはなんでしょうか?お分かりの方、よろしくお願いいたします。

8/6 追記------------------------
【curlの実行結果】

[root@tk2-258-38511 ~]# curl http://127.0.0.1/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Apache HTTP Server Test Page powered by CentOS</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Bootstrap --> <link href="/noindex/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="noindex/css/open-sans.css" type="text/css" />
<style type="text/css"><!-- body { font-family: "Open Sans", Helvetica, sans-serif; font-weight: 100; color: #ccc; background: rgba(10, 24, 55, 1); font-size: 16px; } h2, h3, h4 { font-weight: 200; } h2 { font-size: 28px; } .jumbotron { margin-bottom: 0; color: #333; background: rgb(212,212,221); /* Old browsers */ background: radial-gradient(ellipse at center top, rgba(255,255,255,1) 0%,rgba(174,174,183,1) 100%); /* W3C */ } .jumbotron h1 { font-size: 128px; font-weight: 700; color: white; text-shadow: 0px 2px 0px #abc, 0px 4px 10px rgba(0,0,0,0.15), 0px 5px 2px rgba(0,0,0,0.1), 0px 6px 30px rgba(0,0,0,0.1); } .jumbotron p { font-size: 28px; font-weight: 100; } .main { background: white; color: #234; border-top: 1px solid rgba(0,0,0,0.12); padding-top: 30px; padding-bottom: 40px; } .footer { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 30px; } --></style> </head> <body> <div class="jumbotron text-center"> <div class="container"> <h1>Testing 123..</h1> <p class="lead">This page is used to test the proper operation of the <a href="http://apache.org">Apache HTTP server</a> after it has been installed. If you can read this page it means that this site is working properly. This server is powered by <a href="http://centos.org">CentOS</a>.</p> </div> </div> <div class="main"> <div class="container"> <div class="row"> <div class="col-sm-6"> <h2>Just visiting?</h2> <p class="lead">The website you just visited is either experiencing problems or is undergoing routine maintenance.</p> <p>If you would like to let the administrators of this website know that you've seen this page instead of the page you expected, you should send them e-mail. In general, mail sent to the name "webmaster" and directed to the website's domain should reach the appropriate person.</p> <p>For example, if you experienced problems while visiting www.example.com, you should send e-mail to "webmaster@example.com".</p> </div> <div class="col-sm-6"> <h2>Are you the Administrator?</h2> <p>You should add your website content to the directory <tt>/var/www/html/</tt>.</p> <p>To prevent this page from ever being used, follow the instructions in the file <tt>/etc/httpd/conf.d/welcome.conf</tt>.</p>
<h2>Promoting Apache and CentOS</h2> <p>You are free to use the images below on Apache and CentOS Linux powered HTTP servers. Thanks for using Apache and CentOS!</p> <p><a href="http://httpd.apache.org/"><img src="images/apache_pb.gif" alt="[ Powered by Apache ]"></a> <a href="http://www.centos.org/"><img src="images/poweredby.png" alt="[ Powered by CentOS Linux ]" height="31" width="88"></a></p> </div> </div> </div> </div> </div> <div class="footer"> <div class="container"> <div class="row"> <div class="col-sm-6"> <h2>Important note:</h2> <p class="lead">The CentOS Project has nothing to do with this website or its content, it just provides the software that makes the website run.</p> <p>If you have issues with the content of this site, contact the owner of the domain, not the CentOS project. Unless you intended to visit CentOS.org, the CentOS Project does not have anything to do with this website, the content or the lack of it.</p> <p>For example, if this website is www.example.com, you would find the owner of the example.com domain at the following WHOIS server:</p> <p><a href="http://www.internic.net/whois.html">http://www.internic.net/whois.html</a></p> </div> <div class="col-sm-6"> <h2>The CentOS Project</h2> <p>The CentOS Linux distribution is a stable, predictable, manageable and reproduceable platform derived from the sources of Red Hat Enterprise Linux (RHEL).<p> <p>Additionally to being a popular choice for web hosting, CentOS also provides a rich platform for open source communities to build upon. For more information please visit the <a href="http://www.centos.org/">CentOS website</a>.</p> </div> </div> </div> </div>
</div> </body></html>

【Status確認】

[root@tk2-258-38511 ~]# systemctl status httpd

  • httpd.service - The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
    Active: active (running) since Tue 2020-07-28 23:28:20 JST; 1 weeks 1 days ago
    Docs: man:httpd(8)
    man:apachectl(8)
    Process: 18345 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
    Process: 20010 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)

Main PID: 18348 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
|-18348 /usr/sbin/httpd -DFOREGROUND
|-20023 /usr/sbin/httpd -DFOREGROUND
|-20024 /usr/sbin/httpd -DFOREGROUND
|-20025 /usr/sbin/httpd -DFOREGROUND
|-20026 /usr/sbin/httpd -DFOREGROUND
`-20027 /usr/sbin/httpd -DFOREGROUND

[root@tk2-258-38511 ~]# systemctl status firewalld

  • firewalld.service - firewalld - dynamic firewall daemon
    Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
    Active: active (running) since Thu 2020-08-06 21:58:13 JST; 5min ago
    Docs: man:firewalld(1)

Main PID: 28040 (firewalld)
CGroup: /system.slice/firewalld.service
`-28040 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

Aug 06 21:58:13 tk2-258-38511.vs.sakura.ne.jp systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 06 21:58:13 tk2-258-38511.vs.sakura.ne.jp systemd[1]: Started firewalld - dynamic firewall daemon.
Aug 06 21:58:14 tk2-258-38511.vs.sakura.ne.jp firewalld[28040]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider...abling it now.
Hint: Some lines were ellipsized, use -l to show in full.


気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ajun678

2023/03/27 22:52

Thank you for your information I also refers Reports Insights reports for study in details
guest

回答1

0

ベストアンサー

ネットワーク的に接続できていないようです。
サーバーに近いところから確認しましょう。
CentOS 7 のシェルから "curl http://127.0.0.1/" で応答はあるのでしょうか?


(2020/08/06 22:25) 追記

"curl http://127.0.0.1/" では応答がありますね。
で、systemctl status firewalld の出力を見ると、まだ稼働しています。
firewalld を停止するか、firewall-cmd --add-service=http, firewall-cmd --permanent --add-service=http で TCP 80番ポートを許可する必要があります。

投稿2020/08/05 14:54

編集2020/08/06 13:25
TaichiYanagiya

総合スコア12146

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Masalu_Kudou

2020/08/06 13:00

ご回答ありがとうございます! curl の結果を追記いたします
Masalu_Kudou

2020/08/06 13:34

教えていただいたコマンドを実行し、httpポートを許可しましたが、まだTesting 123を見ることはできず、「応答時間が長すぎます」と出てしまいます。 なお、コマンドを実行した結果です。 [root@tk2-258-38511 ~]# firewall-cmd --permanent --add-service=http Warning: ALREADY_ENABLED: http [root@tk2-258-38511 ~]# firewall-cmd --add-service=http Warning: ALREADY_ENABLED: 'http' already in 'public' success
TaichiYanagiya

2020/08/06 13:44

firewalld で許可済みですね。 あと考えられることは、ネットワーク経路上のファイアーウォールとか、VPS やクラウド環境あれば、そちらのパケットフィルター機能(セキュリティグループなど)でしょうか。
Masalu_Kudou

2020/08/06 13:48

firewallって言っても一つではないのですね。 おっしゃるとおり、現在さくらのVPSを使用しております。そうすると、さくらのVPSのパケットフィルターを確認する必要があるということですね。。。
Masalu_Kudou

2020/08/06 22:53

ありがとうございました。おっしゃるとおりパケットフィルター機能がSSHしか許可されていなかったため、httpポートを許可したところ、Test 123が表示されるようになりました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問