Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Apache Help
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Apache Help

PacketVMPacketVM Member, Host Rep
edited November 2012 in Help

Bit of apache help needed please..

Trying to configure VirtualHosts. I have set up the files in /apache2/sites-available and have set the DocumentRoots to the corresponding root of the website. I've also enabled the sites using a2ensite.

However, all of the sites are displaying the same content (the content from the root of the default site)

«1

Comments

  • Do the sites appear in the sites-enabled directory?

  • jhjh Member

    What does the error_log say?

  • In the first enabled vhost definition (usually /apache2/sites-available/default) or somewhere before the first is processed, put this at the top:

    NameVirtualHost 123.132.13.123:80

    Replace with your IP address.

  • PacketVMPacketVM Member, Host Rep

    @abat said: Do the sites appear in the sites-enabled directory?

    They do

    @jhadley - doesn't seem to say anything

  • PacketVMPacketVM Member, Host Rep

    @tortau said: In the first enabled vhost definition (usually /apache2/sites-available/default) or somewhere before the first is processed, put this at the top:

    NameVirtualHost 123.132.13.123:80

    Replace with your IP address.

    • Restarting web server apache2 [Fri Nov 09 20:17:43 2012] [warn] NameVirtualHost 217.172.140.43:80 has no VirtualHosts
      ... waiting [Fri Nov 09 20:17:44 2012] [warn] NameVirtualHost 217.172.140.43:80 has no VirtualHosts
  • DewlanceVPSDewlanceVPS Member, Patron Provider
    edited November 2012

    You need to add this line in your apache config file(Before domain configuration line)

    VirtualHost 217.172.140.43
    (Please search in google, I can't remember exact line )

  • PacketVMPacketVM Member, Host Rep

    @DewlanceVPS said: You need to add this line in your apache config file

    Didn't work

  • do you have

    Include sites-enabled/

    in your httpd.conf or apache2.conf ?

  • PacketVMPacketVM Member, Host Rep

    Yes, I do. It's getting the default site, however all sites are displaying the same stuff, despite virtualhosts being set up

  • Silly question, are all the sites pointed to the same directory by chance?

  • PacketVMPacketVM Member, Host Rep

    @connercg said: Silly question, are all the sites pointed to the same directory by chance?

    Directory and DocumentRoot's are all different (for the different sites).

  • are there any virtualhosts in your apache2.conf?

  • PacketVMPacketVM Member, Host Rep

    @camarg said: are there any virtualhosts in your apache2.conf?

    No

  • show us the results of

    /usr/sbin/apache2ctl -S
  • PacketVMPacketVM Member, Host Rep
    root@server1:/etc/apache2# /usr/sbin/apache2ctl -S
    VirtualHost configuration:
    wildcard NameVirtualHosts and _default_ servers:
    *:80                   is a NameVirtualHost
             default server server1.dominicl.me (/etc/apache2/sites-enabled/000-default:1)
             port 80 namevhost server1.dominicl.me (/etc/apache2/sites-enabled/000-default:1)
             port 80 namevhost dev.dominicl.me (/etc/apache2/sites-enabled/dev.dominicl.me:1)
             port 80 namevhost server1.dominicl.me (/etc/apache2/sites-enabled/server1.dominicl.me:1)
    Syntax OK

    As you will see, dominicl.me and server1.dominicl.me display the same

  • service httpd restart

  • PacketVMPacketVM Member, Host Rep

    @24khost said: service httpd restart

    I have tried that one ;) See above.

  • PacketVMPacketVM Member, Host Rep

    Somebody, help :P

  • Try removing the default vhost file.

  • PacketVMPacketVM Member, Host Rep

    @NickM said: Try removing the default vhost file.

    Still not working.

    server1.dominicl.me is displaying the contents in the dominicl.me root folder.

  • PacketVMPacketVM Member, Host Rep

    Please close.

  • Care to share with us what the problem ultimately was?

  • SimpleNodeSimpleNode Member
    edited November 2012
  • PacketVMPacketVM Member, Host Rep
    edited November 2012

    Just going to use shared for now - easier and less management in the long run. I've got another use for this server :)

  • SimpleNodeSimpleNode Member
    edited November 2012

    @dominicl said: Just going to use shared for now - easier and less management in the long run. I've got another use for this server :)

    Just install Kloxo or something. We even have a kloxo host-in-a-box template ;)

  • Maybe I'm misreading something, but it looks like the hostname "server1.dominicl.me" will be matched by the first vhost and so will serve content from the site defined in "/etc/apache2/sites-enabled/000-default". The 4th vhost, with the same hostname but pointing at "/etc/apache2/sites-enabled/server1.dominicl.me" will never be available, since the hostname will match the earlier vhost entry.

  • @kiwidave yes, you're right but even though, dev.dominicl.me should serve it's unique content. There must be other misconfigurations also.

  • MaouniqueMaounique Host Rep, Veteran

    a simple panel like kloxo or ehcp will solve the problem at a minimal performance penalty and will also automate other things like ftp and all.

Sign In or Register to comment.