2012-10-02 3 views
1

내 테스트 머신을 설정하는 데 방해자/인형을 사용하고 있습니다. 아파치에 대한 가상 호스트를 구성하는 데 사용하고 있습니다. 그러나 아파치를 시작하면 이상한 간격이나 문자 또는 오류가 발생합니다. 그래서 :퍼핏/변상 : 손상된 아파치 가상 호스트 내용

/apache2 start 
* Starting web server apache2                                                            
Syntax error on line 4 of /etc/apache2/sites-enabled/my-ssl.localhost.conf: 
Invalid command '\xc2\xa0\xc2\xa0ServerName', perhaps misspelled or defined by a module not included in the server configuration 
Action 'start' failed. 

file {'hostfile4': 
     path => '/etc/apache2/sites-available/my-ssl.localhost.conf', 
     ensure => present, 
     content => " 
<VirtualHost *:443> 
    DocumentRoot '/coding/mysite/htdocs/' 
  ServerName foa-ssl.localhost 
  ServerAlias foa-ssl.localhost 
  ErrorLog /var/log/apache2/error.log 
  CustomLog /var/log/apache2/access.log combined 
  RewriteLog /var/log/apache2/rewrite.log 
  RewriteLogLevel 0 
    <Directory '/coding/mysite/checkout/htdocs'> 
        AllowOverride All 
        Options All -Indexes 
        Order allow,deny 
        Allow from all 
        php_admin_value short_open_tag Off 
        AddType application/x-httpd-php .css .js 
    </Directory> 
    <Directory '/coding/mysite/app_new/htdocs'> 
        AllowOverride All 
        Options All -Indexes 
        Order allow,deny 
        Allow from all 
        php_admin_value short_open_tag Off 
        AddType application/x-httpd-php .css .js 
    </Directory> 
  <Directory '/coding/mysite/cgi-bin'> 
    Options +ExecCGI 
  </Directory> 
  SSLEngine on 
  SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem 
</VirtualHost>", 
    } 

답변

2

c2 a0는 특수 문자 "비 깨는 공간"에 대한 유니 코드 공유 폴더에 , cf. here.

아파치가 전혀 마음에 들지 않는 것 같습니다. 따라서 에디터에서 똑같이 보일지라도, 공백이 아닌 공백을 제거하고 정상적인 공백을 사용해야합니다.

NotePad ++를 사용하여 꼭두각시 파일을 "ANSI"로 변환하도록 요청할 수 있습니다.이 파일은 설정 파일에 대한보다 안전한 인코딩입니다.

콘텐츠를 외부 파일로 이동하는 동안이를 모른 채 청소해야하지만 외부 파일을 사용하는 것이 효과적 일지라도 해결 방법이 아닙니다.

0

이 사용하여 해결처럼 내가 가상 호스트가 보이는 구성 쓴 매니페스트 파일 :

file { "/etc/apache2/sites-available/my-ssl.localhost.conf": 
    mode => 440, 
    owner => root, 
    group => root, 
    source => "/coding/puppetstuff/my-ssl.localhost.conf" 
} 

/coding/puppetstuff/foa-ssl.localhost.conf은 (경로 이미지입니다) (오류 메시지)

관련 문제