Problems with Apache2/Vhosts

Discussion in 'Installation/Configuration' started by mimique, May 14, 2007.

Thread Status:
Not open for further replies.
  1. mimique

    mimique New Member

    Hello there,

    Im experiencing some problems with my brand new ISPConfig installation. I followed the tutorial at http://www.howtoforge.com/perfect_setup_debian_etch.

    Normally when you add a vhost and reload apache it will show when is dead, but here it just loads.

    I've set logging to debug, and watched in my apache logfile what's happening, but it doesn't show much information.

    Code:
    [Mon May 14 06:25:41 2007] [error] [client 62.177.151.49] File does not exist: /htdocs
    [Mon May 14 06:28:33 2007] [error] [client 192.168.1.100] File does not exist: /htdocs
    ISPConfig writes the vhosts normally to /etc/apache2/vhosts/Vhosts_ispconfig.conf, and don't seem faulty to me.

    The problem is that he gives the message that he's looking for the htdocs folder, which normally isn't in the ispconfig config.

    I've searched through the apache configfiles, but i cant find a configline with htdocs in it?

    Code:
    Not Found
    
    The requested URL / was not found on this server.
    Apache/2.2.3 (Debian) PHP/4.4.4-8+etch2 mod_ssl/2.2.3 OpenSSL/0.9.8c Server at home.leetmimic.nl Port 80
    Anyone that can help me out with this?
     
  2. Hans

    Hans Moderator ISPConfig Developer

    Hi,

    Do you have the line:

    Include /etc/apache2/vhosts/Vhosts_ispconfig.conf

    At the end of your /etc/apache2/apache2.conf file?

    If you've to add this line, please restart apache afterwards with:

    /etc/init.d/apache2 restart
     
  3. mimique

    mimique New Member

    Yes i have :)
     
  4. Hans

    Hans Moderator ISPConfig Developer

    Please check if in ISPConfig under Management > Settings > Web the document Root has been set to: /var/www

    (This is the default document root for ISPConfig).
     
  5. mimique

    mimique New Member

    Yeah it's configured like that:

    http://leetmimic.nl/panel.jpg
     
  6. Hans

    Hans Moderator ISPConfig Developer

    Probably there is an error within your Apache configuration.
    Please do the following:

    - Make a backup of /etc/apache2/vhosts/Vhosts_ispconfig.conf
    - Rename the latest file /etc/apache2/vhosts/Vhosts_ispconfig.conf_.... that has a date appended to /etc/apache2/vhosts/Vhosts_ispconfig.conf
    - run

    httpd -t

    Please post here the output of the error message..
     
  7. mimique

    mimique New Member

    There is none ending with a date, only an ~
    Code:
    home:/etc/apache2/vhosts# ls -la
    total 16
    drwxr-xr-x 2 root root 4096 2007-05-14 06:57 .
    drwxr-xr-x 8 root root 4096 2007-05-14 06:48 ..
    -rw-r--r-- 1 root root 2151 2007-05-14 09:08 Vhosts_ispconfig.conf
    -rw-r--r-- 1 root root 2123 2007-05-14 09:08 Vhosts_ispconfig.conf~
     
  8. Hans

    Hans Moderator ISPConfig Developer

    Please remove Vhosts_ispconfig.conf~

    Afterwards restart Apache2 with:
    /etc/init.d/apache2 restart

    For sure restart ISPConfig with:
    /etc/init.d/ispconfig_server restart

    Try to add a new vhost via ISPConfig now...
     
  9. mimique

    mimique New Member

    Im getting some errors now:

    Code:
    home:/etc/apache2/vhosts# rm Vhosts_ispconfig.conf~
    home:/etc/apache2/vhosts# /etc/init.d/apache2 restart
    Forcing reload of web server (apache2)...[COLOR="Red"][Mon May 14 10:15:33 2007] [warn] NameVirtualHost 83.98.234.199:80 has no VirtualHosts
    [Mon May 14 10:15:43 2007] [warn] NameVirtualHost 83.98.234.199:80 has no VirtualHosts[/COLOR]
    .
    home:/etc/apache2/vhosts# /etc/init.d/ispconfig_server restart
    Shutting down ISPConfig system...
    /root/ispconfig/httpd/bin/apachectl stop: httpd stopped
    ISPConfig system stopped!
    Starting ISPConfig system...
    Apache/1.3.37 mod_ssl/2.8.28 (Pass Phrase Dialog)
    Some of your private key files are encrypted for security reasons.
    In order to read them you have to provide us with the pass phrases.
    
    Server [COLOR="Red"][B]home.leetmimic.nl.home.leetmimic.nl[/B][/COLOR]:81 (RSA)
    Enter pass phrase:
    
    Ok: Pass Phrase Dialog successful.
    /root/ispconfig/httpd/bin/apachectl startssl: httpd started
    ISPConfig system is now up and running!
    And why is my host like that, any idea?

    Going to try to add a vhost now

    edit:

    While taking a look in the Vhost file, something took my attention:

    Two times the same vhost?

    Changed it to:
    And that solved the error for apache:
    Code:
    home:/etc/apache2/vhosts# /etc/init.d/apache2 restart
    Forcing reload of web server (apache2)....
    
    --------
    edit: After adding a vhost the piece of code for the host on my IP address appears twice again, and the vhost does not work

    Still seeing the errors in error.log at /var/www/apache2/error.log:
    Code:
    [Mon May 14 10:26:41 2007] [error] [client 192.168.1.100] File does not exist: /htdocs
    [Mon May 14 10:26:42 2007] [error] [client 192.168.1.100] File does not exist: /htdocs
    [Mon May 14 10:26:42 2007] [error] [client 192.168.1.100] File does not exist: /htdocs
     
    Last edited: May 14, 2007
  10. Hans

    Hans Moderator ISPConfig Developer

    Please post the output of

    hosname
    hostname -f

    What is the The hostname, domainname and IP-adddress within ISPConfig under Management > Server > Settings?

    What is the content of /etc/hosts ?

    I think something is wrong with your Apache configuration.
    When i visit your server via http://youripaddress then i do not see the default sharedIP screen...
     
    Last edited: May 14, 2007
  11. mimique

    mimique New Member

    Hmm im guessing that is something that isn't right, the first one should be home, and -f leetmimic.nl, am i right?

    http://www.leetmimic.nl/ispconfig2.jpg
     
    Last edited: May 14, 2007
  12. Hans

    Hans Moderator ISPConfig Developer

    I've visited http://www.leetmimic.nl/

    Did you see that? :confused:

    When i do a ping to leetmimic.nl or www.leetmimic.nl the IP-address is shown as: 87.239.10.75
    This is not your external IPaddress, which is 83.98.234.199.
     
  13. mimique

    mimique New Member

    Yep i know that, that is an other server.

    When you ping home.leetmimic.nl you'll see it is going to 83.98.234.199. Same goes for mimic.speedxs.nl.

    No worries :)
     
  14. Hans

    Hans Moderator ISPConfig Developer

    The output of hostname AND hostname -f should be then:

    home.leetmimic.nl

    Please correct it within ISPConfig and correct /etc/hosts as well.

    The IP-address within ISPConfig under Management > Settings > Server should be the external IP-address of your Internet connection.
     
    Last edited: May 14, 2007
  15. mimique

    mimique New Member

    That is how it is, and how it was from the beginning :)
     
  16. mimique

    mimique New Member

    I've reinstalled apache, and checked all configfiles for apache, but im keeping the error. Im confused and don't know where to look further... :confused:
     
  17. Hans

    Hans Moderator ISPConfig Developer

    Is the IP address that you use listed in the output of:

    ifconfig
     
  18. mimique

    mimique New Member


    Nope its in my network, and i opened some ports to the server, the actual ip address is 192.168.1.114
     
  19. Hans

    Hans Moderator ISPConfig Developer

    I think you made some mistakes within your host/netwerkconfiguration.
    I suggest to perform the next steps.
    Here we go:

    If you're sure that 192.168.1.114 is the IP-address of your server within your network and leetmimic.nl is your hostname, then do the following:

    Change the first 2 lines within your /etc/hosts within:

    127.0.0.1________localhost.localdomain____localhost____home
    192.168.1.114____home.leetmimic.nl_______home

    (note: ___ = space, so do not copy this).

    (If you want to keep your current settings within etc/hosts, first make a backup of the file).

    Make sure that you've the following lines within your /etc/network/interfaces

    # The primary network interface
    auto eth0
    iface eth0 inet static
    address 192.168.1.114
    netmask 255.255.255.0
    gateway 192.168.1.1

    Note: if your netmask/gateway is different, please adapt it!

    After modifying the file, perform the command:

    /etc/init.d/networking restart

    Shutdown the server and perform the commands:

    hostname
    hostname -f

    The output of hostname & hostname -f must be: home.leetmimic.nl

    After you perform the command ifconfig, you should see the IP-address 192.168.1.114 for eth0.


    Within ISPConfig under management >settings >server, make sure that you've:

    hostname: www
    domain: leetmimic.nl
    IP Address: 192.168.1.114 (Enter here your internal IP address)
     
    Last edited: May 15, 2007
  20. mimique

    mimique New Member

    Its just like that how my network is configured, i've made a diagram how my network is set up plus some additional information about hostnames and ipaddress configs:

    http://www.leetmimic.nl/network.png

    The main problem is that ispconfig doesnt load the vhosts? or it does, but it doesnt show the right page. And the thing i cant figure out is why he tries to open a directory called htdocs, which i cant find in the configuration of apache either.
     
Thread Status:
Not open for further replies.

Share This Page