Discussion:
problem with apache configuration
(too old to reply)
J.P
2011-12-13 09:25:37 UTC
Permalink
This is the contents of my virtual host

When i use the following :



<Directory “/var/www/capi_app/current/public”>
Allow from all
Order allow,deny
Options FollowSymlinks MultiViews
</Directory>

NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
</VirtualHost>

<VirtualHost *:443>
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
</VirtualHost>



but getting error, with this line NameVirtualHost *:80 It says
some name misspelled or something


Then i changed it to following :

<VirtualHost *:80>
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
RequestHeader set X_FORWARDED_PROTO 'https'
<Directory “/var/www/capi_app/current/public”>
Allow from all
Options FollowSymlinks MultiViews
</Directory>
</VirtualHost>



Error message ;:

Syntax error on line 2 of /etc/apache2/sites-enabled/capi_app:
Invalid command 'ServerName\xc2\xa0www.passionate4.net', perhaps
misspelled or defined by a module not included in the server
configuration
httpd not running, trying to start
Action '-k restart' failed.
The Apache error log may have more information.


How should I change this settings so that my ubuntu server on ec2 can
accept http as well as https requests?

Please help!!!!
Álvaro G. Vicario
2011-12-13 12:34:18 UTC
Permalink
Post by J.P
This is the contents of my virtual host
<Directory “/var/www/capi_app/current/public”>
I don't think you can use typographic quotes. Replace them with regular
double quotes (") or remove them completely (there's no white space in
paths so it shouldn't matter).
Post by J.P
Allow from all
Order allow,deny
Options FollowSymlinks MultiViews
</Directory>
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
</VirtualHost>
<VirtualHost *:443>
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
</VirtualHost>
but getting error, with this line NameVirtualHost *:80 It says
some name misspelled or something
<VirtualHost *:80>
ServerName www.passionate4.net
DocumentRoot /var/www/capi_app/current/public
RequestHeader set X_FORWARDED_PROTO 'https'
<Directory “/var/www/capi_app/current/public”>
Allow from all
Options FollowSymlinks MultiViews
</Directory>
</VirtualHost>
Invalid command 'ServerName\xc2\xa0www.passionate4.net', perhaps
misspelled or defined by a module not included in the server
configuration
httpd not running, trying to start
Action '-k restart' failed.
The Apache error log may have more information.
0x02AC is the white space in UTF-8 encoding. As far as I know, Apache
does not support UTF-8. You'll have to save it with a single byte
encoding, such as ASCII or Latin1.
Post by J.P
How should I change this settings so that my ubuntu server on ec2 can
accept http as well as https requests?
Well, you'd better fix the syntax errors first.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
tevolo
2011-12-14 13:21:16 UTC
Permalink
Post by J.P
This is the contents of my virtual host
<Directory “/var/www/capi_app/current/public”>
 Allow from all
 Order allow,deny
 Options FollowSymlinks MultiViews
</Directory>
 NameVirtualHost *:80
 NameVirtualHost *:443
<VirtualHost *:80>
 ServerNamewww.passionate4.net
 DocumentRoot /var/www/capi_app/current/public
</VirtualHost>
<VirtualHost *:443>
 ServerNamewww.passionate4.net
 DocumentRoot /var/www/capi_app/current/public
</VirtualHost>
but getting error,  with this line  NameVirtualHost *:80     It says
some name misspelled or something
<VirtualHost *:80>
 ServerNamewww.passionate4.net
 DocumentRoot /var/www/capi_app/current/public
 RequestHeader set X_FORWARDED_PROTO 'https'
 <Directory “/var/www/capi_app/current/public”>
  Allow from all
  Options FollowSymlinks MultiViews
 </Directory>
</VirtualHost>
Invalid command 'ServerName\xc2\xa0www.passionate4.net', perhaps
misspelled or defined by a module not included in the server
configuration
httpd not running, trying to start
Action '-k restart' failed.
The Apache error log may have more information.
How should I change this settings so that my ubuntu server on ec2 can
accept http as well as https requests?
Please  help!!!!
I do not think you are using the NamedVirtualHists right with how your
virtual hosts are configured. Somehwere you need
Listen 80
Listen 443
no need for namedvirtualhost, remove the quotes, put a space after the
servername inside the virtual hosts.

for ssl you shoudl really call the httpd-ssl.conf file instead of
doing things the way you are and you will need a key and a cert.

you would call it as such from your httpd.conf file:
Include conf/extra/httpd-ssl.conf

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

you also have to make sure you have an apache instance with ssl
configured in the build.

Continue reading on narkive:
Loading...