Hi,
If SuiteCRM 8 is currently accessible at:
https://crm.marvelitcs.com/public
but you want to access it directly at:
you need to configure the web server so that the Document Root points directly to the SuiteCRM public directory.
For example, if SuiteCRM is installed at:
/var/www/crm
the web root should be:
/var/www/crm/public
You do not need to move or rename the public directory.
Option 1 β Apache
Step 1: Find the SuiteCRM installation directory
For example:
/var/www/crm/
βββ bin/
βββ config/
βββ public/
βββ src/
βββ vendor/
βββ β¦
The important directory is:
/var/www/crm/public
Step 2: Create or edit the Apache VirtualHost
Open the VirtualHost configuration for the subdomain.
For example:
sudo nano /etc/apache2/sites-available/crm.marvelitcs.com.conf
Configure it as follows:
<VirtualHost *:80>
ServerName crm.marvelitcs.com
DocumentRoot /var/www/crm/public
<Directory /var/www/crm/public>
AllowOverride All
Require all granted
Options FollowSymLinks
</Directory>
ErrorLog ${APACHE_LOG_DIR}/crm_error.log
CustomLog ${APACHE_LOG_DIR}/crm_access.log combined
If HTTPS is already configured, make sure the HTTPS VirtualHost also uses:
DocumentRoot /var/www/crm/public
For example:
<VirtualHost *:443>
ServerName crm.marvelitcs.com
DocumentRoot /var/www/crm/public
<Directory /var/www/crm/public>
AllowOverride All
Require all granted
Options FollowSymLinks
</Directory>
\# Existing SSL configuration
\# SSLEngine on
\# SSLCertificateFile ...
\# SSLCertificateKeyFile ...
Step 3: Enable Apache rewrite
Run:
sudo a2enmod rewrite
Then enable the site if it has not already been enabled:
sudo a2ensite crm.marvelitcs.com.conf
Step 4: Test the Apache configuration
Run:
sudo apachectl configtest
You should see:
Syntax OK
Step 5: Reload Apache
sudo systemctl reload apache2
Now access:
The /public part should no longer be required.
Option 2 β Nginx
Step 1: Find the SuiteCRM installation directory
For example:
/var/www/crm/
βββ bin/
βββ config/
βββ public/
βββ src/
βββ vendor/
βββ β¦
The web root must be:
/var/www/crm/public
Step 2: Create or edit the Nginx configuration
Open the configuration file:
sudo nano /etc/nginx/sites-available/crm.marvelitcs.com
Use the following configuration:
server {
listen 80;
server_name crm.marvelitcs.com;
root /var/www/crm/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location \~ \\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
location \~ /\\.ht {
deny all;
}
access_log /var/log/nginx/crm_access.log;
error_log /var/log/nginx/crm_error.log;
}
Important: Change:
/var/www/crm/public
to the actual path of your SuiteCRM installation.
Also make sure the PHP-FPM socket matches the PHP version installed on your server.
For example, if you are using PHP 8.3:
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
Step 3: Enable the Nginx site
If the configuration is stored in sites-available, create the symbolic link:
sudo ln -s /etc/nginx/sites-available/crm.marvelitcs.com /etc/nginx/sites-enabled/
If the link already exists, you can skip this step.
Step 4: Test the Nginx configuration
Run:
sudo nginx -t
You should see:
syntax is ok
test is successful
Step 5: Reload Nginx
sudo systemctl reload nginx
Then open:
SuiteCRM should now load without /public.
Important: HTTPS Configuration
If the domain is already using HTTPS, make sure the HTTPS server configuration also points to the SuiteCRM public directory.
The important setting is:
Apache
DocumentRoot /var/www/crm/public
Nginx
root /var/www/crm/public;
Do not only change the HTTP configuration if the site is actually accessed through HTTPS.
Final Result
Before:
https://crm.marvelitcs.com/public
After:
The key configuration is simply to make the SuiteCRM public directory the web serverβs document root.
Apache:
DocumentRoot /path/to/suitecrm/public
Nginx:
root /path/to/suitecrm/public;
This is the recommended approach because the SuiteCRM public directory is intended to be the web-accessible directory.
After it works, dont forget update site_url in config.php or config_override.php