mercredi 5 septembre 2018

Apache configuration on CENTOS 7 for redirecting subfolder with proxypass

i have two applications running on my server (Centos 7) the first run behind the port 8000 and the second behind the 8888

Each of applications are under subfolder /var/www/html

The first is launched with Quasar on the port 8000 and second (Laravel) with artisan serve on the 8888.

I don't have domain name, only ip to access my server

I've following virtual host configuration. The desired result is:

If someone requests http://xx.xx.xx.xx/myapp, apache return the application running behind 127.0.0.1:8000

And if http://xx.xx.xx.xx/myotherapp is requested, apache return the application running behind 127.0.0.1:8888

When i go on xx.xx.xx.xx:8000 i've "myapp" application running well but i would like access with xx.xx.xx.xx/myapp

xx.xx.xx.xx/myapp show me the root file of my application but not running with Auasar (VueJs isn't initialized)

When i go on xx.xx.xx.xx:8888 nothing work

Quasar server :

quasar dev


> quasar-app@0.0.1 dev /var/www/html/myapp
> node build/script.dev.js

 Will listen at http://localhost:8000
 Browser will open when build is ready.

Build completed in 61.107s

DONE  Compiled successfully in 61111ms  

Laravel server :

php artisan serve --port=8888
Laravel development server started: <http://127.0.0.1:8888>

My default-site.conf is :

<VirtualHost *:80>
    ProxyPreserveHost On

    ProxyPass /myapp http://127.0.0.1:8000/
    ProxyPassReverse /myapp http://127.0.0.1:8000/

    ProxyPass /myotherapp http://127.0.0.1:8888/
    ProxyPassReverse /myotherapp http://127.0.0.1:8888/
</VirtualHost>

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire