[GH-ISSUE #1213] Incorrect paths to javascript files when using an apache2 alias #686

Closed
opened 2026-02-26 02:33:57 +03:00 by kerem · 3 comments
Owner

Originally created by @DDriggs00 on GitHub (Apr 16, 2020).
Original GitHub issue: https://github.com/koel/koel/issues/1213

Describe the bug
When setting up koel on my media server (accessible under the path: /koel), I am able to get the server working when using php artisan serve, but when using apache, all browsers (chrome, ff, ie) think that the .js files are at <ip>/public/js rather than <ip>/koel/public/js.

Apache config here

<VirtualHost *:80>
    # ServerAlias 162.243.93.216
    ServerAdmin www-data@localhost
    #DocumentRoot /var/www/html

    Alias /service1 /var/www/service1
    <Directory /var/www/service1>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    Alias /koel /var/www/koel
    <Directory /var/www/koel>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
     </Directory>


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

To reproduce
Steps to reproduce the behavior:

  1. Follow standard installation instructions
  2. Ensure server is functional when using php artisan serve
  3. add koel to the apache config
  4. restart apache
  5. Open a web browser to the login page

Expected behavior
I expected the .js files to be located under the koel directory, like all the php/image/etc. files were located.

Environment

  • Koel version: v4.2.2
  • OS: Ubuntu 19.10
  • Browser: Firefox, chrome, ie (all latest)
  • PHP version: 7.3
  • Node version: 10.20
Originally created by @DDriggs00 on GitHub (Apr 16, 2020). Original GitHub issue: https://github.com/koel/koel/issues/1213 **Describe the bug** When setting up koel on my media server (accessible under the path: <ip>/koel), I am able to get the server working when using `php artisan serve`, but when using apache, all browsers (chrome, ff, ie) think that the .js files are at `<ip>/public/js` rather than `<ip>/koel/public/js`. Apache config here ```xml <VirtualHost *:80> # ServerAlias 162.243.93.216 ServerAdmin www-data@localhost #DocumentRoot /var/www/html Alias /service1 /var/www/service1 <Directory /var/www/service1> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> Alias /koel /var/www/koel <Directory /var/www/koel> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> ``` **To reproduce** Steps to reproduce the behavior: 1. Follow standard installation instructions 2. Ensure server is functional when using `php artisan serve` 3. add koel to the apache config 4. restart apache 5. Open a web browser to the login page **Expected behavior** I expected the .js files to be located under the koel directory, like all the php/image/etc. files were located. **Environment** - Koel version: v4.2.2 - OS: Ubuntu 19.10 - Browser: Firefox, chrome, ie (all latest) - PHP version: 7.3 - Node version: 10.20
kerem closed this issue 2026-02-26 02:33:57 +03:00
Author
Owner

@BrookeDot commented on GitHub (Apr 16, 2020):

Do things work as expected it you remove the alias?

I haven't used Apache in a few years now, but perhaps you need to set up Pretty URLs as described here:
https://laravel.com/docs/5.8/installation#pretty-urls

That's what we do for NGINX with try_files $uri $uri/ /index.php?$args;

<!-- gh-comment-id:614930757 --> @BrookeDot commented on GitHub (Apr 16, 2020): Do things work as expected it you remove the alias? I haven't used Apache in a few years now, but perhaps you need to set up Pretty URLs as described here: https://laravel.com/docs/5.8/installation#pretty-urls That's what we do for NGINX with `try_files $uri $uri/ /index.php?$args;`
Author
Owner

@DDriggs00 commented on GitHub (Apr 17, 2020):

I tried what was in the link, but it didn't work, and I eventually just switched ports and put it at the root.

<!-- gh-comment-id:615051763 --> @DDriggs00 commented on GitHub (Apr 17, 2020): I tried what was in the link, but it didn't work, and I eventually just switched ports and put it at the root.
Author
Owner

@phanan commented on GitHub (Apr 21, 2020):

Koel doesn't officially support installation in a subdirectory/path, so it's totally up to you to hack your way around it to make it work ;)

<!-- gh-comment-id:617438649 --> @phanan commented on GitHub (Apr 21, 2020): Koel doesn't officially support installation in a subdirectory/path, so it's totally up to you to hack your way around it to make it work ;)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#686
No description provided.