开发者

What ServerName is given for AWS while creating vitual host?

What ServerName is to be declared in VirtualHost in Amazon Web Service. I am defining

<VirtualHost开发者_运维技巧 *:80>
DocumentRoot "/opt/bitnami/projects/fortis_django"
ServerName ec2-122-248-220-105.ap-southeast-1.compute.amazonaws.com/fortis
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/opt/bitnami/projects/myfood"
ServerName ec2-122-248-220-105.ap-southeast-1.compute.amazonaws.com/myfood
</VirtualHost>

also tried

<VirtualHost *:80>
DocumentRoot "/opt/bitnami/projects/fortis_django"
ServerName localhost/fortis
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/opt/bitnami/projects/myfood"
ServerName localhost/fortis
</VirtualHost>

After restarting Apache gives error

httpd: Couldn't determine server's fully qualified domain using 127.0.0.1 for ServerName

name ServerName by default it is given ServerName localhost:80 i made it comment.


ServerName takes a fully qualified domain name, and optionally a port, but not a path like you're doing. A correct value could be for example:

ServerName ec2-122-248-220-105.ap-southeast-1.compute.amazonaws.com:80

or

ServerName localhost:80


You can try something like this:

<VirtualHost *:80>
   ServerName fortis.com
   DocumentRoot "/opt/bitnami/projects/fortis_django"
</VirtualHost>

<VirtualHost *:80>
   ServerName myfood.com
   DocumentRoot "/opt/bitnami/projects/myfood"
</VirtualHost>

Where 'fortis.com' and 'myfood.com' your real domain names. Based on this name apache will choose document root

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜