べすとえふぉーと

プログラミング等のノート 

Ubuntu 14.04 apacheのLet'sEncryptをdisable

下記コマンドを実行

a2dissite 000-default-le-ssl.conf 
service apache2 reload

Ubuntu 14.04 apacheでcertbotを設定

インストー

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache 

実行

$ sudo certbot --apache

メールを聞かれるので入力してEnter

Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel):

Aを入力してEnter

-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf. You must agree
in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A

Yを入力してEnter

-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: Y

ドメイン名を聞かれるので入力する
※ポート443が開いてないとエラーになるので開けておく

No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated)  (Enter 'c' to cancel):

リクエストを全部httpsで処理したい場合は2を入力してEnter

Please choose whether HTTPS access is required or optional.
-------------------------------------------------------------------------------
1: Easy - Allow both HTTP and HTTPS access to these sites
2: Secure - Make all requests redirect to secure HTTPS access
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

apt-getでIPV6アドレスに接続できない場合

IPV4使用のオプション -o Acquire::ForceIPv4=true をつける

apt-get -o Acquire::ForceIPv4=true update
apt-get -o Acquire::ForceIPv4=true upgrade

installの場合も同じ

Fedora26にcakephp3を入れる

sudo dnf install php-cli
sudo dnf install php-intl
sudo dnf install php-mbstring
sudo dnf install php-pdo
sudo dnf install php-pdo_mysql
curl -sS https://getcomposer.org/installer | php

composer create-project --prefer-dist cakephp/app sampleapp

ufwがOpenVZ環境でエラーになる

/etc/default/ufwを開く

以下をコメントアウト

IPV6=YES
IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns"

UbuntuにCakePHPインストール中、intlで怒られる

intlで怒られた場合

requires ext-intl

php5-intlをインスコ

sudo apt-get install php5-intl

swapの追加

Fedora26で確認

sudo su

dd if=/dev/zero of=myswap bs=1M count=3000

chmod 600 myswap

mkswap myswap

swapon myswap

echo "/home/user/myswap swap swap defaults 0 0" >> /etc/fstab

swapon -s