Apache Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex79
    Confirmed User
    • Jun 2002
    • 996

    #1

    Apache Problem

    All my domains from VirtualHost are redirected to same documentroot (the documentroot of 1st VirtualHost

    here is the sample from httpd.conf:

    Code:
    <VirtualHost *:80>
    ServerName site1.com
    DocumentRoot /home/www/site1.com
    </VirtualHost> 
    
    <VirtualHost *:80>
    ServerName site2.com
    DocumentRoot /home/www/site2.com
    </VirtualHost>
    But both site1.com and site2.com requests are redirected to /home/www/site1.com

    What can be wrong?
    Last edited by alex79; 08-19-2005, 11:28 AM.
  • psili
    Confirmed User
    • Apr 2003
    • 5526

    #2
    Hosts file issue?
    Or you could try:

    ServerAlias site1.com

    and ServerAlias site2.com

    in each virtual host?
    Your post count means nothing.

    Comment

    • alex79
      Confirmed User
      • Jun 2002
      • 996

      #3
      Originally posted by psili
      Hosts file issue?
      Or you could try:

      ServerAlias site1.com

      and ServerAlias site2.com

      in each virtual host?

      i've added ServerAlias site1.com and ServerAlias site2.com in each virtual host but still redirect site2.com to site1.com

      Comment

      • broke
        Confirmed User
        • Aug 2003
        • 4501

        #4
        Have you restarted apache since the httpd configuration changes?
        Perfect Gonzo

        Comment

        • broke
          Confirmed User
          • Aug 2003
          • 4501

          #5
          Post the whole httpd.conf file...
          Perfect Gonzo

          Comment

          • alex79
            Confirmed User
            • Jun 2002
            • 996

            #6
            Originally posted by broke
            Have you restarted apache since the httpd configuration changes?

            sure i've restarted apache

            Comment

            • chaze
              Confirmed User
              • Aug 2002
              • 9774

              #7
              It's acting like domain one is the hostname for the server, and the second host is just directing to the hostname directory. Neither is actually working.
              Like the desert needs the rain
              We do fully manged WordPress, VPS, and Servers. Adult Host Pro https://adulthostpro.com/ Since 2001

              Comment

              • tgpmakers
                Confirmed User
                • Feb 2004
                • 575

                #8
                Are u certain you've got defferent .html index files in each directory so you can tell the difference. Are you using different IP addresses for each domain if so are the details the same with bind and apache?
                http://www.tgpmakers.com/

                Comment

                • E Guru
                  Confirmed User
                  • Jul 2005
                  • 658

                  #9
                  are you typing www when you visit the site?
                  add *.domain.com to server alias
                  Guru

                  Comment

                  • alex79
                    Confirmed User
                    • Jun 2002
                    • 996

                    #10
                    Originally posted by E Guru
                    are you typing www when you visit the site?
                    add *.domain.com to server alias

                    ok.. this was wrong.. i've forgeted to add * to the serveralias.. now is working

                    Comment

                    Working...