Hello,

Since the change on the Microsoft side I have installed the new version of OSticket 1.17RC with the Oauth2 plugin. However, when saving the Oauth2 configuration I get the following message. On the link [domain]/api/auth/oauth2?code=xxxxxxxxxxxxxxxxxxxxxxxxx

"No input file specified"

Does anyone have an idea what this is about and how to fix it?

Thanks in advance!

    patricksmithosticket

    You need to enable the AllowOverride module for your sites-available config for your osTicket site or if you don't have that then edit the main /path/to/httpd/conf/httpd.conf file and update the root "/var/www/html/" directive to add/update AllowOverride All.

    Cheers.

      Also make sure you have the mod_rewrite apache module enabled

      sudo a2enmod rewrite
      sudo systemctl restart apache2

      This can be little different depending on the system, so if you don't have "a2enmod" you may have to look it up how to enable it in your system (usually by uncommenting the line #LoadModule rewrite_module ... in your main http.conf)

      3 months later

      KevinTheJedi
      Hiya KevinTheJedi , sorry to bring up an old thread. My emails recently stopped fetching so I decided to upgrade to 1.17 and also install the Oauth2 plugin to use the Microsoft Azure Account. I was able to create everything required for the config and when I finally hit submit I also am getting the error "No input file specified". I have read your advice but unfortunately it means nothing to me. Can you please dumb it down for me so I can continue to investigate. Thanks in advance. Sam. Attached is my installation details screen.

        sedwardson

        I don't know what else to say. URL Rewriting is not enabled for your webserver. You can google "how to enable url rewriting for apache on xxx" where "xxx" is your server OS (eg. Ubuntu, CentOS, etc.)

        Cheers.

          I am also having this issue. I have verified URL rewriting is on and working. AllowOverride All is set.
          How do I debug this?

            NuFu

            If you are being redirected back to client portal then url rewriting is not working properly or maybe you put the wrong callback URL.

            Cheers.

            • NuFu replied to this.

              I have the same issue since 1.17 upgrade, according to the hosting provider "AllowOverride All" ist active. what else can cause this issue? are there any detailed logs?

                cross-it

                You will need to check the logs on the server end. Also, it truly sounds like this is not enabled for your site or you put the wrong callback URL.

                Cheers.

                KevinTheJedi So I enabled the rewrite log to try and debug. I see it going through the rules and attempting to rewrite. I just dont know what it is supposed to end up looking like. The only thing I can think of is that my ticket site is in a nested folder. So instead of being at the base domain it is something like https://www.basedomain.com/support .

                The recall back URL is set to https://www.basedomain.com/support/api/auth/oauth2

                The base website is located in "/var/www/basedomain.com/web/"
                The osticket site is located in "/var/www/basedomain.com/web/support"

                Here is the Rewrite log that is happening

                [Fri Oct 14 03:42:38.619496 2022] [rewrite:trace3] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] add path info postfix: /var/www/basedomain.com/web/support/api/auth -> /var/www/basedomain.com/web/support/api/auth/oauth2
                [Fri Oct 14 03:42:38.619607 2022] [rewrite:trace3] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] strip per-dir prefix: /var/www/basedomain.com/web/support/api/auth/oauth2 -> auth/oauth2
                [Fri Oct 14 03:42:38.619645 2022] [rewrite:trace3] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] applying pattern '^(.*)$' to uri 'auth/oauth2'
                [Fri Oct 14 03:42:38.619742 2022] [rewrite:trace4] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] RewriteCond: input='/var/www/basedomain.com/web/support/api/auth' pattern='!-f' => matched
                [Fri Oct 14 03:42:38.619919 2022] [rewrite:trace4] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] RewriteCond: input='/var/www/basedomain.com/web/support/api/auth' pattern='!-d' => matched
                [Fri Oct 14 03:42:38.619995 2022] [rewrite:trace4] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] RewriteCond: input='/support/api/auth/oauth2' pattern='(.*/api)' => matched
                [Fri Oct 14 03:42:38.620140 2022] [rewrite:trace2] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] rewrite 'auth/oauth2' -> '/support/api/http.php/auth/oauth2'
                [Fri Oct 14 03:42:38.620182 2022] [rewrite:trace2] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] trying to replace context docroot /var/www/basedomain.com/web with context prefix
                [Fri Oct 14 03:42:38.620192 2022] [rewrite:trace1] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf8d0a0/initial] [perdir /var/www/basedomain.com/web/support/api/] internal redirect with /support/api/http.php/auth/oauth2 [INTERNAL REDIRECT]
                [Fri Oct 14 03:42:38.620316 2022] [rewrite:trace3] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf393f0/initial/redir#1] [perdir /var/www/basedomain.com/web/support/api/] add path info postfix: /var/www/basedomain.com/web/support/api/http.php -> /var/www/basedomain.com/web/support/api/http.php/auth/oauth2
                [Fri Oct 14 03:42:38.620333 2022] [rewrite:trace3] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf393f0/initial/redir#1] [perdir /var/www/basedomain.com/web/support/api/] strip per-dir prefix: /var/www/basedomain.com/web/support/api/http.php/auth/oauth2 -> http.php/auth/oauth2
                [Fri Oct 14 03:42:38.620341 2022] [rewrite:trace3] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf393f0/initial/redir#1] [perdir /var/www/basedomain.com/web/support/api/] applying pattern '^(.*)$' to uri 'http.php/auth/oauth2'
                [Fri Oct 14 03:42:38.620355 2022] [rewrite:trace4] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf393f0/initial/redir#1] [perdir /var/www/basedomain.com/web/support/api/] RewriteCond: input='/var/www/basedomain.com/web/support/api/http.php' pattern='!-f' => not-matched
                [Fri Oct 14 03:42:38.620364 2022] [rewrite:trace1] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efcabf393f0/initial/redir#1] [perdir /var/www/basedomain.com/web/support/api/] pass through /var/www/basedomain.com/web/support/api/http.php
                [Fri Oct 14 03:42:38.620436 2022] [rewrite:trace1] [pid 1142856] mod_rewrite.c(483): [client 111.111.111.111:59058] 111.111.111.111 - - [www.basedomain.com/sid#7efcabe2e718][rid#7efca84090a0/subreq] [perdir /var/www/basedomain.com/web/] pass through /var/www/basedomain.com/web/auth

                .htaccess file in /api

                <IfModule mod_rewrite.c>
                
                RewriteEngine On
                
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_URI} (.*/api)
                
                RewriteRule ^(.*)$ %1/http.php/$1 [L]
                
                </IfModule>

                In the vhost config I have

                <Directory /var/www/basedomain.com/web>
                                                # Clear PHP settings of this website
                                                <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                                SetHandler None
                                                </FilesMatch>
                                                Options +SymlinksIfOwnerMatch
                                                AllowOverride All
                                                                                Require all granted
                                                                </Directory>

                Any and all help very much Appreciated.

                  NuFu

                  Do you have a separate Apache config for the support subfolder?

                  Cheers.

                  • NuFu replied to this.

                    Hi,
                    I think i got the same error. 404 see in the log.

                    Can i copy/paste the result somewhere in the DB? or put the configuration from hand some where?

                    Thanks for the help.

                    I got a better reply from our provider. They cannot enable AllowOverrides All on our server for security reason.

                    @KevinTheJedi Can you tell me which detailed functions osTicket needs?

                    At the moment this is configured:
                    Options -ExecCGI -FollowSymlinks -Includes +IncludesNoExec -Indexes -Multiviews +SymLinksIfOwnerMatch
                    AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

                      KevinTheJedi Thanks for the idea. I contacted my host and have confirmed that URL rewriting is on for this domain and sub domain. I have also confirmed that AllowOverride All is set. The only thing so far that I can think of is that my redirect URL is incorrect. It is currently set to the default which was entered during setup (see screenshot). Can you confirm if this is correct or not? Thanks.

                      as an aside, when browsing the files, this directory doesn't exist in this state which I'm assuming the re-direct is all about. Where should it be in order that I can confirm that it actually exists. Thanks again. Sam

                        cross-it

                        I don’t know what you mean. Please further explain on what you are asking.

                        sedwardson

                        It appears correct. The path doesn’t physically exist which is why you need URL Rewriting enabled. It will hit api/ folder and use the api/.htaccess file to rewrite the URL appropriately. Maybe your host doesn’t allow .htaccess files to be loaded?

                        Cheers.

                          KevinTheJedi Sorry to be a pain, however, i think I'm (you're) getting closer. My .htaccess file consists of the following. Is there anything else that should be in it? This is in the api folder.

                          <IfModule mod_rewrite.c>

                          RewriteEngine On

                          RewriteCond %{REQUEST_FILENAME} !-f
                          RewriteCond %{REQUEST_FILENAME} !-d
                          RewriteCond %{REQUEST_URI} (.*/api)

                          RewriteRule .*$ %1/http.php/$1 [L]

                          </IfModule>

                            KevinTheJedi So I do not have a separate Apache config. Just one config for the vhost. I have a WordPress site at the root with Osticket in the sub directory.