After hours of struggle I have come to the conclusion that the answer to my question is no, they can’t.
Am I correct?
We have the following structure at work:
/var/www/html
|___app1
|___app2
|___app3
App1, app2 and app3 are accessible like http://server_name/app1 (app2 , or app3)
These apps are created using different frameworks (angular, jquery with bootstrap, moca, etc) and there is no issue with them.
But I haven’t been able to create an app4 using the slim project skeleton (slim4 in this case)….slim needs the document root to be the public folder and that crashes with the other applications.
I don’t have the luxury to create virtual hosts by names or by IP…..DNS is not handled by my team and communication with networking IT is not possible (yes, that’s rigt)….
I am able to make it work (the skeleton) if I change the DocumentRoot to /var/www/html/app4 (the slim app). But then all other apps stop working.
Is there a way to solve this under my conditions?
Thank you very much,
Andres
2
Answers
I was wrong, there is a way to have slim frontend coexisting with the other apps in the same webserver, while sharing all the same DocumentRoot. I Changed the routes.php to watch for all /app4/public/<any_entry_here> .
Like for example:
routes.php (that lives in /app4/app/routes.php)
Of course, under /app4/public lives index.php (and the corresponding .htaccess if using apache)
If using nginx, this location worked fine for me:
php-fpm-upstream, in my system is:
Where fpm80 is the name of the container serving the php-fpm module.
Thank you Nigel and Michael.
If it must be on the same domain. Have you considered using another port? It’s not the most orthodox approach but I have set this up for staging environments at port 8080 while the live site lives at port 80. Would that work in your scenario? You would have to configure a virtual host to use port 8080.