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 にアクセスできました。」と表示されることを確認。