CentOS 7なsystemd環境でautologinする

KVMでauto loginできたらと調べて上手くできたのでメモ

cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service

diff -Nurr /usr/lib/systemd/system/getty\@.service getty\@ttyS0.service 
--- /usr/lib/systemd/system/getty@.service      2014-10-23 20:29:59.000000000 +0900
+++ getty@ttyS0.service 2014-12-01 14:39:07.338000000 +0900
@@ -25,7 +25,7 @@
 
 [Service]
 # the VT is cleared by TTYVTDisallocate
-ExecStart=-/sbin/agetty --noclear %I
+ExecStart=-/sbin/agetty --autologin root --noclear %I
 Type=idle
 Restart=always
 RestartSec=0
@@ -44,3 +44,4 @@
 
 [Install]
 WantedBy=getty.target
+;Alias=getty@ttyS0.service


これだけだとうまく動かないので追加
[https://wiki.archlinux.org/index.php/automatic_login_to_virtual_console:title]


後で調べる。

nginxをwildcard SSLを使ってSSLアクセラレータとして設定した時のメモ

同じドメインなのにSSLを使うとIPも必要だし何かいい方法ないかと考えた時に思いついた。 default.confをこんな感じで設定したらIPを消費しないで済んだし良かった。 upstream は別ファイルで管理した。

ssl_certificate     /etc/pki/tls/certs/wildcard.example.com.crt;
ssl_certificate_key         /etc/pki/tls/private/wildcard.example.com.key;
ssl_protocols         TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers RC4:HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache    shared:SSL:10m;
ssl_session_timeout  10m;

proxy_next_upstream error timeout;
proxy_set_header Host              $host;
proxy_set_header X-Real-IP         $remote_addr;
proxy_set_header X-Forwarded-For   $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port  $remote_port;
port_in_redirect                   off;
add_header      Front-End-Https    on;

server {
    listen    80;
    listen    443 ssl spdy;
    server_name  aaa.example.com;
                location / {
                                proxy_pass http://aaa;
                }
}

server {
    listen    80;
    listen    443 ssl spdy;
    server_name bbb.example.com;
                location / {
                                proxy_pass http://bbb;
                }
}

server {
     listen    80;
     listen    443 ssl spdy;
     server_name ccc.example.com;
                location / {
                                proxy_pass http://ccc;
                } 
}

server {
    listen    80;
    listen    443 ssl spdy;
    server_name  ddd.example.com;
                location / {
                                proxy_pass http://ddd;
                }
}