Apache Config with ISPConfig

Discussion in 'General' started by KishCom, Jun 13, 2006.

  1. KishCom

    KishCom New Member

    I'm pretty new to this ISPConfig, but I've got it up and running on Fedora Core 4, and I''ve got a test site entered in with a user setup and everything. I can't seem to access the site though.
    I've tried:
    http://mysite.com/users/web1_username/index.html
    http://mysite.com/~web1_username/index.html
    http://mysites_ip/users/web1_username/index.html
    http://mysites_ip/~web1_username/index.html

    And they all give me 404's.
    if I visit just http://mysite.com I get the Apache Test Page - is that supposed to happen?
    When I restart the httpd process I get this warning which I know has something to do with the problem, I just don't know how to fix it:
    Code:
    Starting httpd: [Tue Jun 13 15:43:06 2006] [warn] NameVirtualHost 70.54.180.143:80 has no VirtualHosts
    
    How do I configure my site's preview?
     
    Last edited: Jun 13, 2006
  2. falko

    falko Super Moderator ISPConfig Developer

    No, that's not ok.
    What's the output of
    Code:
    ifconfig
    ?
    What's in Vhosts_ispconfig.conf?
     
  3. KishCom

    KishCom New Member

    ifconfig (omitted the loop back)
    Code:
    
    eth0      Link encap:Ethernet  HWaddr 00:0A:E6:A4:30:C1
              inet addr:192.168.128.106  Bcast:192.168.128.255  Mask:255.255.255.0
              inet6 addr: fe80::20a:e6ff:fea4:30c1/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:43329 errors:0 dropped:0 overruns:0 frame:0
              TX packets:45267 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:14377734 (13.7 MiB)  TX bytes:17140478 (16.3 MiB)
              Interrupt:5 Base address:0xdc00
    
    and my Vhosts_ispconfig.conf - I don't know too too much about apache config files, but I'm pretty sure that NameVirtualHost is duplicated (which is why it's outputing that error). I tried taking out the second one, it does remove the warning, but does nothing for my original problem. (ip address hidden with x's ... there's actual numbers there IRL)
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 70.x.x.x:80
    <VirtualHost 70.x.x.x:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    NameVirtualHost 70.x.x.x:80
    <VirtualHost 70.x.x.x:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: www.mysite.com:80
    ######################################
    #
    #
    <VirtualHost 70.x.x.x:80>
    ServerName www.mysite.com:80
    ServerAdmin [email protected]
    DocumentRoot /home/www/web1/web
    ServerAlias 2hotnsexy.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /home/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web1/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php3>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php4>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web1/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web1/phptmp/
    php_admin_value session.save_path /home/www/web1/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/home/www/web1/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    </VirtualHost>
    #
    #
    
     
  4. falko

    falko Super Moderator ISPConfig Developer

    You're using the wrong IP address in ISPConfig! You must use 192.168.128.106 instead of 70.x.x.x.
     
  5. KishCom

    KishCom New Member

    That solves one problem. I now get the proper 'shared ip' page.
    However it seems Apache is still ignoring my ispconfig vhosts file.

    When I visit http://70.x.x.x/~web3_admin
    It gives me a 404 and I check the apache error logs I see:
    [Wed Jun 14 11:59:18 2006] [error] [client 192.168.128.1] File does not exist: /var/www/sharedip/~web3_admin
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can never use your IP address to connect to a website cretaed in ISPConfig. ISPConfig uses nambased vhosts. Use the domain instaed of the IP address!
     
  7. KishCom

    KishCom New Member

    Am I misunderstanding the purpose of these lines in the vhosts file?
    Code:
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web3/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web3/user/$1/web/$3
    
    I'd very much like to preview sites before I switch nameservers over - rather than switching them over risk having compatibility issues when migrating.
    Even for showing new customers before their domain has propagated.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    These lines are for the user website feature. See user manual (client) chapter 2.2.9

    Then you have to add the domain with the correct IP to the hosts file on your workstation, thats possible on windows and linux.
     
  9. KishCom

    KishCom New Member

    That's a lot of work for clients to do.
    I've used some trickery in the httpd.conf and in the .htaccess of the sharedip folder to accomplish what I wanted.
    Does ISPConfig ever rewrite the httpd.conf file? If so where can I find the script that does it?
     
  10. falko

    falko Super Moderator ISPConfig Developer

    It rewrites the Vhosts_ispconfig.conf. But you can use your own directives using the Apache Directives field in ISPConfig.


    Have a look at the function make_vhost() in /root/ispconfig/scripts/lib/config.lib.php.
     

Share This Page