Apache serving Django and Wordpress simultaneously

3

I have a website created in Wordpress that is in /var/www/sitio1 that is all right, this site is on port 80 and its address is ejemplo.com .

Now, I have another site created in Django that is on port 8000, located in the /var/www/sitio2 folder.

Now, I want to put that Django website as a subfolder of the first one, that is, when they ask for this address: http://ejemplo.com/servicios I open the site made with Django and of course, they do it for the same port 80.

I specify port 80 because I have already managed to do it by port 8000, but it remains like that http://ejemplo.com:8000/servicios and I really would not like it that way. I'm not an expert on Apache, so I really do not know if it can be done.

    
asked by Omar Sarmiento Rolo 30.05.2016 в 18:04
source

1 answer

2

You can do this using ProxyPass from Apache

ProxyRequests off
ProxyPreserveHost on

<Proxy *>
      Order Allow,Deny
      Allow from All
</Proxy>

<Location /servicios>
      ProxyPass http://127.0.0.1:8000/
      ProxyPassReverse http://127.0.0.1:8000/
</Location>

With this all the requests that arrive to / services are going to be internally redirected to port 8000.

    
answered by 08.06.2016 в 13:59