Support » Installing WordPress » Creating a virtual host using webmin: settings, directives, experience and beha

  • hello dear wordpress-experts,

    I’m currently working on a setup of a server to host multiple websites on a single IP.
    i am on openSuse and Webmin.

    configurations and setup: i have installed Webmin on an OpenSuse-server. I created the directory /var/www/sites/my_testsite. Then I created a virtual host under Webmin->Servers->Apache Webserver with the following settings:

    
    Address: Any
    Port: 80
    Document Root: /var/www/sites/my_testsite
    Server Name: my_testsite.com

    Then, to test it, I edited the hosts file on my local machine and added
    [my.server.ip.address] my_testsite.com

    Then went to my_testsite.com in my browser and encountered a issue:
    The problem i encountered: the browser is loading the default site (at /var/www) instead of the virtual one I just have been creating (I verfied this by adding different index.html files in /var/www and /var/www/sites/my_testsite).

    Well i muse what goes wrong here at the moment:

    I have written down the directives and all the config-things:
    Here are the directives webmin created in /etc/apache2/sites-available/webmin.1372454172222222224444448.conf

    DocumentRoot /var/www/sites/my_testsite
    <Directory "/var/www/sites/my_testsite">
    allow from all
    Options +Indexes
    </Directory>
    ServerName my_testsite.com
    ServerAlias www.my_testsite.com

    an update: i fixed this by adding directive ServerAlias domain.tld *.domain.tld
    i found this at the setup under `Apache -> the Virtual Domain settings -> Networking and Addresses -> Alternate virtual server names FIELD.
    domain.tld *.domain.tld`

    question:
    – is it very important to add server name initially and then webmin virtual host edit/delete,
    – i can imagine that if i do so, it does not updated the directive and subsequently the Server Name will be missing in it
    – so the question is: do i need to add the Server name and then Restarting apache in order to make it work?

    Servers -> Apache Webserver: Select your virtual Server -> Edit Directives

    see here

    Server Name: my_testsite.com
    Others -> Command Shell
    service apache2 restart
    Open the web address in browser.
    

    besides this: is it thinkable that the mixing with ‘Any’ with a specific port doesn’t play nicely for some reason.

    so the question here is: should i try to run with the vhost settings to:

    Address: Any
    Port: Any
    Document Root: /var/www/sites/my_testsite
    Server Name: my_testsite.com

    and do not choose or select a specific port!?

    on a side note, should i do the setting of my sites to not allow directory indexing?

    look forward to hear from you

Viewing 4 replies - 1 through 4 (of 4 total)
  • As you may have figured out from the lack of response, the WordPress support forum is really not the best place to get sysadmin and server config support. Besides your question being off-topic, you’re not likely to find a lot of hard-core sysadmins here to help you troubleshoot this.

    If your issue is still unresolved, I’ll suggest you post for help in Stack Overflow’s Server Fault Q&A board, where lots of sysadmins hang out.

    https://serverfault.com/

    Good luck!

    Moderator bcworkz

    (@bcworkz)

    George is correct, this is not a WP question. But while you have my attention, I can answer some of your questions. The hosts entry is for your local computer to recognize a certain domain and to use the provided IP instead of any it might find on DNS. It’s not really related to server software. You need to restart your computer for new entries to register.

    The virtual host is of course related to the server itself. Similarly, the server must be restarted for new entries to be registered. Enterprise shared hosting have a workaround for restarting, but the rest of us must restart.

    It doesn’t matter which you do first, they must both be in place and restarted for everything to work. I’m not familiar with an “Any” directive specifically, but I imagine if your other vhosts address all of your needs, you don’t really need a fallback “Any” directive. But I imagine any more specific directive will take precedence. IDK though,l I’m assuming it’s similar to _default_:* in Linux vhosts.

    Either disable directory indexing or ensure all accessible folders at least have a index.html file.

    Hello dear George hello dear bcworkz,

    many thanks for the reply and all your ideas and the knowledge-sharing. this is far more than expected. i am very glad to hear form you.

    btw: on a sidenote: i love this place – the wordpress-forums for its power in terms of idea sharing and knowleged exchange.

    especially when it comes to things like plugin questions and wp-installation. Here – we find users and supporters from all over the globe. That is so great.
    you both were right: here its the place for sharing ideas regarding WordPress itself. We find answers for all wp-things and for all things regarding plugins.

    @gappiah : since i use Webmin on a dedicated server – and sometimes i struggle with some directives – i just thought that i can post such a question here.
    and i am glad for the answer from you bcworkz

    so mans many thanks for all your ideas that you share here:

    The virtual host is of course related to the server itself. Similarly, the server must be restarted for new entries to be registered.
    Enterprise shared hosting have a workaround for restarting, but the rest of us must restart.
    It doesn’t matter which you do first, they must both be in place and restarted for everything to work. I’m not familiar with an “Any” directive specifically, but I imagine if your other vhosts address all of your needs, you don’t really need a fallback “Any” directive. But I imagine any more specific directive will take precedence. IDK though,l I’m assuming it’s similar to _default_:* in Linux vhosts.
    Either disable directory indexing or ensure all accessible folders at least have a index.html file.

    many thanks – i will rework the vhosts on the Apache – with your ideas in mind.

    Many thanks for all you do here.

    Moderator bcworkz

    (@bcworkz)

    You’re welcome. We love this place too (I shouldn’t speak for George, but I think he’ll agree). That’s why we hang out here so much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.