dil_bert Posted December 4, 2019 Share Posted December 4, 2019 hello dear freaks probably the Apache-supforum fits most here - for this setup-question. I'm currently working on a setup of a server to host multiple websites on a single IP. Note: 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 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.1372499999999888777656578.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 and subsequently: Server Name: my_testsite.com Others -> Command Shell service apache2 restart i then opened 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 yours dil_bert Quote Link to comment https://forums.phpfreaks.com/topic/309624-creating-a-virtual-host-using-webmin-settings-directives-experience-and-behaviour/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.