SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Running several name-based web sites on a single IP address

    Hi All!

    As I described in the title of this thread, I want to run 2 websites on my Virtual Private Server with a single IP address.

    I'm not an Apache expert so I googled this issue and have read several tutorials and howto's, including Apache's

    My configuration :
    - Webmin 1.470
    - Apache 2.2.8 on Ubuntu Server 8.04.2

    What I've done so far :
    - I set up the two nameservers ns1.myhostingcompany.com and ns2.myhostingcompany.com at my registrar
    - I created a virtual server at Apache Webserver (Address : Any, Port : Any, Server name : mydomain.com, Document roort : /my_root_to_the_HTML_files ) and edited Global configuration for Apache :
    Code:
    <Directory "/my_root_to_the_HTML_files">
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    Restarted Apache and I knew it won't work... Maybe that was my main mistake....

    Anyway, I would appreciate if someone could help me out, before I decide to hire an Apache Server administrator to do this 10 mins job (just an assume....)

    Thank you advanced.
    Best wishes!

    Full time ADMIN - art community
    Part time coder - dsign

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Viktor,

    THe Address: Any, Port: Any looks bad. The address should be your server's IP address and you KNOW that Apache only looks to port 80 (and 443 for SSL). To use anything else is to ask for a server failure.

    Just another word of advice: I suspect that Apache needs its own "localhost" DocumentRoot but you are quite correct in setting up named VirtualHosts for your named domains. NO PROBLEM at all with sharing the IP address. Just be sure that the VH for each specify the {IP_Address}:80 in the httpd-vhosts.conf (as renamed for your distro) file, e.g., I use:
    Code:
    <VirtualHost 127.0.0.1:80>
    ServerName arj
    DocumentRoot W:/ARJ
    ServerPath W:/ARJ
    </VirtualHost>
    ... for a test server (ARJ is an acronym for the real domain - I'm a lazy typist).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you David! AGAIN!

    The Address and Port listening settings I copied from my existing virtual server which is working correctly. Now I'd like to set up another...

    My problem is that I'm not good enough with Apache and Linux generally, so I'm using the Webmin interface to set up the new virtual host.

    I created now a new virtual server :

    Address : IP_of_my_VPS
    Port : 80
    Server name : my_domain.com
    Document root : /var/www/my_domain

    I suppose that should 'create' the lines you were talking about at the httpd.conf or wherever....
    Should be helpful to show some lines from my etc/apache2/apache2.conf to see what's wrong?

    Regards,

    Viktor

    Full time ADMIN - art community
    Part time coder - dsign

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Viktor,

    If you can access the vhosts file on your server, just look for the lines I gave you above as they're all that's required.

    On the other hand, if you have a control panel (I'm not familiar with Webmin), the feeding it the correct values should result in a properly formatted VirtualHost section.

    Hmmm, it may be a deeper problem, though, as DNS must be setup (another likely Webmin task) and the registrar must point to your DNS servers (and, because you're using names for your ns. servers, they need to be registered, too - best to change that to use their IP addresses, too).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    Just another word of advice: I suspect that Apache needs its own "localhost" DocumentRoot but you are quite correct in setting up named VirtualHosts for your named domains. NO PROBLEM at all with sharing the IP address. Just be sure that the VH for each specify the {IP_Address}:80 in the httpd-vhosts.conf (as renamed for your distro) file, e.g., I use:
    Code:
    <VirtualHost 127.0.0.1:80>
    ServerName arj
    DocumentRoot W:/ARJ
    ServerPath W:/ARJ
    </VirtualHost>
    ...

    DK
    David,

    here's a mydomain.com.conf file :
    Code:
    <VirtualHost my_servers_IP:80>
    DocumentRoot "/var/www/my_domain_dir"
    ServerName my_domain.com
    <Directory "/var/www/my_domain_dir">
    allow from all
    Options +Indexes
    </Directory>
    </VirtualHost>
    which is stored in /etc/apache2/sites-enabled/ and is included by the apache2.conf

    That's exactly what you told me to do - I hope... Still, I can't load my page - server can't be found....
    What should I try next, please?

    Thank you for your time, I really appreciate your knowledge!
    Regards,

    VD

    Full time ADMIN - art community
    Part time coder - dsign

  6. #6
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dujmovicv View Post
    David,

    here's a mydomain.com.conf file :
    Code:
    <VirtualHost my_servers_IP:80>
    DocumentRoot "/var/www/my_domain_dir"
    ServerName my_domain.com
    <Directory "/var/www/my_domain_dir">
    allow from all
    Options +Indexes
    </Directory>
    </VirtualHost>
    which is stored in /etc/apache2/sites-enabled/ and is included by the apache2.conf

    That's exactly what you told me to do - I hope... Still, I can't load my page - server can't be found....
    What should I try next, please?

    Thank you for your time, I really appreciate your knowledge!
    Regards,

    VD
    Oh, and something more : I saw somewhere a name server record like :
    Code:
    ns1.domain.com.
    but not :
    Code:
    ns1.domain.com
    what does the dot at the end mean and which is the correct record?

    Full time ADMIN - art community
    Part time coder - dsign

  7. #7
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Viktor,

    I'm guessing that you're trying to create a public (rather than a test) server, otherwise, I'd whine about using the .com tld. Otherwise, your VirtualHost section looks sufficient.

    Unfortunately, I'm NOT a DNS expert - I have to rely on the notes supplied with the control panel (one host) or other settings (current host) to determine what they should look like. I remember that the dot after is important but I don't remember when that's the case. I can get away with just modifying the hosts file on my test server's computer rather than playing with a DNS daemon.

    The way my last week has gone, I'm sure I'd suggest the wrong thing. Perhaps I should move this thread to the SERVER board in the forum?

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  8. #8
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    Perhaps I should move this thread to the SERVER board in the forum?
    David,

    please feel free to move this thread anywhere you think better place from this one! In that case I will try to explain my problem in details :

    I have my own virtual private server on the web at which I'm already hosting a service (website). The DNS and the webserver Apache is configured and is working perfect.
    Now I need to host another website, which was hosted at the registrar company's server. Unfortunately they don't offer MySql support, so I have to move the site to my VPS. I already changed the DNS record at my account at the mentioned company's server, so now I have to set up the web server at my VPS to show my website when someone types the address...

    Hope it's clear to you guys (my English is not as perfect...) and I really hope someone can help me.....

    Thank you advanced!
    Regards,

    Victor

    Full time ADMIN - art community
    Part time coder - dsign

  9. #9
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Viktor,

    If you have the above VirtualHost in the correct file (which I believe you do) and your registrar is pointing at your VPS, the only problem must be in setting up the DNS at your VPS. I'd just recommend that you duplicate your first domain's DNS data for your second domain. With the propagation time of 24-72 hours, your second domain should be ready to go.

    Finally, your English appears far better than 90&#37; of those from English-speaking countries. Your accent, though, could use some work!



    Okay, I'll move this thread to get some better DNS experts looking at it.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  10. #10
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your professional opinion and for the compliment too! I promise I will work on my accent!

    Attached hereby the screenshot of the DNS record at my VPS account (I just duplicated the previous one, with the changed domain names of course). There are the dots at the end of the name servers which I was talking about.

    I changed the records at my registrar now to ns1.vpslink.com WITHOUT the dots and will wait 24-72 hours to see the effect... Hopefully it will work...

    In the meantime, I will appreciate if someone warns me on a mistake I've done somewhere........

    Regards
    Attached Images Attached Images

    Full time ADMIN - art community
    Part time coder - dsign

  11. #11
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Viktor,

    That's much better! Not much accent at all!

    I just checked my DNS and both the NS record and the CNAME records have the dot after the domain name (e.g., dns.dklynn.com. and datakoncepts.com.). Go change your DNS records to add the trailing dot.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  12. #12
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    David,

    THANK you for not giving up on me!!!!
    I checked the DNS records again, ADDED the dots at the end AND corrected the CNAME records (there was an error - a typing one ). Now it's working perfectly, the effect was immediate! It turned out that I configured the Apache server correctly! Good for me...

    Thanks again and best regards!

    Viktor

    Full time ADMIN - art community
    Part time coder - dsign


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •