Serve django1.8 application at root and remain public_html in userdir.conf in apache


I’m trying to put website of django 1.8 with apache setting on CentOS 7 root (/), but other users can still access their website by accessing http://hostname/~username to their public_html folder in PHP config. Is there any way to achieve this?

Error Message (with Debug=True)
enter image description here


<IfModule mod_userdir.c>
    UserDir public_html

<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options +MultiViews -Indexes +SymLinksIfOwnerMatch +IncludesNoExec
    Require method GET POST OPTIONS

django.conf for hosting website of server at root

Alias /static /home/username-for-hosting-site/serversiteapp/static

<Directory /home/username-for-hosting-site/serversiteapp/static>
    Require all granted

<Directory /home/username-for-hosting-site/serversiteapp/>
        Require all granted

Other Information

Django Version: 1.8
Apache Version: 2.4.6
Server OS: CentOS 7
Other users could use PHP to hold their public_html sites

Source: apache

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.