1 views

実現する機能

Webサーバー(Apache)はInternet Explorer等のブラウザから自宅サーバーのWebページをみれるようにするためのサーバーです。

Webサーバーの導入手順

(1)Apacheのインストール

root@tu-ubuntu:~# aptitude -y install apache2 ← Apacheのインストール          
...
 * Starting web server
...

(2)Webサーバー設定

root@tu-ubuntu:~# vi /etc/apache2/conf-enabled/security.conf ← security.conf
の編集
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minimal | Minor | Major | Prod
# where Full conveys the most information, and Prod the least.
#ServerTokens Minimal
ServerTokens Prod ← OSをProdに
#ServerTokens Full

# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#ServerSignature Off

ServerSignature Off ← OnをOffに

root@tu-ubuntu:~# vi /etc/apache2/apache2.conf ← apache2.confの編集
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
ServerName topi.0t0.jp ← 自宅サーバー名の入力
#

root@tu-ubuntu:~# vi /etc/apache2/sites-enabled/000-default.conf ← 000-default
.confの編集

# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@topi.0t0.jp ← 管理者メールの入力

root@tu-ubuntu:~# /etc/init.d/apache2 restart ← apache2の再起動
 * Restarting web server apache2                                         [ OK ] 

(3)ポート80番のOPEN
ルーター側の設定でポート80番をOPENする。
※ルーターの設定は各ルーターのマニュアルまたはメーカー別ルーターポート開放手順を参照
ポートチェック【外部からポート開放確認】で「host名」にサーバー名(例:ufuso.dip.jp)、「port番号」に80と入力して「ポートチェック」ボタン押下し、「ホスト=ufuso.dip.jp ポート=80 にアクセスできました。」と表示されることを確認。

(4)firefox等のブラウザにサイトのURLを入力して、下の画面が表示されればOK。
http01

4 Replies to “Ubuntu 14.04 amd64 でWebサーバー構築・公開(Apache2)”

  1. 拝啓

    WEBサーバー設定の構文ありがとうございました・・・・
    今のところ”/etc/apache2/conf-available/security.conf”でE325 swpエラーがでます
    どうするかわかりませので・・・・
    休眠中です よろしくご教示願います・・・

    敬具

    1. muneki様、コメントありがとうございます。
      「E325 swpエラー」だけではわかりかねます。エラーメッセージを全文教えていただけないでしょうか。現時点では、security.confファイルの編集を途中で中断したのでは、という推測くらいしかできません。

  2. 早速の温かいご返事有難うございました
    再びリカバーしまして初めからやり直しましたエラーはなくなりました
    そしてAPACHE2でインストールしておりますAPTITUDEでのインストールはまだです
    APTITUDEファイルはインストールしております
    次のステップが皆目分かりません・・・・
    以前LOOK DNSでチエックした時は下記のように確認確認できました
    MX:jf3goh.dip.jp(target)/10(pri)/180(ttl)/wwwポート80稼動中
    しかし、どうしたか忘れました・・・
    欲張ってVSFTPDもインストールしておりますがアノニマスNOのみ構文を変更しておりません
    以上が私の今の状況です
    よろしくご教示お願い申し上げます
    豊中市緑丘 山藤 排
    まだ初期の段階です

    1. 本サイトのタイトルのように「Webサーバー構築・公開」が目的であれば、上記(3)ポート80番のOPEN処理を行ってください。お宅のルーターの機種がわかりませんが、ポート80番を開放する必要があります。それができたかどうかの確認は上記「ポートチェック」からできますのでご活用ください。「jf3goh.dip.jp」がドメイン名のようですが、ウェブブラウザを起動させてURL「http://jf3goh.dip.jp」と入力して上記(4)のサイト画面が表示されれば成功です。頑張ってください

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください