#author("2019-10-20T18:54:53+09:00","","") #author("2019-10-20T18:55:35+09:00","","") #nofollow #norelated 総数:&counter(total); 今日:&counter(today); 昨日:&counter(yesterday); * もくじ [#be109cbd] #contents *apache2 パッケージをインストールする。 [#cb7c6133] ~$ sudo apt -y install apache2 **バージョンを確認 [#vf5b4869] ~$ apache2 -version Server version: Apache/2.4.29 (Ubuntu) Server built: 2019-09-16T12:58:48 -2.4.29 だった。 *ServerName を設定 [#g483325c] -ServerName を ubdt18041 (設定例)に設定する。 -ServerName を ubdt18043 (設定例)に設定する。 ~$ sudo bash ~# cat << EOF > /etc/apache2/conf-available/servername.conf ServerName ubdt18041 ServerName ubdt18043 EOF ~# exit ~$ sudo a2enconf servername Enabling conf servername. To activate the new configuration, you need to run: service apache2 reload ~$ sudo service apache2 reload *提案パッケージもインストールする。 [#ebbe04fa] ~$ 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固定化 [#cc096867] 参考URL https://linuxfan.info/ubuntu-1804-desktop-static-ip-address/ &br; **各種設定を確認 [#h18a26e3] ***アドレスとネットマスク [#bf0881ef] ~$ 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」だ。&br; ***ゲートウェイ [#e34ddad5] ~$ 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ネームサーバ [#abe314e6] ~$ 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アドレスを固定する [#o74a77f7] ***ネットワーク設定を開く [#y4843f22] 「トップバー」の一番右をクリックし、「システムメニュー」を開きます。&br; そして、「工具」のアイコンをクリックしましょう。 ***有線でネットワーク接続している場合 [#i5c06478] 左側の設定カテゴリーにある「ネットワーク」をクリックし、&br; 「有線」の歯車アイコンをクリックすると設定ダイアログが開きます。 ***ネットワーク設定の確認と変更 [#t33c7789] 設定ダイアログが開くと、割り当てられたIPv4アドレスやIPv6アドレス、&br; デフォルトルートやDNSサーバーのアドレスなどが表示されます。 -「IPv4」タブをクリックし、「IPv4メソッド」を「手動」に切り替えると、&br; IPアドレス・ネットマスク・ゲートウェイ・DNSなどを設定できます。 -(例)アドレス |アドレス|ネットマスク|ゲートウェイ|h |192.168.3.16|255.255.255.0|192.168.3.1| -(例)DNS(「自動」をOFFにする) |192.168.3.1| -「適用」を選択する。 ダイアログが閉じます。しかし、まだ変更したネットワーク設定は有効にはなっていません。&br; 変更するのは、ネットワークに再接続する必要があります。 -有線LANに接続している場合、「オン」となっているスイッチを一度「オフ」にし、再度「オン」にします。 *テスト [#l51e82d8] **他のPCからデフォルトページを表示 [#zb7cfcba] -次のurlに接続する。(例 192.168.3.26 の場合) http://192.168.3.16/ --Apache2 Ubuntu Defult Page が表示されればOK。 *www-data グループへの参加 [#e1faaf74] **ユーザ <username> の所属グループを確認 [#c148f8ff] ~$ groups <username> <username> : <username> adm cdrom sudo dip plugdev lpadmin sambashare **ユーザ <username> をグループ www-data に追加する [#wf841dfb] ~$ sudo gpasswd -a <username> www-data ユーザ <username> をグループ www-data に追加 **ユーザ <username> の所属グループを再度確認 [#b18bc7c6] ~$ groups <username> <username> : <username> adm cdrom sudo dip www-data plugdev lpadmin sambashare * ''次は'' [#nbd39dd7] -php のインストール[[installing php on ubuntu desktop 18.04.1]]へ -mysql server のインストール [[installing mysql on ubuntu desktop 18.04.1]] へ