総数:13 今日:1 昨日:0

もくじ

apache2 パッケージをインストールする。

~$ sudo apt -y install apache2

バージョンを確認

~$ apache2 -version
Server version: Apache/2.4.29 (Ubuntu)
Server built:   2018-10-03T14:41:08

ServerName を設定

提案パッケージもインストールする。

~$ sudo apt -y install apache2-doc
~$ sudo apt -y install apache2-suexec-pristine
~$ sudo apt -y install apache2-suexec-custom
~$ sudo apt -y install apache2-utils

IP固定化

参考URL https://linuxfan.info/ubuntu-1804-desktop-static-ip-address/

各種設定を確認

アドレスとネットマスク

~$ ifconfig 
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.16  netmask 255.255.255.0  broadcast 192.168.3.255
        inet6 2400:2653:cc1:2500:fc63:9b4d:f40:823f  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::55ac:e4c0:f7e:f7f6  prefixlen 64  scopeid 0x20<link>
        inet6 2400:2653:cc1:2500:4e0:c339:709d:7232  prefixlen 64  scopeid 0x0<global>
        ether 74:46:a0:8e:83:2b  txqueuelen 1000  (イーサネット)
        RX packets 83266  bytes 108797927 (108.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 37999  bytes 3465393 (3.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (ローカルループバック)
        RX packets 1543  bytes 126277 (126.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1543  bytes 126277 (126.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

アドレスは「192.168.3.16」、ネットマスクは「255.255.255.0」だ。

ゲートウェイ

~$ route -n
カーネルIP経路テーブル
受信先サイト    ゲートウェイ    ネットマスク   フラグ Metric Ref 使用数 インタフェース
0.0.0.0         192.168.3.1     0.0.0.0         UG    100    0        0 enp0s25
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp0s25
192.168.3.0     0.0.0.0         255.255.255.0   U     100    0        0 enp0s25

ゲートウェイは「192.168.3.1」だ。

DNSネームサーバ

~$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
search flets-west.jp iptvf.jp

IPアドレスを固定する

ネットワーク設定を開く

「トップバー」の一番右をクリックし、「システムメニュー」を開きます。
そして、「工具」のアイコンをクリックしましょう。

有線でネットワーク接続している場合

左側の設定カテゴリーにある「ネットワーク」をクリックし、
「有線」の歯車アイコンをクリックすると設定ダイアログが開きます。

ネットワーク設定の確認と変更

設定ダイアログが開くと、割り当てられたIPv4アドレスやIPv6アドレス、
デフォルトルートやDNSサーバーのアドレスなどが表示されます。

テスト

他のPCからデフォルトページを表示

www-data グループへの参加

ユーザ <username> の所属グループを確認

~$ groups <username>
<username> : <username> adm cdrom sudo dip plugdev lpadmin sambashare

ユーザ <username> をグループ www-data に追加する

~$ sudo gpasswd -a <username> www-data
ユーザ <username> をグループ www-data に追加

ユーザ <username> の所属グループを再度確認

~$ groups <username>
<username> : <username> adm cdrom sudo dip www-data plugdev lpadmin sambashare

次は


トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS