[SOLVED] Cannot access WebTop via https://mydomain.tld/webtop after removing the virtual host option

Did you have that wordpress site as a virtualhost using the same domain at that time?

A webtop virtualhost (webmail.gtbs.ro) will work now too.

To remove Webtop including DB and dependencies:

systemctl stop tomcat8@webtop
su - postgres
psql
drop database webtop5;
\q

Check carefully which packages are going to be removed:

yum autoremove nethserver-webtop5 webtop5

IMO this is not necessary.
The issue you’re having is purely on apache configuration and host redirection, which should be designed by the sysadmin considering the existence of services and application on the server.

2 Likes

Yes

After I will write back DNS registration

I thought about that too …

If
you can access from your network to https://ipofnethserver/webtop
and
https port is forwarded to public address
then
Webtop is totally fine

So, go back to “design table” for

  • write down what you want
  • take note of the current setting
  • design a possible solution
  • apply
  • test
  • evaluate results
  • apply if necessary corrections

I can access the webtop by IP both from the LAN (https://LAN_IP/webtop) and from the WAN (https://PUBLIC_IP/webtop).
I can’t access from WAN by FQDN. This should be a DNS problem, except that it is from the configuration on the Nethserver and not from my NameServer.
I will check NethServer again before taking “radical measures”.

I think an alias directive makes webtop work.
Please try following custom template.

Create custom template dir:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf.d/webtop.conf

Copy the webtop template to the custom template dir:

cp /etc/e-smith/templates/etc/httpd/conf.d/webtop.conf/10base /etc/e-smith/templates-custom/etc/httpd/conf.d/webtop.conf/

Edit /etc/e-smith/templates-custom/etc/httpd/conf.d/webtop.conf/10base and add

Alias /webtop /var/www/html/webtop

so it looks like:

#
# 10base -- WebTop configuration
#

{
    my $vhost = $webtop{'VirtualHost'} || '';

    if ($vhost ne '') {
        $OUT .= "<If \"%{HTTP_HOST} == '$vhost'\">\n";
        $OUT .= "    RedirectMatch ^/\$ \"https://$vhost/webtop\"\n";
        $OUT .= "</If>\n";
    }
}

Alias /webtop /var/www/html/webtop

<Directory /var/www/html/webtop>
  AllowOverride All
</Directory>

<Proxy "http://127.0.0.1:58080/webtop">
  ProxySet timeout=180
</Proxy>

ProxyPassReverse /webtop http://127.0.0.1:58080/webtop

Apply the config:

signal-event nethserver-webtop5-update

Enable the wordpress vhost and disable the Webtop vhost.

Now both should work, the Wordpress vhost and Webtop.

1 Like

Unfortunately, none of the ideas worked (neither the one with the total uninstallation and reinstallation of webtop, nor the one with the creation of a custom template).
From my point of view, there is no problem that I don’t have webtop as webmail. I use it very rarely. SOGo is also good for webmail.

Anyway, I can wait for other ideas. Maybe someone else will encounter this problem, someone who will really need webmail.

Strange, I tested the custom template with a virtualhost using the same domain name and it worked.
Now I think it’s about Wordpress, I’m going to test it…

EDIT:

Wordpress in a virtualhost and Webtop using the custom template are working here.
Let’s check some of your configs…

Please share vhost config:

db vhosts show

Maybe .htaccess files have some problematic content?

cat /var/lib/nethserver/vhost/*/.htaccess

Did you install special addons/plugins in your Wordpress site?

[root@host-gtbs ~]# db vhosts show
1a08325c6d842a5=vhost
    Access=public
    Description=osTicket
    ForceSslStatus=enabled
    FtpPassword=
    FtpStatus=disabled
    Indexes=disabled
    MaxExecutionTime=0
    MemoryLimit=512
    PasswordStatus=disabled
    PasswordValue=
    PhpCustomSettings=enabled
    PhpRhVersion=php80
    PostMaxSize=8
    ServerNames=support.gtbs.ro
    SslCertificate=
    UploadMaxFilesize=4
    status=enabled
b685523870e51a2=vhost
    Access=public
    Description=WordPress
    ForceSslStatus=enabled
    FtpPassword=
    FtpStatus=disabled
    Indexes=disabled
    MaxExecutionTime=0
    MemoryLimit=512
    PasswordStatus=disabled
    PasswordValue=
    PhpCustomSettings=enabled
    PhpRhVersion=php80
    PostMaxSize=32
    ServerNames=www.gtbs.ro,gtbs.ro
    SslCertificate=
    UploadMaxFilesize=16
    status=enabled
default=vhost
    Description=Default virtual host
    FtpPassword=
    FtpStatus=disabled
[root@host-gtbs ~]#
[root@host-gtbs ~]# cat /var/lib/nethserver/vhost/*/.htaccess
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


# Wordfence WAF
<Files ".user.ini">
<IfModule mod_authz_core.c>
        Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
</IfModule>
</Files>

# END Wordfence WAF
[root@host-gtbs ~]# 

Wordfence is “special”

It’s working here with Wordpress, WordFence and WebTop with custom template all using the same domain name. I’m out of ideas.

Works with WebTop 5

1 Like

Yes, because it’s another (sub)domain.

Can be a record somewhere in wordpress?
Maybe related to .htaccess?

PS
At least now it opens and I don’t mind that it opens in this way.

I tested it with Wordpress and the same htaccess and it worked…

That’s great.

Last change: I deleted the custom template and now it works in any combination!
Weird!
So what was the solution? :thinking:

1 Like

Did you enable the config after removing the custom template by executing signal-event nethserver-webtop5-update ?
If yes then I don’t know what was the solution.
If no then you should recreate the custom template because it may have worked, maybe it was a browser cache issue…

Yes, of course.

I even stopped the server and then restarted it.
I tried from several networks (mobile gsm, remote from other server, other ISPs)

Thank you for your PATIENCE!

1 Like

Backup! NOW!

2 Likes

Thank you for the advice!
Already done!

1 Like