꼭두각시 / 방랑자 : 손상된 Apache VirtualHost 콘텐츠
문제
VAGABRINT / PITRPET을 사용하여 TestMachine을 구성하고 있습니다. Apache에 대한 VirtualHost를 구성하기 위해 사용하고 있지만 Apache를 시작할 때 이상한 간격이나 문자 또는 그렇게 분명히 오류가 발생합니다.
/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.
.
VirtualHost를 구성하기 위해 작성한 매니페스트 파일은 다음과 같이 보입니다
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>",
}
. 해결책
c2 a0
(오류 메시지에서) 특수 문자 "비 속보 공간"의 유니 코드 코드, 참조. 여기 .
아파치가 전혀 싫어하지 않는 것 같습니다.따라서 편집기에서 동일하게 보이더라도 해당 비 침입 공간을 없애고 일반적인 것들을 사용해야합니다.
notepad ++를 사용하고 꼭두각시 파일을 구성 파일의 안전한 인코딩 인 "ANSI"로 꼭두각시 파일을 변환하도록 요청할 수 있습니다.
콘텐츠를 외부 파일로 이동하는 동안 모르겠지만 외부 파일을 사용하는 것이 솔루션이 아니라 솔루션이 아닙니다.
다른 팁
이 사용을 사용하여 해결했습니다.
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는 공유 폴더 (경로가 이미지에 있음)
제휴하지 않습니다 StackOverflow