Announcement

Collapse
No announcement yet.

Custom Portal Setup Help Apache

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Portal Setup Help Apache

    Hello,

    Is there anyone who has setup custom portal url ? Looking for some help to do the config. Right now im getting error as "404 Page Not Found" . custom portal working with the Custom ID but not with the Custom URL.

    I went through the forum as well, but couldn't find any answers. Seeking for help.
    Cheers!
    Nishan.

  • #2
    Hello, as far as i remember you have to configure vhost for this to work. EspoCRM devs mentioned that in docs i think. I can test that and let you know.

    Comment


    • #3
      Here you have apache config example:

      Comment


      • Nishan Perera
        Nishan Perera commented
        Editing a comment
        Hi emil, I tried that. But no luck. can you try and post actual config, so I can get an idea of it.

    • #4
      Nishan Perera
      everything is working without problem.
      You have to point domain to espocrm main folder. After that you have to create portal in EspoCRM, copy id of that portal and adjust htaccess with portal domain and portal id.
      Here you have my htaccess file AFTER modification:
      https://dubas.pro/c/?5601dae87f029a0...m5BRB1XYdSeAo8

      Comment


      • #5
        As you can see here: https://demo.devcrm.it you have light theme, and on https://dark.devcrm.it you have dark theme. It's because i've created custom portal for dark.devcrm.it, where i've set dark theme as default
        So it's working

        Comment


        • emillod
          emillod commented
          Editing a comment
          rabii - yes, you have to create additional vhost for portal domain also.

        • rabii
          rabii commented
          Editing a comment
          Even if the custom url is e.g https:example.com/clients ?

          i am trying to set up custom portals url in this format (https:example.com/clients || https:example.com/partners) instead of using subdomain format but didn't work.

          it is difficult to get it done i guess.

          Thanks for your reply though
          Last edited by rabii; 11-13-2021, 05:13 PM.

        • emillod
          emillod commented
          Editing a comment
          rabii - i don't think it's difficult, you just have to describe what you want to achieve. Go to official demo and check how they setup portals. Basically you can have default portal under address https://demo.eu.espocrm.com/portal/, you can also create additional portals under address https://demo.eu.espocrm.com/portal/client/, but you have to use portal in path.

      • #6
        Hi Nishan,
        Also, the important part here is to set properly the Mod rewrite rules in the Apache vhost https://docs.espocrm.com/administrat...-rewrite-rules.
        Here is an example of my configs that works like a charm:
        Code:
        <VirtualHost *:80>
        
            ServerName asd.com
        
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
        
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html/asd
        
            <Directory /var/www/html/asd/>
        
                Options Indexes FollowSymLinks
                AllowOverride None
                Order allow,deny
                allow from all
        
                <ifModule mod_headers.c>
                    Header always set Access-Control-Allow-Methods "POST, GET, PUT, PATCH, DELETE"
                </ifModule>
        
        [COLOR=#e74c3c]        <IfModule mod_rewrite.c>
        
                    RewriteEngine On
        
                    # Custom portal URL
                    RewriteCond %{HTTP_HOST} ^asd.com$
                    RewriteRule ^client - [L]
        
                    RewriteCond %{HTTP_HOST} ^asd.com$
                    RewriteCond %{REQUEST_URI} !^/portal/5a8a9b9328e6a955b/.*$
                    RewriteRule ^(.*)$ /portal/5a8a9b9328e6a955b/$1 [L]
        
                </IfModule>[/COLOR]
        
            </Directory>
        
        [COLOR=#e74c3c]    <Directory /var/www/html/asd/portal>
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all
            </Directory>
        
            <Directory /var/www/html/asd/api/v1/portal-access>
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all
            </Directory>
        
            <Directory /var/www/html/asd/api/v1/>
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all
            </Directory>[/COLOR]
        
        </VirtualHost>
        
        # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
        The "red" configs are required for the proper Portal work.

        Comment


        • #7
          Maximus too complicated I've configured vhost to point domain to main espocrm folder + i've adjust htaccess

          Comment


          • rabii
            rabii commented
            Editing a comment
            Hey @emillod

            Can you please share how you configured the portal custom domain. I am trying to create two custom portals one for our customers and other for our partners and I don't know how to do it. Seems you find an easy way to do it. Could you please share how to do it ?

            Many thanks

            Much appreciated.

            best regards,
            Rabii

        • #8
          Originally posted by emillod View Post
          Nishan Perera
          everything is working without problem.
          You have to point domain to espocrm main folder. After that you have to create portal in EspoCRM, copy id of that portal and adjust htaccess with portal domain and portal id.
          Here you have my htaccess file AFTER modification:
          https://dubas.pro/c/?5601dae87f029a0...m5BRB1XYdSeAo8
          emillod the link does not show anything -

          Comment


          • Nishan Perera
            Nishan Perera commented
            Editing a comment
            Hi, That is a temporary link. it has been expired.
        Working...
        X