On the Apache server, how does one configure Apache and django URLs when running php websites and Django websites?

Source: Internet
Author: User
Software installed: Apache2.2mod _ wsgiphp5, etc. you want to: 1. use the same port and the same domain. 2. leave all the URLs such as django_site * to django for processing. However, you have tried many configuration methods and encountered odd errors. Installed software: Apache2.2 mod_wsgi php5 and so on.
To:
1. use the same port and domain.
2. submit all the URLs such as/django_site/* to django for processing.

However, I tried many configuration methods and encountered odd errors. Reply content: Thank you for your invitation. it took a long time.
I started to touch Python/Django only after getting started with nginx, but it took a lot of time to use Apache/mod_php before. Therefore, the following Django collocation is based on the nginx fastcgi_pass idea. I am also a newbie. The goal below is to "run.

Environment:
Ubuntu 12.04 LTS, Apache 2.2.22 Prefork MPM, and mod_php are installed in apt-get.
Apache module:
  • Php5
  • Proxy (/etc/apache2/mod-available, proxy. load and proxy_scgi.log are displayed)
The Python module is installed using pip and the virtualenv management environment is as follows:
  • Django
  • Flup (Django runfcgi dependency flup)

Step: Django-> Apache/PHP-> Apache proxy_scgi/Django SCGI
1. get rid of the Django app first, and ensure that you can start and access your Django app correctly with manage. py runserver (python manage. py runserver 0.0.0.0: 8000)
2. configure the standard Apache/mod_php5 environment, which is not required in Ubuntu. Place info. php in DocumentRoot to ensure normal operation:


  
Configure httpd-vhosts.conf files


  
       WSGIScriptAlias /django_site "/path/to/www/django_site.wsgi"    
   
            Order Deny,Allow        Allow from all    
        Alias /images "/path/to/www/images"        Alias /layout "/path/to/www/layout"        
    

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.