Sunday, November 11, 2012

Alias virtual host in CentOS HTTPD



พยายามทำ alias ของ httpd บน CentOS แต่ ติดเรื่อง permission หว่า
Forbidden You don't have permission to access / on this server

Solved

  • http://stackoverflow.com/questions/10873295/forbidden-you-dont-have-permission-to-access-on-this-server

#/etc/httpd/conf/httpd.conf

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>
set the options to : Options Indexes FollowSymLinks Includes ExecCGI

Finally it should like :

<Directory />
    #Options FollowSymLinks
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>

---------------------------------------------------------------------------
Example

############# my site #############
<VirtualHost 202.28.xx.yy>
DocumentRoot "/var/www/html/mysite"
ServerName mysite.go.th
ServerAlias www.mysite.go.th
CustomLog /var/log/httpd/mysite_access_log common
</VirtualHost>

Alias /th "/var/www/html/mysite/2012/th/"
<Directory /var/www/html/mysite/2012/th>
      #Options Indexes MultiViews
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
</Directory>
############# end mysite #############

No comments:

Post a Comment