CentOS Perfect Server: Sub-domain Generating 403 Forbidden

Discussion in 'Installation/Configuration' started by crypter, Apr 8, 2014.

  1. crypter

    crypter New Member

    Hi guys. I have installed ISPConfig as instructed by the Perfect Server guide for CentOS 6.4. I've also created multiple sites and sub-domains without any issues. However this particular sub-domain is giving me a problem. It's generating a 403 Forbidden when trying to navigate to it.

    I have verified the directory for the sub-domain is owned by the correct user/group and is 755. I've also verified the directory has an index.html file which is 644.

    When I compare this sub-domain with my many working others - it is setup identical.

    Lastly, when I navigate to the directory the sub-domain points to it works fine and I don't get a 403 error. Meaning, if I go to sub.domain.com I get 403, but if I go to domain.com/sub/ it works fine.

    Does anybody have any insight or potential ideas I could try? Thanks!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Check the dns of the subdomain, it should point to the same ip address then the domsin of the msin website. If thats ok, then check if the vhost file of this website has been saved with a .err file ending.
     
  3. crypter

    crypter New Member

    Hi till.

    I verified the DNS is correct. I have the subdomain's A record pointing to the same IP address (the IP of the server) that the others are pointing to. I also verified that the vhost file is correctly ending in '.vhost' and not '.err'

    I also just took a look into the vhost file and the redirect configs are exactly like the others that are working:

    Code:
    <VirtualHost *:80>
                    DocumentRoot /var/www/domain.cc/web
    
                    ServerName domain.cc
                    ServerAlias www.domain.cc
                    ServerAlias dev.domain.cc
                    ServerAlias blog.domain.cc
                    ServerAlias box.domain.cc
                    ServerAdmin [email protected]
    
                    ErrorLog /var/log/ispconfig/httpd/domain.cc/error.log
    Code:
                    RewriteEngine on
                    RewriteCond %{HTTP_HOST}   ^dev\.domain\.cc$ [NC]
                    RewriteCond %{REQUEST_URI} !^/webdav/
                    RewriteCond %{REQUEST_URI} !^/dev/
                    RewriteRule   ^/(.*)$ /dev/$1  [L]
                    RewriteCond %{HTTP_HOST}   ^blog\.domain\.cc$ [NC]
                    RewriteCond %{REQUEST_URI} !^/webdav/
                    RewriteCond %{REQUEST_URI} !^/blog/
                    RewriteRule   ^/(.*)$ /blog/$1  [L]
                    RewriteCond %{HTTP_HOST}   ^box\.domain\.cc$ [NC]
                    RewriteCond %{REQUEST_URI} !^/webdav/
                    RewriteCond %{REQUEST_URI} !^/box/
                    RewriteRule   ^/(.*)$ /box/$1  [L]
    In the above example, blog.domain.cc and box.domain.cc are working, but not dev.domain.cc.

    Here is also just a directory listing in case it helps:

    /web directory:
    Code:
    drwxr-xr-x  5 web15 client2 4.0K Apr  8 22:46 blog
    drwxr-xr-x  9 web15 client2 4.0K Mar 13 15:02 box
    drwxr-xr-x  2 web15 client2 4.0K Apr  8 17:24 dev
    /web/dev directory:
    Code:
    drwx--x--- 11 web15 client2 4.0K Apr  8 16:40 ..
    -rw-r--r--  1 web15 client2   12 Apr  8 16:39 index.html
    For the heck of it I tried just deleting it and recreating it, but that didn't solve anything. Grrr.
     
  4. crypter

    crypter New Member

    So I think there is just a problem with using the word "dev" in either the subdomain or redirect path or something. Because I just set up 2 more subdomains on the same site and those two are working perfectly. This could be a bug in the software I'm thinking.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    I dont know which software you use in that website which might has reserved a folder or alias named dev, at least its not a problem related to ispconfig as the word dev is not used for any folders nor does it has a special meaning in ispconfig.
     
  6. crypter

    crypter New Member

    Hmm okay till. Not sure what else it could be, but nevertheless, I guess I'll just have to use something other than "dev". Thanks for all your input though! Super helpful as always! :)
     

Share This Page