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

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

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

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

Q&A

2回答

3525閲覧

apacheのサーバー名とポートの設定について質問です。

Norikiyo

総合スコア18

Apache

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

0グッド

1クリップ

投稿2016/07/20 07:10

閲覧にていただきありがとうございます。
初心者で、「こんなことも知らないのか?」というようなことも多いかもしれませんが、最後まで見て行っていただけると嬉しいです。

apacheをインストールして、サーバー名とポートの設定をしようとしているのですが、
「vi /etc/httpd/conf/httpd.conf」を編集しようと開くのですが、どのサイトに乗っている中身とも一致しません。
どこを変えていいのかわからないです。
それ以前に、なぜやり方を載せている人たちと私のvi /etc/httpd/conf/httpd.confの中身は違うのでしょうか?


[root@localhost ~]# vi /etc/httpd/conf/httpd.conf # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so 'log/access_log' # with ServerRoot set to '/www' will be interpreted by the # server as '/www/log/access_log', where as '/log/access_log' will be # interpreted as '/log/access_log'. # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path. If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used. If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # ServerRoot "/etc/httpd" # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # Include conf.modules.d/*.conf # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User apache Group apache # 'Main' server configuration # # The directives in this section set up the values used by the 'main' "/etc/httpd/conf/httpd.conf" 353L, 11753C

最後まで見ていただきありがとうございます。
自分のつたない文で理解していただけたようでしたら、
お力添えいただけると助かります。
どうぞよろしくお願いいたします。

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

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

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

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

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

guest

回答2

0

導入しているプラットフォーム/apacheのバージョンにより記載内容は変わってきます。

ポート変更は以下でデフォルト80に設定されています。
Listen 80

conf.d以下にssl.confがあるのであれば443も対象になるでしょう。

サーバ名は以下のパラメータで指定します。
ServerName "公開ホスト名":"ポート番号"

投稿2016/07/20 07:30

over

総合スコア4309

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

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

Norikiyo

2016/07/20 07:41

[root@localhost ~]# httpd -v Server version: Apache/2.4.6 (CentOS) Server built: Jul 18 2016 15:30:14 ありがとうございます。 一度記述してみます。
guest

0

Apache2.4で書き方が変わってるみたいですね。
Apache2.4系にmod_cacheを導入 ⇒ logw-ログゥ 個人的な記録用-

Include conf.modules.d/*.conf

の記述に鍵があるようです。

よくみると4行目に

# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.

という記述がありますよ。
マニュアルちゃんと読んでくださいねってことですね ^_^

投稿2016/07/20 07:25

Mr_Roboto

総合スコア2208

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

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

Norikiyo

2016/07/20 07:45

ありがとうございます。 上記のサイト拝見させていただきます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問