Creating a virtual host using webmin: settings, directives,

Einfach Dinge, die nichts mit XAMPP, Apache Friends, Apache, MySQL, PHP und alle dem zu tun haben. Allerlei halt. ;)

Creating a virtual host using webmin: settings, directives,

Postby unleash_it » 04. December 2019 12:23


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:
Code: Select all
Address: Any
Port: 80
Document Root: /var/www/sites/my_testsite
Server Name: my_testsite.com

 
Code: Select all
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

Code: Select all
[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 
Code: Select all
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
Code: Select all
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? 

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

 

and subsequently: 
Code: Select all
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:
Code: Select all
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 

Interessen: Bikes & steel frames: Linux & SBC https://www.allaboutcircuits.com :: die neuen Knowledge-Base: AFFiNE: There can be more than Notion and Miro. auf affine.pro :: WordPress Entwicklung - sic: make.wordpress.org/core/
User avatar
unleash_it
 
Posts: 776
Joined: 10. December 2011 18:32
Operating System: linux opensuse 12.1

Return to Allerlei

Who is online

Users browsing this forum: No registered users and 19 guests