Indico automatic redirect after install other virtualhost

Hi,
I installed a conference system using indico and using apache2, then I installed virtualmin.

indico runs very well and has been using it for a week, the problem came when I created a new virtualhost on virtualmin, when I created a new virtulmin, my old web(indico) would redirect to the web I just created using virtualmin.

virtualhost indico :

ServerName indico.domain
DocumentRoot "/var/empty/apache"
Protocols h2 http/1.1
SSLEngine on
SSLCertificateFile /home/indico.domain/ssl.cert
SSLCertificateKeyFile /home/indico.domain/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCACertificateFile /home/indico.domain/ssl.ca
XSendFile on
XSendFilePath /opt/indico
CustomLog /opt/indico/log/apache/access.log combined
ErrorLog /opt/indico/log/apache/error.log
LogLevel error
ServerSignature Off
<IfModule mod_brotli.c>
    AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json application/x-font-ttf application/vnd.ms-fontobject image/x-icon
</IfModule>
<If "%{HTTP_HOST} != 'indicodomain'">
    Redirect 301 / indicodomain/
</If>
AliasMatch "^/(images|fonts)(.*)/(.+?)(__v[0-9a-f]+)?\.([^.]+)$" "/opt/indico/web/static/$1$2/$3.$5"
AliasMatch "^/(css|dist|images|fonts)/(.*)$" "/opt/indico/web/static/$1/$2"
Alias /robots.txt /opt/indico/web/static/robots.txt
SetEnv UWSGI_SCHEME https
ProxyPass / uwsgi://127.0.0.1:8008/
<Directory /opt/indico>
    AllowOverride None
    Require all granted
</Directory .>

Here is another virtualhost create by virtualmin

SuexecUserGroup "#1003" "#1003"
ServerName ohterdomain
ServerAlias ww.ohterdomain
ServerAlias mail.ohterdomain
ServerAlias webmail.ohterdomain
ServerAlias admin.ohterdomain
DocumentRoot /home/ohterdomain/public_html
ErrorLog /var/log/virtualmin/ohterdomain_error_log
CustomLog /var/log/virtualmin/ohterdomain_access_log combined
ScriptAlias /cgi-bin/ /home/ohterdomain/cgi-bin/
DirectoryIndex index.php index.php4 index.php5 index.htm index.html
<Directory /home/ohterdomain/public_html>
    Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
    AddType application/x-httpd-php .php
    AddHandler fcgid-script .php
    AddHandler fcgid-script .php7.4
    FCGIWrapper /home/ohterdomain/fcgi-bin/php7.4.fcgi .php
    FCGIWrapper /home/ohterdomain/fcgi-bin/php7.4.fcgi .php7.4
</Directory>
<Directory /home/ohterdomain/cgi-bin>
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.ohterdomain
RewriteRule ^(?!/.well-known)(.*) ohterdomain:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.ohterdomain
RewriteRule ^(?!/.well-known)(.*) ohterdomain:9191/ [R]
RemoveHandler .php
RemoveHandler .php7.4
FcgidMaxRequestLen 1073741824
SSLEngine on
SSLCertificateFile /home/ohterdomain/sslcert
SSLCertificateKeyFile /home/ohterdomain/sslkey
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCACertificateFile /home/ohterdomain/sslca

when I create a new virtualhost, the indico system will also point to the new virtualhost, how do I solve this problem?

regards

The last time I used Webmin/Virtualmin was over a decade ago, and I don’t think anyone else in the team uses it - generally this type of tool does not play well together with config settings made outside, or for setups more complex than a simple “dump html/php files in a folder” setup.

My guess would be that you need to enable name-based virtual hosts in your Apache config somewhere.
However, my recommendation would be to not mix multiple applications on the same (virtual) servers. Use one for Indico, and another one for other things. That way you also don’t expose Indico to potential security issues in whatever else you host (or vice versa).

1 Like