Url change assistance required

Dear All.

I am currently at the installation stage on a subdomain. Is it possible to change the default URL from:

https://crm.marvelitcs.com/public

to:

https://crm.marvelitcs.com

I would like the application to open directly when accessing https://crm.marvelitcs.com, without requiring /public in the URL.

Could you please advise how I can configure this properly?

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

1 Like

Hello Nasir,

it depends on your hosting and what you can access.
If you have your own VPS, it’s along the lines what Nhat posted.
If you have purchased some standard webhosting packages / domains etc. you’d have to check your hosting panel and/or ask your hosting provider.

1 Like

Dear All.

installation part completed. thanks to all