0

I am working on a web application in Ubuntu.

I have a PHP backend that I want to host in "http://localhost/myapp/".

All the application files are in the "/var/www/html/myapp/website/public/" folder. I also have a python backend. It is the API backend for the same application.

The python DRF project files reside in the "/var/www/html/myapp/api/v1/" folder. I need to host the DRF APIs in "http://localhost/myapp/v1/". I created the "/etc/apache2/sites-available/test.conf" file to configure my app in apache. But since "/myapp/v1/" has "/myapp/" in it, the php configuration is superseding and the WSGI is not working. If I remove the "Alias /myapp/", then the WSGI backend works fine in "http://localhost/myapp/v1/".

Below is my configuration I tried. What am I missing here? Thank you for your help.

<VirtualHost *:80>
    ServerName localhost

    # WSGI handler for /myapp/v1/
    WSGIDaemonProcess myapi python-home=/opt/venv/myapp-python python-path=/var/www/html/myapp/api/v1/
    WSGIProcessGroup myapi
    WSGIScriptAlias /myapp/v1/ /var/www/html/myapp/api/v1/v1/wsgi.py process-group=myapi application-group=%{GL>

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

    # DocumentRoot /var/www/html/myapp/website/public/
    # PHP backend
    Alias /myapp/ /var/www/html/myapp/website/public/
    <Directory /var/www/html/myapp/website/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.