New virtual host does not fetch files from its home directory

Hello,

I have been using Virtualmin for about 2 years without any issues.
Today I have created a new virutal host (shampoos.net) no issue in creating the virtual host.
But, first I realized I can not access via FTP - all my other accounts are fine.
Then I have added an index.html file via File Manager but the URL goes to my server’s default virtualhost which is http://1-e-1.com

Any idea for troubleshooting?
Thanks in advance,
Aslan

Server specs:

Operating system CentOS Linux 7.7.1908
Perl version 5.016003
Path to Perl /usr/bin/perl
BIND version 9.9
Postfix version 2.10.1
Mail injection command /usr/lib/sendmail -t
Apache version 2.4.6
PHP versions 5.4.16, 5.4.16, 7.0.27, 7.1.33
Webalizer version 2.23-08
Logrotate version 3.8.6
MySQL version 5.5.64
ProFTPD version 1.35
SpamAssassin version 3.4.0
ClamAV version 0.102.2

================

See the httpd.conf for this new virtual host - shampoos.net:

<VirtualHost 217.182.196.30:80>
SuexecUserGroup "#1193" "#1132"
ServerName shampoos.net
ServerAlias www.shampoos.net
ServerAlias webmail.shampoos.net
ServerAlias admin.shampoos.net
DocumentRoot /home/shampoos/public_html
ErrorLog /var/log/virtualmin/shampoos.net_error_log
CustomLog /var/log/virtualmin/shampoos.net_access_log combined
ScriptAlias /cgi-bin/ /home/shampoos/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/shampoos/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 .php5
AddHandler fcgid-script .php5.4
AddHandler fcgid-script .php7.0
AddHandler fcgid-script .php7.1
FCGIWrapper /home/shampoos/fcgi-bin/php7.0.fcgi .php
FCGIWrapper /home/shampoos/fcgi-bin/php5.fcgi .php5
FCGIWrapper /home/shampoos/fcgi-bin/php5.4.fcgi .php5.4
FCGIWrapper /home/shampoos/fcgi-bin/php7.0.fcgi .php7.0
FCGIWrapper /home/shampoos/fcgi-bin/php7.1.fcgi .php7.1
</Directory>
<Directory /home/shampoos/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.shampoos.net
RewriteRule ^(.*) https://shampoos.net:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.shampoos.net
RewriteRule ^(.*) https://shampoos.net:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
RemoveHandler .php5.4
RemoveHandler .php7.0
RemoveHandler .php7.1
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
</VirtualHost>
<VirtualHost 217.182.196.30:443>
SuexecUserGroup "#1193" "#1132"
ServerName shampoos.net
ServerAlias www.shampoos.net
ServerAlias webmail.shampoos.net
ServerAlias admin.shampoos.net
DocumentRoot /home/shampoos/public_html
ErrorLog /var/log/virtualmin/shampoos.net_error_log
CustomLog /var/log/virtualmin/shampoos.net_access_log combined
ScriptAlias /cgi-bin/ /home/shampoos/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/shampoos/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 .php5
AddHandler fcgid-script .php5.4
AddHandler fcgid-script .php7.0
AddHandler fcgid-script .php7.1
FCGIWrapper /home/shampoos/fcgi-bin/php7.0.fcgi .php
FCGIWrapper /home/shampoos/fcgi-bin/php5.fcgi .php5
FCGIWrapper /home/shampoos/fcgi-bin/php5.4.fcgi .php5.4
FCGIWrapper /home/shampoos/fcgi-bin/php7.0.fcgi .php7.0
FCGIWrapper /home/shampoos/fcgi-bin/php7.1.fcgi .php7.1
</Directory>
<Directory /home/shampoos/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.shampoos.net
RewriteRule ^(.*) https://shampoos.net:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.shampoos.net
RewriteRule ^(.*) https://shampoos.net:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
RemoveHandler .php5.4
RemoveHandler .php7.0
RemoveHandler .php7.1
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
SSLEngine on
SSLCertificateFile /home/shampoos/ssl.cert
SSLCertificateKeyFile /home/shampoos/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
</VirtualHost>

Hi, Aslan.

I would start from enabling debugging log level:

LogLevel debug

Having a look to your DNS records and Apache virtualhost record doesn’t give me an exact hint about what is happening. All looks right. I have few guesses, which is home folder permissions, and the files just cannot be read or that Apache doesn’t listen on this new particular IP address.

Anyway, enable debugging log level and let us know what you got in the end.

What is the output of command:

ip a
[root@de ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 3e:d6:91:a4:d0:ca brd ff:ff:ff:ff:ff:ff
3: ifb0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 32
    link/ether ee:e1:be:5d:e0:c9 brd ff:ff:ff:ff:ff:ff
4: ifb1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 32
    link/ether b6:a2:56:d1:4d:fc brd ff:ff:ff:ff:ff:ff
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether a4:bf:01:21:2a:92 brd ff:ff:ff:ff:ff:ff
    inet 217.182.196.30/24 brd 217.182.196.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2001:41d0:700:11e::/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::a6bf:1ff:fe21:2a92/64 scope link
       valid_lft forever preferred_lft forever
6: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether a4:bf:01:21:2a:93 brd ff:ff:ff:ff:ff:ff
7: teql0: <NOARP> mtu 1500 qdisc noop state DOWN group default qlen 100
    link/void
8: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
9: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN group default qlen 1000
    link/gre 0.0.0.0 brd 0.0.0.0
10: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
11: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
12: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
13: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN group default qlen 1000
    link/tunnel6 :: brd ::

Do not know how to do it. Can you please advise steps to do it.
Thanks in advance.
BR
Aslan

Go to webmin -> webmin configuration -> debugging log file (or similar) and enable the logging there.
Make sure to enable the necessary logging events.

Thanks DrCarsonBeckett.
I was able to enable the log file debugging.
Aslan

Enabling debugging logging was needed for Apache not for Webmin.

I think you can simply solve your issue by installing certbot package and requesting certificate over again.

yum install certbot

@Ilia

I am sorry, I am still new to virtualmin and I expected that section to enable debugging for the whole system.
I do think I know where to enable that via virtualmin (for apache), but can you tell me where to do that (so I know it for sure and for the future)?

Dear Illia,

I did run yum install certbot but it said Nothing to do see the result:

[root@de ~]# yum install certbot
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

Please let me know what you think.
Thanks,
Aslan\

I mixed up the thread, as certbot package doesn’t have anything to do with that. Sorry.

What if you for changed <VirtualHost 217.182.196.30:80> to <VirtualHost *:80>, would that work then? Does your Apache Listens on all interfaces?

Note: Don’t forget to restart Apache after editing its config files.

Dear Ilia,

I did what you have suggested but and then restarted the Apache. Nothing has changed.
It is really weird.
Aslan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.