this is rather aggravating as i'm unsure what exactly I need to give you to help me :/ this isn't your fault at all, as i'm an unexperienced with working with servers, mod_python, python and django.
i am learning all this as I go along. i've got two websites on my server, both with different IP addresses (obviously) they reside in /home/kdwadmin and /home/kdwadmin2 the first directory above has another folder in it w/ my django files. full directory is /home/kdwadmin/mysite nevermind that my django files are placed in an inappropriate spot, i will be taking care of that shortly, /home/django/kdwadmin will contain the apps for the first site while there will be no directory for the second site at this time. my <Location>'s were set up as per the djangoprojects.com tutorial the first directory, that includes the django apps, is for website kennethdavid.net, the second for carclubhub.com. so what i need to do is set up a virtual host for both sites, one that will point kennethdavid.net/* to the django app and another that will say carclubhub.com/* SetHandler None there is only one port under "Listen" in the apache config file. Should i create an ip specific listen for each website? and have :80 for one and :81 for the other and would that allow me to create two VirtualHosts? one for each port? On Jan 3, 10:21 pm, Graham Dumpleton <graham.dumple...@gmail.com> wrote: > On Jan 4, 1:39 pm, garagefan <monkeygar...@gmail.com> wrote: > > > there is currently only one virtual host set up, for the site i'm > > working on. I do not need anything to happen with the other url. > > But why are you mentioning 'site2' in one of the other posts and > seeing for it what you only expect for 'site1'. > > > i simply need a virtual host forwww.website.netthatsits at /home/ > > site1/ on my server that has a django directory at /home/site1/mysite > > to work. > > Your initial configuration mentions /home/html in PythonPath. It is > very frustrating when people do not post exactly the Apache > configuration they are using and then try and describe in generic > terms using fake names and paths. It is okay if it is all consistent, > but your descriptions keep changing. > > > the django files themselves at /mysite work just fine, > > Can you clarify when you are talking about a URL or a directory. If a > directory, specify full path. > > That you are mentioning '/mysite' here again is confusing because it > suggests a URL for a Django instance mounted at sub url of site, yet > you already seemed to have said you want to mount it at root of host, > ie., '/'. > > > and > > were working before i attempted to set up the virtual host. and > >www.website.netwas working just fine as well with the way the > > <Location *>'s are currently set up, before the virtual host stuff was > > added. > > > i figure i'm missing something before the first <Location> that is > > causing the issue of the directory for the django apps not to be read. > > I do not want to set them up in the public_html directory as that is > > the main site directory, which if per chance i need to give someone > > access to that... i don't want them in the django directories at all. > > It is unclear here whether you are talking about static files, eg. > images and stylesheets, or Django code. You should never stick Django > directory containing code inside of a Apache DocumentRoot directory > for a host. Your better choices are to copy the static file > directories into DocumentRoot or use a symlink to link them in from a > different location. Depending on Apache configuration you may need to > set FollowSymLinks option. Alternatively, use an Alias directive in > Apache to effectively mount them at required URL from some other > directory location. Either way, mod_python is a PITA in that you need > to have SetHandler None for the URL (Location) context where they are > when whole Django site is mounted at a parent URL to the static files. > > > the server itself is a virtual server from godaddy running red hat 7 > > w/ apache and mod_python. > > > I was looking at a few pages and they mention DocumentRoot... should > > this be to /home/site1 or to the project files? > > As I said above, you should never put Django code in DocumentRoot > because a mistake in Apache configuration can expose your source code > to download. > > > how does PythonInterpreter need to be applied? > > It doesn't if you are only hosting one Django site inside of a > VirtualHost. > > Now, did you get rid of PythonOption to django.root which I said is > not needed if mounting Django at root of site. Be aware though that > that is an option only relevant to Django 1.0. Are you actually using > Django 1.0? If you are using older version of Django, then you aren't > reading the correct version of the documentation. > > Problem now is that still not even clear what you actual problem is > any more. How about being very clear and give URLs for each request > you are making and state whether it works. Ie., does '/' work, does '/ > images/...someimage.jpg' work, does some sub URL for part of your > application work? In other words, is the thing that doesn't work > static resources or dynamic resources? When you say you get nothing, > what do you mean by that, do you get a blank page, or simply not what > you expect? > > If any don't work, is the error response a generic Apache error page > or a Django specific error page? Have you looked in the Apache error > logs to see if there are any Python error messages in there, or even > an indication that the Apache process has crashed with a segmentation > fault? Have you got DEBUG set to True for Django so that if Django is > generating the error that the error details are returned in the web > page? > > Right now I can only guess at a few things. The first is django.root > as I mentioned, if you are indeed mounting Django at root of site. The > second is PythonPath doesn't also include Django instance directory in > addition to its parent. This latter will be an issue if in any part of > your code or urls.py file references stuff within the project without > explicitly referencing the site name. > > To make any further guess you need to expand on the vague information > you have already provided as what constitutes don't work and what > exactly you were expecting to see. > > BTW, it is presumed you properly restarted Apache between making > configuration changes. > > Graham > > > On Jan 3, 9:22 pm, Graham Dumpleton <graham.dumple...@gmail.com> > > wrote: > > > > On Jan 4, 12:53 pm, garagefan <monkeygar...@gmail.com> wrote: > > > > > no, as then i would need to use, for example...www.website.net/mysite/* > > > > instead ofwww.website.net/*forthevariousapps. > > > > If you are mounting it at root of web site, you should not be setting > > > django.root with PythonOption directive for a start. You only need set > > > django.root when mounted at a sub url. That you had set it gave the > > > impression you wanted it mounted at a sub url. > > > > > as i said the locations worked perfectly before attempting to create > > > > the virtual host. right now i need to have this virtual host point to > > > > the correct website on my server. > > > > As I said, you need to provide more complete configuration which shows > > > both Django sites and how you have set them up. > > > > If your VirtualHost containers are the same except for ServerName in > > > each, then show that by providing the configurations for both, or be > > > clear about that and state it rather than us having to assume what it > > > all looks like. > > > > > would i change server name to be an ip address? as each website on my > > > > server has a unique address, while having the same port? since 80 is > > > > the open port for apache > > > > Show configurations for both VirtualHost's and then we may be able to > > > answer. > > > > Graham > > > > > On Jan 3, 8:47 pm, Graham Dumpleton <graham.dumple...@gmail.com> > > > > wrote: > > > > > > On Jan 4, 12:17 pm, garagefan <monkeygar...@gmail.com> wrote: > > > > > > > I've read the documentation, and it doesn't seem clear enough, or > > > > > > provide a fully working example? > > > > > > > i've copied what i have in my python.conf file, keep in mind that i > > > > > > have removed site specific names and have made them generic > > > > > > > NameVirtualHost *:80 > > > > > > > <VirtualHost *:80> > > > > > > ServerNamewww.website.net > > > > > > > <Location "/"> > > > > > > Presumably you mean /mysite here and not the root of the web server. > > > > > This needs to match what you have set django.root to. > > > > > > Graham > > > > > > > SetHandler python-program > > > > > > PythonHandler django.core.handlers.modpython > > > > > > SetEnv DJANGO_SETTINGS_MODULE mysite.settings > > > > > > PythonOption django.root /mysite > > > > > > PythonDebug On > > > > > > PythonPath "['/home/html'] + sys.path" > > > > > > </Location> > > > > > > <Location "/styles"> > > > > > > SetHandler None > > > > > > </Location> > > > > > > <Location "/images"> > > > > > > SetHandler None > > > > > > </Location> > > > > > > </VirtualHost> > > > > > > > i get no python errors, however when i go to the site i receive > > > > > > nothing. these locations worked previous to attempting to set up a > > > > > > virtual host. i assume *:80 is the port? in which case, i suppose it > > > > > > may be possible that the port is incorrect? in which case, i'm > > > > > > unsure > > > > > > as to where to check this... i assume under the apache conf file? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---