我正在使用 vagrant/puppet 来配置我的测试机,我正在使用它来为 apache 配置虚拟主机,但是在启动 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.
我为配置虚拟主机而编写的清单文件如下所示
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>",
}