how to create a sub-domain in Apache or mysql database and make a user name and password to access it?

Posted on Jun 16, 2008 under domain news and reports | 43 Comments

43 Responses to “how to create a sub-domain in Apache or mysql database and make a user name and password to access it?”

  1. A subdomain is configured by virtual host entries in httpd.conf.
    Here is an example of what the file should look like:

    Listen 80
    NameVirtualHost *

    <VirtualHost *>
    ServerName http://www.domain.com
    DocumentRoot /home/httpd/htdocs/
    </VirtualHost>

    <VirtualHost *>
    ServerName subdomain.domain.com
    DocumentRoot /home/httpd/htdocs/subdomain/
    </VirtualHost>

    To create a username and password you will need to create or edit your .htaccess file.

    You need at least four lines in .htaccess to set up password protection:
    AuthName "Realm name"
    AuthType Basic
    AuthUserFile /BASEDIR/.htpasswd
    require valid-user

    /BASEDIR/ is the path to your root directory.

    AuthName: Realm name a piece of text that appears on the dialogue box asking for the password. See what it does in practice and then you can decide what text you would like here.

    AuthType: Only Basic is possible at present.

    AuthUserFile: The existence of the AuthUserFile line suggests that you can call the .htpasswd file something else. That is true, but is best to call it .htpasswd, so that nobody can view its contents.

    require: This says that any user validated by password is allowed.

    As well as these entries in the .htaccess file, you will need to set up a .htpasswd file

    The format of this file is simple. It consists of a series of usernames and passwords. Each line holds one username and the single password associated with it, separated by a colon. Here is an example:

    frances:WrU808BHQai36
    john:iABCQFQs40E8M
    lisa:FAdHN3W753sSU

    You may think these passwords are rather unrealistic and difficult to remember – the reason for this is that they are encrypted for security. The .htpasswd file does not hold the actual passwords in clear text – it holds them in a coded form. If you are running Apache (at least on Unix) there is a command called htpasswd which will translate clear text passwords into this encrypted form. What many webmasters do is use an on-line tool to do this translation.

  2. Recent Blogroll Additions……

    [...]usually posts some very interesting stuff like this. If you’re new to this site[...]……

  3. Related……

    [...]just beneath, are numerous totally not related sites to ours, however, they are surely worth going over[...]……

  4. Gems form the internet…

    [...]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[...]……

  5. Visitor recommendations…

    [...]one of our visitors recently recommended the following website[...]…

  6. Recommeneded websites…

    [...]Here are some of the sites we recommend for our visitors[...]……

  7. Sources…

    [...]check below, are some totally unrelated websites to ours, however, they are most trustworthy sources that we use[...]……

  8. Gems form the internet…

    [...]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[...]……

  9. Websites you should visit…

    [...]below you’ll find the link to some sites that we think you should visit[...]……

  10. Online Article……

    [...]The information mentioned in the article are some of the best available [...]……

  11. Sites we Like……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  12. Check this out…

    [...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[...]……

  13. Blogs ou should be reading…

    [...]Here is a Great Blog You Might Find Interesting that we Encourage You[...]……

  14. Another Title…

    I saw this really good post today….

  15. Superb website…

    [...]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[...]……

  16. Tumblr article…

    I saw someone talking about this on Tumblr and it linked to…

  17. Recommeneded websites…

    [...]Here are some of the sites we recommend for our visitors[...]……

  18. Recent Blogroll Additions……

    [...]usually posts some very interesting stuff like this. If you’re new to this site[...]……

  19. Gems form the internet…

    [...]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[...]……

  20. News info…

    I was reading the news and I saw this really cool topic…

  21. Blogs ou should be reading…

    [...]Here is a Great Blog You Might Find Interesting that we Encourage You[...]……

  22. Tumblr article…

    I saw someone writing about this on Tumblr and it linked to…

  23. Websites worth visiting…

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……

  24. Gems form the internet…

    [...]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[...]……

  25. We got a nice list…

    [...]juicy site with free links, on filesonic, mediafire, megaupload, fileserve, rapidshare[...]……

  26. Sites we Like……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  27. Websites you should visit…

    [...]below you’ll find the link to some sites that we think you should visit[...]……

  28. Related……

    [...]just beneath, are numerous totally not related sites to ours, however, they are surely worth going over[...]……

  29. agria bra kattförsäkring…

    [...]n Finally a person who’s writing about something other than superficioul subj 12[...]…

  30. karta paris…

    [...]j I own a similar website to this one and I was just curious if you get a lot ge[...]…

  31. Websites worth visiting…

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……

  32. Websites you should visit…

    [...]below you’ll find the link to some sites that we think you should visit[...]……

  33. ……

    Great post, I conceive website owners should acquire a lot from this web blog its rattling user pleasant….

  34. Looking around…

    While I was browsing yesterday I noticed a excellent post concerning…

  35. Check this out…

    [...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[...]……

  36. News info…

    I was reading the news and I saw this really interesting topic…

  37. Yahoo results…

    While searching Yahoo I discovered this page in the results and I didn’t think it fit…

  38. Links…

    [...]Sites of interest we have a link to[...]……

  39. Tumblr article…

    I saw someone writing about this on Tumblr and it linked to…

  40. … [Trackback] …

    [...] There you will find 64018 more Infos: getportals.com/2008/06/16/how-to-create-a-sub-domain-in-apache-or-mysql-database-and-make-a-user-name-and-password-to-access-it/ [...] …

  41. … [Trackback] …

    [...] Read More: getportals.com/2008/06/16/how-to-create-a-sub-domain-in-apache-or-mysql-database-and-make-a-user-name-and-password-to-access-it/ [...] …

  42. Websites worth visiting…

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……

  43. Sources…

    [...]check below, are some totally unrelated websites to ours, however, they are most trustworthy sources that we use[...]……

Leave a Reply