カテゴリー: サーバー管理

  • AWS メール制限の解除

    EC2ではポート25利用制限、メール送信数制限が行われているため、制限の解除と逆引きDNS設定をおこなった。

    これは一回の申請ですべて可能。

    以下のアドレスを開き、入力する。

    https://console.aws.amazon.com/support/contacts?#/rdns-limits

    Email address: xxx@domain.com
    Use case description: メールサーバー構築のため。(rDNS registration.)
    Elastic IP address - optional: xxx.xxx.xxx.xxx
    Reverse DNS record - optional: mail.domain.com

    ほどなく、以下の受け付けメールが届いた。

    題名: Your AWS Inquiry [99999]
    差出人: Amazon Web Services
    
    Hello,
    
    Thank you for contacting Amazon Web Services. We have received your request and will begin reviewing soon.
    
    Your request tracking ID is: 99999
    
    Requests are evaluated in the order in which they are received. AWS is committed to being responsive and keeping you informed of our progress. You should expect to receive a non-automated response to your initial contact within 48 business hours, however please be aware that evaluation may take longer depending on the complexity of the request.
    省略…

    一時間ほどして追加情報の問い合わせメールが届いた。

    題名 : Your AWS Inquiry [99999]
    差出人 :Amazon Web Services
    
    Hello,
    
    Thank you for submitting your request to have the email sending limit removed from your account and/or for an rDNS update.
    
    In order for us to process this request as quickly as possible, please provide the following information:
    
    -A clear/detailed use-case for sending mail from EC2.
    
    -What type of configuration or setup have you implemented to prevent spam from originating from your EC2 resource?
    
    Please reply directly to this message with the above information. Once this has been received we can process your original request. As a reference, please make sure to review the AWS Acceptable Use Policy (https://aws.amazon.com/aup/)
    for more information regarding prohibited uses of AWS services.
    
    We appreciate your cooperation, if you have any questions, please reach out to us.
    
    Regards,
    Amazon Web Services
    このリクエストをできる限り迅速に処理するために、次の情報を提供してください。
    
    -EC2からメールを送信するための明確で詳細なユースケース。
    
    -EC2リソースからスパムが送信されるのを防ぐために、どのような構成または設定を実装しましたか?
    
    上記の情報を添えて、このメッセージに直接返信してください。これを受け取ったら、元のリクエストを処理できます。参照として、AWSの利用規定(https://aws.amazon.com/aup/)を必ず確認してください

    これに関して以下のようにメールを返した。

    Hello, 
    
    Thank you for your inquiry
    
    Run WordPress on Windows Serer 2016 on Lightsail and open a blog. Hobby club (about 30 people) shares information among members and manages mailing list.
    Announce an event (about 50 people) that is held once a year and accept participation.
    
    Emails will only be sent to the email address requested in advance or on the web, 
    
    Regards, please
    nnnn

    6時間ほどして、メール制限解除とDNS逆引きの設定が終わったと連絡があった。

    題名 : Re: Your AWS Inquiry [99999]
    差出人 :Amazon Web Services
    
    Hello nnnn,
    
    Thank you for getting back to us with the requested.
    
    Accordingly, we have configured the reverse DNS record(s) you requested! Your request was mapped for the following:
    
    =======================================================
    Successfully setup mail.domain.com as rDNS for xxx.xxx.xxx.xxx
    =======================================================
    
    Please note that propagation of this update to DNSBL services that Amazon works with may take up to a week.
    
    Email sending limitations have also been removed for any resources for the region your EIP is located in.
    
    Please let us know if you have any questions.
    
    Regards,
    AWS Trust and Safety
  • WordPress TwrntyTwentyテーマにサイドバーを追加

    画面の横にペインがないと何となく落ち着かない。

    2020年現在最新のテーマTwentyTwentyにサイドバーを追加した。

    C:\xampp\htdocs\wordpress\wp-content\themes\<テーマ名>\functions.php に以下を追加

    function my_theme_widgets_init() {
        register_sidebar( array(
            'name'          => 'Main Sidebar',
            'id'            => 'main-sidebar',
        ) );
    }
    add_action( 'widgets_init', 'my_theme_widgets_init' );

    index.phpに以下を追加

    <?php get_sidebar(); ?>

    sidebar.phpを以下で作成

    <div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary">
      <?php dynamic_sidebar( 'main-sidebar' ); ?>
    </div><!-- #primary-sidebar -->

    外観-カスタマイズで追加CSSに以下を追加。

    /* サイドバーを左に表示 */
    #primary-sidebar {
    	float: left;
    	padding-top: 0rem;
    	padding-right:1rem;
    	width:30%;
    	min-width: 140px;
    }
    

    なぜか見出しの文字が大きすぎるのでサイズを指定した。

    /* 投稿の見出し文字の大きさ */
    .entry-title {
    	font-size: 3.2rem;
    }
    /* サイドバーの見出し文字の大きさ */
    .widgettitle {
    	font-size: 2.5rem;
    }

    ついでにカレンダーに特定の日付にハイライトを付ける。

    /* カレンダーの日付の色 */
    .widget_calendar #today {
    	margin-bottom: 0;
    	background-color: #689F38;
    }
    .widget_calendar a {
    	font-weight: bold;
    }
  • AWS Lightsailでサーバーを構築-スケールアップ編

    AWS Lightsailの無料使用期間が終わったので、インスタンスのスケールアップを行った。

    メモリが512MBでは動かないことはないが、たまにフリーズすることもある。メモリを1GBのプランにスケールアップした。

    スナップショットの作成

    https://lightsail.aws.amazon.com/ls/docs/ja_jp/articles/prepare-windows-based-instance-and-create-snapshot

    インスタンスの管理でインスタンスを停止する
    スナップショットを作成する
    インスタンスを開始し、Ec2LaunchSettingsを実行する
    Administrator PasswordはRandomを選択し、Shutdown with Sysprepボタンを押す。
    SysprepはPC固有情報を削除するらしい。

    https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview
    Removes PC-specific information from the Windows image, including the PC’s security identifier (SID). This allows you to capture the image and apply it to other PCs. This is known as generalizing the PC.
    Uninstalls PC-specific drivers from the Windows image.
    Prepares the PC for delivery to a customer by setting the PC to boot to OOBE.
    Allows you to add answer file (unattend) settings to an existing installation.

    インスタンスが停止したら再度スナップショットを作成する
    最新のスナップショットから新規インスタンスを作成
    ホーム-ネットワークから静的パブリックIPアドレスを新しいインスタンスに振りなおす
    旧インスタンスのスナップショットを2つとも削除する
    旧インスタンスを削除する
    新インスタンスのファイアーフォールを設定する
    DNSを設定する -DNSは静的パブリックIPアドレスに紐づいているので不要

    コンピューター名を変更する