简体   繁体   中英

How config apache in Django1.8 and PHP in server Debian

I'm trying to make a local server with Django and PHP and I want to can access in other computers. I'm trying create two folders, one named Django with django files and other named PHP with PHP files. I'm beginner in apache and until now I only made this:

/etc/apache2/sites-available/etc/apache2/sites-available/000-default.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www

    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    WSGIScriptAlias / /var/www/wsgi_test/app.wsgi
    <Directory /var/www/wsgi_test/>
        Require all granted
        Order allow,deny
        Allow from all
    </Directory>


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

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

app.wsgi:

def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
                    ('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]

I can access in my localhost (10.1.1.20), and whatever subdomain in other computers, example: 10.1.1.20/whatever that open "Hello World" file, but I want access my folder django, however it show "Hello World"

// UPDATE

I resolve with following answer: Django and PHP together in server with single ip and port only

You're specifying your hello world wsgi file as the WSGI file. You're going to have to use the django wsgi file in order to access django.

That file can be found under your project directory as project_name/wsgi.py (ie in the same folder as the project's settings).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM