!!!参考サイト !VMware Toolsのインストール @ Ubuntu 8.04 (Hardy) VM @かえでのWebログ *http://kaede.blog.abk.nu/vmtools_ubuntu ""UbuntuのリポジトリにはVMware Toolsのパッケージが用意されているので、Debian VMにVMware Toolsをインストールする方法ではなく、aptで導入する方法が楽です。 ""導入するパッケージは以下の通り。 *open-vm-tools *open-vm-tools-gui !Ubuntu community Upgrade Notes *https://help.ubuntu.com/community/UpgradeNotes *リリース間のOS更新方法 *段階を踏まないとOS更新できない *10.04 LTS --> 10.10 *9.10 / 8.04 LTS --> 10.04 LTS *9.04 --> 9.10 *8.10 --> 9.04 *6.06 LTS --> 8.04 LTS *5.10 --> 6.06 LTS !Debian の apt/apt-get/aptitude について / Sharing Innovations in the Web *https://intheweb.io/apt-aptget-aptitude/ ""さて本日の話題ですが、 Debian 系の OS を使っていると知らず知らずのうちにお世話になっているはずの apt/apt-get/aptitude についてです。 ""結論としては apt を使っていこ です。 !【Ubuntu 18.04 LTS Server】時刻の同期について / The modern stone age. *https://www.yokoweb.net/2018/05/14/ubuntu-18_04-timesyncd/ ""Ubuntu 18.04 LTS Serverでの時刻同期は、ntpdateを使わずにSystemdの機能を使って時刻の同期を行っているようです。 ""デフォルトの状態で、時刻の同期に ntp.ubuntu.com というサーバーが使われて同期が実行されている。 $ sudo systemctl -l status systemd-timesyncd *応用 $ sudo systemctl status systemd-timesyncd $ sudo systemctl restart systemd-timesyncd !Ubuntu 18.04 LTSで固定IPアドレスの設定 / Qiita @zen3 *https://qiita.com/zen3/items/757f96cbe522a9ad397d ""Ubuntu 18.04 LTS Serverでの固定IPアドレス設定。 ""17.10から、IPアドレスの変更が/etc/network/interfacesをいじる方式から変更になっているのでメモ。 ""/etc/netplan/50-cloud-init.yamlを編集しIPアドレスを設定します。 ""設定ファイルのパスは、 ""Live CDからインストールした場合は/etc/netplan/50-cloud-init.yaml ""mini.isoからインストールした場合は/etc/netplan/01-netcfg.yaml *設定例 network: version: 2 renderer: networkd ethernets: enp0s3: dhcp4: no dhcp6: no addresses: [192.168.1.70/24] gateway4: 192.168.1.1 nameservers: addresses: [192.168.1.1, 8.8.8.8, 8.8.4.4] *テストサーバ ubuntu02 上での設定ファイル例(DHCP) root@ubuntu02:/etc/netplan# cat /etc/netplan/50-cloud-init.yaml network: ethernets: enp0s3: addresses: [] dhcp4: true version: 2 *IPアドレス設定変更の反映 ""netplan applyを実行して反映します。再起動不要です。 loginuser@localhost:~$ sudo netplan apply *IPアドレスの確認 loginuser@localhost:~$ ip addr !How to set environment variable in systemd service? / serverfault lfagundes *https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service ""I have an Arch Linux system with systemd and I've created my own service. The configuration service at /etc/systemd/system/myservice.service looks like this: [Unit] Description=My Daemon [Service] ExecStart=/bin/myforegroundcmd [Install] WantedBy=multi-user.target ""Now I want to have an environment variable set for the /bin/myforegroundcmd. How do I do that? *answer ""Times change and so do best practices. ""The current best way to do this is to run systemctl edit myservice, which will create an override file for you or let you edit an existing one. ""In normal installations this will create a directory /etc/systemd/system/myservice.service.d, and inside that directory create a file whose name ends in .conf (typically, override.conf), and in this file you can add to or override any part of the unit shipped by the distribution. ...中略... ""The recommended way to do this is to create a file /etc/sysconfig/myservice which contains your variables, and then load them with EnvironmentFile. ""For complete details, see Fedora's documentation on how to write a systemd script. *answer (和訳) ""時は変わり、ベストな対応も変化します。 ""現在のところ、 「systemctl edit サービス名」を起動すると既存の設定を上書きするファイルを作成し編集します。 ""通常のインストールで、上記コマンドを実行すると /etc/systemd/system/myservice.service.d ディレクトリを作成し、.conf 拡張子のファイルを作成します。このファイルでパッケージの設定を上書きしたり追加したりできます。 ""詳しくは ...中略... ""古い方法を記録しておくと、 /etc/sysconfig/myservice にファイルを作成し、 EnvironmentFile 指定でファイルの内容を読み込む方法でした。 !Howto install Oracle OCI8 instantclient on Ubuntu 18.04 / serverfault *https://serverfault.com/questions/911475/howto-install-oracle-oci8-instantclient-on-ubuntu-18-04 *インストール手順 *oracle-instantclient インストール+環境設定 *oci8 インストールのための開発環境インストール php7.2-dev php-pear build-essential libaio1 * !!!作業メモ !OS 更新 *通常 sudo apt-get update sudo apt-get upgrade *upgrade では保留されていて再起動を伴うもの(kernelなど) sudo apt-get dist-upgrade !パッケージ一覧 dpkg --list !パッケージインストール sudo apt-get install ... *例 sudo apt-get install open-vm-tools !パッケージ除去 sudo apt-get remove ... *例 sudo apt-get remove open-vm-tools !ネットワーク再開 *vmware-config-tools.pl 実行時に kernel ヘッダがなくてコンパイルできなかった。 *ネットワークのモジュールが使えなくなった。 /etc/init.d/networking stop rmmod vmxnet rmmod pcnet32 depmod -a modprobe pcnet32 /etc/init.d/networking start !kernel ヘッダのインストール *ヘッダのインストール apt-get install linux-headers-generic */usr/src/linux リンク再作成 !apache2 サービスへの oracle-instantclient 環境変数追加 *oracle-instantclient を /usr/local/lib/instantclient_11_2 にインストール *ライブラリをパスに追加 root@ubuntu02:/var/www/html/trz_picking# echo /usr/local/lib/instantclient_11_2 >> /etc/ld.so.conf.d/oracle-instantclient.conf root@ubuntu02:/var/www/html/trz_picking# ldconfig *php から oracle に接続するため、3つの環境変数を追加する。 NLS_LANG=Japanese_Japan.AL32UTF8 ORACLE_HOME=/usr/local/lib/instantclient_11_2 *PATH はハードコードで設定する。systemd 環境でのPATH設定追加は変数展開されない。 *現行環境に ORACLE 関連環境変数がないことを確認 root@ubuntu02:/etc/systemd/system# curl -v http://localhost/trz_picking/phpinfo.php 2>&1 | grep -i -e oracle_home -e instantclient -e nls_lang | uniq *出力なし *apache2.service への環境変数の追加 # systemctl edit apache2 *編集追加内容 [Service] Environment="NLS_LANG=Japanese_Japan.AL32UTF8" Environment="ORACLE_HOME=/usr/local/lib/instantclient_11_2" *ファイル /etc/systemd/system/apache2.service.d/override.conf 内容 [Service] Environment="NLS_LANG=Japanese_Japan.AL32UTF8" Environment="ORACLE_HOME=/usr/local/lib/instantclient_11_2" *設定ファイル読み込み # systemctl restart apache2 *環境変数が追加されたことを確認 root@ubuntu02:/var/www/html/trz_picking# curl -v http://localhost/trz_picking/phpinfo.php 2>&1 | grep -i -e oracle_home -e instantclient -e nls_lang | sort | uniq