0

I'm trying to set up apache with multiple virtual hosts "filebrowser.com" and "videos.com" however, I'm only able to access filebrowser.com and not videos.com. I also have to enter the static IP of my server "172.16.0.6" in order to access the site. I'm assuming apache is using the most relevant host (alphabetically). Basically, I'm unable to load either site using the server alias.

Here is the config file for videos.com

<VirtualHost *:80>

ServerAdmin webmaster@localhost
ServerName 172.16.0.6
ServerAlias www.videos.com
DirectoryIndex index.html
DocumentRoot /home/usr/public/Videos


LogLevel info
ErrorLog ${APACHE_LOG_DIR}/VideosError.log
CustomLog ${APACHE_LOG_DIR}/VideosAccess.log combined

and here is the config file for filebrowser.com

<VirtualHost *:80>

ServerAdmin webmaster@localhost
ServerName 172.16.0.6
ServerAlias www.filebrowser.com
DirectoryIndex filebrowser.html
DocumentRoot /home/usr/public

LogLevel info
ErrorLog ${APACHE_LOG_DIR}/FileBrowserError.log
CustomLog ${APACHE_LOG_DIR}/fileBrowser.log combined

Now just to give some insight, my router does not allow me to configure DNS however, it does allow me to assign static ip's. Also, I can only access my web server by typing in the static ip 172.16.0.6.

  • 1
    Welcome to Server Fault! In your questions and your network please refrain from using random domain names and use either your *own domain* (one can register your own for (almost) free). Or redact your own domain with one of the [RFC 6761](https://tools.ietf.org/html/rfc6761#section-6.5) reserved domain names such as `example.com`, `example.org` or similar . Please refer to [this Q&A](http://meta.serverfault.com/q/963/37681) for our recommendations with regards to how and what (not) to obfuscate in your questions. – diya Nov 07 '22 at 09:17
  • 1
    When you can't set up DNS, you can use your hosts file https://en.wikipedia.org/wiki/Hosts_(file) to simulate assigning multiple different hostname to an IP-address. For Name Based virtual hosting each `ServerName` must be unique and neither server names nor aliases should overlap in different VirtualHost stanza's for the same port. – diya Nov 07 '22 at 09:27

0 Answers0