Virtualhost config not working

Suitecrm has been installed, and ‘login’ and ‘home’ are accessible via the public index php:
suitecrm.{company}.com/suitecrm/public/index.php

We believe the apache virtual host config is supposed to make it work so ‘index’ appears to serve up from, but it’s not working:
suitecrm.{company}.com/index.php

suitecrm.conf:
<VirtualHost *:80>
ServerAdmin webmaster@suitecrm.{company}.com
ServerName suitecrm
DocumentRoot /var/www/html/suitecrm/public
<Directory /var/www/html/suitecrm/public>
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from All
DirectoryIndex index.php

ErrorLog ${APACHE_LOG_DIR}/suitecrm_error.log
CustomLog ${APACHE_LOG_DIR}/suitecrm_access.log combined

The team has set the server hostname as ‘suitecrm’ and has tried to use that for ‘servername’ in the virtual host config, since they want this to work like a subdomian.

Does a dedicated domain name need to be registered, other than ‘company.com’?
Does that need to be setup for the server hostname as well as the virtualhost servername?
Does htaccess and mod rewrite need to be used for this?

Change this line from this:

ServerName suitecrm

to this:

ServerName suitecrm.mycompany.com

Then tell apache to reload its settings:

sudo systemctl reload apache2

Thanks, when I’ve tried that, I get a blank index.php page and error log:

http://suitecrm.{company}.com/index.php/

AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
[Tue May 07 22:27:53.666598 2024] [mpm_prefork:notice] [pid 114241] AH00163: Apache/2.4.52 (Ubuntu) configured – resuming normal operations

Oh, actually it does work. It does serve up ‘index.php/’ when you hit the base url, but I have to include the #/Login or #/home on the index.php

I suppose you need a rewrite rule to redirect to that if you hit the base url and aren’t logged in?

http://suitecrm.{company}.com/index.php#/Login

No, the Suite application adds the /#/Login. No apache config is necessary to do this.

Is the computer your Suite is installed on, intended to be accessible on the public internet?
Or is that computer a local computer, intended to be accessible on the company internal network?

Its on public internet so will need an ssl cert.

The servername change seems to work ok, but now the issue is it’s not appending the ‘#/Login’ location hash which the app seems to need to serve up the login form.

Javascript is required for the web user interface to work (and put that /#/Login on the page address, etc).
Is your browser’s Javascript disabled?

yes I recognized that as SPA (single page app) javascript location hash behaviors, but no I wouldn’t disable javascript.

This seems to be working normally now so maybe old urls were cached or something. It will append the location hash just by hitting the domain.com… Thx

Note that the word “public” should NOT be visible in the URLs. Make sure your web root is pointing to public dir, so that that directory is accessible with just the base “/” character after the domain name.

What did you update?