User Space CNAMES

Discussion in 'General' started by bluethunder82, Dec 29, 2006.

  1. bluethunder82

    bluethunder82 Member

    Ok I have created the co-domain. When I type in the username I get the following error now:

    ---
    Not Found

    The requested URL / was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    ---

    This to me seems like I'm now just having problems creating my directive. As before any ideas would be appreciated. I'm trying to do some more reading to see what else I can try.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Co-Domains are not the same as DNS. A co-domain is a alias domain of a apache vhost and not a DNS record. DNS-Records are managed in the DNS-Manager. If a domain is not an alias for a vhost, you can not do any rewriting for this domain in the vhosts.
     
  3. bluethunder82

    bluethunder82 Member

    Ok then what would you recommend I try?

    I have a DNS record point to the IP address of my sever.
    I have entered my apache directive (as per posted).
    I have created a co-domain.

    I receive the error mentioned previously.

    With a co-domain created this creates a vhost entry so that the respective directive will be initied?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Can you post the real Co-Domain name here?
     
  5. bluethunder82

    bluethunder82 Member

    Yes I am trying to use 'jason'. However, I have kept the wildcards from the examples to see if in the future all I need to do is create the appropriate records and not have to update the directive.
     
  6. falko

    falko Super Moderator Howtoforge Staff

    jason is no FQDN. jason.example.com would be a FQDN, but jason is not. Please post the FQDN.
     
  7. bluethunder82

    bluethunder82 Member

    Sorry Falko,
    The address is: jason.shewchuk.ca

    And the user name is web7_jason.

    I have not changed the index.html file for my user.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Is 142.179.186.168 your server's IP address?
    What's the output of
    Code:
    ifconfig
    ?
    What's in Vhosts_ispconfig.conf?
     
  9. bluethunder82

    bluethunder82 Member

    I'm not sure what you are looking for. The server is correctly configured ie I haven't made any changes from the default install. Just having trouble with the mod_rewrite. I am having no other unusual problems.

    RewriteEngine on
    RewriteLog /tmp/rewShewchuk.log
    RewriteLogLevel 3
    RewriteCond %{HTTP_HOST} ^.+.shewchuk.ca$
    RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
    RewriteRule [^.]+.shewchuk.ca(.*) /var/www/web1/user/web1_$1$2
     
    Last edited: Jan 22, 2007
  10. falko

    falko Super Moderator Howtoforge Staff

    What are you trying to do with
    Code:
    RewriteCond %{HTTP_HOST} ^.+.shewchuk.ca$
    RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
    RewriteRule [^.]+.shewchuk.ca(.*) /var/www/web1/user/web1_$1$2
    ?
     
  11. bluethunder82

    bluethunder82 Member

    I am trying to use mod_rewrite to allow a user to type jason.shewchuk.ca and access the files stored within the users space normally accessed through shewchuk.ca/~jason.

    As per first post.
     
  12. bluethunder82

    bluethunder82 Member

    I was able to solve my mod_rewrite problem. As I suspected it was a problem with my rewrite command. I finally got the book "The Definitive Guide to Apache mod_rewrite" today in the mail today. I recommend it, using the wildcard information in the book I was able to create the script I needed.

    Thx for the help.
     
  13. bluethunder82

    bluethunder82 Member

    For those interested in having the ability to go username.domain.ca then you can use this general mod_rewrite:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.
    RewriteCond %{HTTP_HOST} ^([^.]+).[domain.ca]
    RewriteRule ^/(.*)$ /var/www/web[IDNumber]/user/web[IDNumber]_%1/web/$1 [L]

    Replace domain with your own domain and [IDNumber] with the ID number assigned from ISPConfig.

    This is the simplest method. If you want to address error handling etc then you need to customize and add a few extra lines.
     

Share This Page