Changes between Version 22 and Version 23 of HowTo/SakuraVpsSetup3


Ignore:
Timestamp:
Aug 10, 2017, 2:41:20 PM (7 years ago)
Author:
村山 俊之
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowTo/SakuraVpsSetup3

    v22 v23  
    463463}}}
    464464
     465その他のヴァーチャルホストについては、以下のようなスクリプトを書いて対応…。
     466
     467{{{
     468#!console
     469# vim a.pl
     470}}}
     471
     472{{{
     473#!perl
     474#!/usr/bin/perl
     475for my $site (@ARGV) {
     476    open my $fh, '>', "$site.conf";
     477    print $fh <<ENDLINE;
     478<VirtualHost *:80>
     479    ServerAdmin root\@harapeko.jp
     480    DocumentRoot /var/www/vhosts/$site/html
     481    ServerName $site.harapeko.jp
     482
     483    IncludeOptional sites-enabled/$site/*.conf
     484</VirtualHost>
     485ENDLINE
     486
     487    mkdir $site, 0755;
     488}
     489}}}
     490
     491{{{
     492#!console
     493# chmod u+x a.pl
     494# ./a.pl blog daiyokujo developer test
     495perl: warning: Setting locale failed.
     496perl: warning: Please check that your locale settings:
     497        LANGUAGE = "en_US:",
     498        LC_ALL = (unset),
     499        LANG = "ja_JP.UTF-8"
     500    are supported and installed on your system.
     501perl: warning: Falling back to the standard locale ("C").
     502# ls -l
     503total 36
     504lrwxrwxrwx 1 root root   35 May 27 06:36 000-default.conf -> ../sites-available/000-default.conf
     505-rwxr--r-- 1 root root  328 Aug 10 16:00 a.pl
     506drwxr-xr-x 2 root root 4096 Aug 10 16:00 blog
     507-rw-r--r-- 1 root root  189 Aug 10 16:00 blog.conf
     508drwxr-xr-x 2 root root 4096 Aug 10 16:00 daiyokujo
     509-rw-r--r-- 1 root root  204 Aug 10 16:00 daiyokujo.conf
     510drwxr-xr-x 2 root root 4096 Aug 10 16:00 developer
     511-rw-r--r-- 1 root root  204 Aug 10 16:00 developer.conf
     512drwxr-xr-x 2 root root 4096 Aug 10 16:00 test
     513-rw-r--r-- 1 root root  189 Aug 10 16:00 test.conf
     514#
     515}}}