I am trying to use do all of the worj through a ssh terminal on a
windows XP box and want to see the results in the firefox browser on
the Windows XP box. Why? because the mac is old and the graphics are
slow to respond. So I am wanting to use the OS X box as the server and
do all of the work and testing from the Windows XP box on the same
local network.
My questions are:
1. How do I get fastcgi and apache to serve the pages
2. How do I view them from the windows XP firefox browser.
Thanks:)
What is the file mysite.fcgi? I found this on the other set of
directions for installing fastcgi.
Thanks:)
I use an old Mac running 10.3 as my server, and I develop on a
completely different machine at home. When I am developing, I use the
built in django server on my development machine. It automatically
updates things when I make a change to any file, and I can see right
away how things are looking and working, and make changes.
When I am ready, I just ftp everything over to the Mac server. I use
django to start the fcgi process (see
http://www.djangoproject.com/documentation/fastcgi/). Making changes
to files (except templates) on the Mac server requires stoping the fcgi
process, updating, syncdbing, whatever, and then restarting fcgi - so
it would be a real pain to use that in a development environment.
So my advice is to use your windows computer to develop and run the
development server, and then deploy to your mac. (Hopefully this is
what you had in mind already).
Anyway, let us know how far along in the process you are, and where you
are getting stuck, and we can probably be more help to you.
2. Apache runs fine on my Mac. I have installed fastcgi and python
2.5. I have the most up to date version of django as well as sqlite3
and mysql. I tried following the directions, but I do not think I have
my httpd.conf configured correctly for fastcgi. Do I need a site.fcgi
file? Which directions work better, the one for fastcgi in general or
the OS X specific fastcgi instructions. They are both on the django
site, but they seem to be relaying different information.
3. Once installed and configured, do I still need to turn on django
from the manage.py script in my django directory? Or does this script
matter anymore since I amusing the apache server?
If someone could just send me an exampl of how they have fastcgi
working on their mac and how to set up the httpd.conf, I think I can
figure the rest out.
Thanks:)
SA
On Nov 19, 5:25 pm, tsny...@uark.edu wrote:
> So how far have you gotten? Do you have apache, python 2.4, django,
> and flup on your Mac? Are you having trouble installing things? Are
> you just having trouble with fcgi? Do you have an ip number or name
> for your Mac server? What is your current situation.
>
> I use an old Mac running 10.3 as my server, and I develop on a
> completely different machine at home. When I am developing, I use the
> built in django server on my development machine. It automatically
> updates things when I make a change to any file, and I can see right
> away how things are looking and working, and make changes.
>
> When I am ready, I just ftp everything over to the Mac server. I use
> django to start the fcgi process (seehttp://www.djangoproject.com/documentation/fastcgi/). Making changes
>
> I figured out how to use the django server for my local development.
> My question now is how to get fcgi working correctly. I need to do a
> couple of things:
> 1. This is not really related to django, but I need to tie a server
> name to my IP. Since my router has the IP address, I need to figure
> out how to get a server name for my mac behind the router so the rest
> of the world can see.
I can't help with this part of it, but I think this may be where you
want to start. If you can't serve regular web pages, why go through
all the setup required below?
>
> 2. Apache runs fine on my Mac. I have installed fastcgi and python
> 2.5. I have the most up to date version of django as well as sqlite3
> and mysql. I tried following the directions, but I do not think I
> have
> my httpd.conf configured correctly for fastcgi. Do I need a site.fcgi
> file? Which directions work better, the one for fastcgi in general or
> the OS X specific fastcgi instructions. They are both on the django
> site, but they seem to be relaying different information.
For the installation and configuration, I mostly followed the
instructions at http://code.djangoproject.com/wiki/OsxFcgi, except
for the starting and stopping instructions. The instructions at
http://www.djangoproject.com/documentation/fastcgi/ are
complementary, and useful, too. They explain, for example, that you
do not need an actual site.fcgi file.
I already had mod_fastcgi installed from some other project I
puttered around with a couple of years ago, so I don't remember the
details of getting that working. I'm sure the online documentation
must help(?)
----------
I did not change /etc/hosts, only httpd.conf. I didn't want to use
virtual hosts in apache. This is what I have added at the end of my
httpd.conf file:
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
</IfModule>
Include /private/etc/httpd/users/*.conf
#this stuff added to get django to work....
FastCgiExternalServer /Library/WebServer/Documents/django.fcgi -host
localhost:8882
RewriteEngine On
Alias /media /Users/tamara/Documents/django-python/django_src/django/
contrib/admin/media
RewriteRule ^(/media.*)$ $1 [L] # for admin media
RewriteRule ^(/admin.*)$ /django.fcgi$1 [L] # admin application
RewriteRule ^(/events.*)$ /django.fcgi$1 [L]
-------------
The instructions for starting and stopping can be replaced with info
from this web page:
http://www.djangoproject.com/documentation/fastcgi/
basically, you need to use manage.py runfcgi. be sure to use tcp
sockets, not unix sockets.
The command I use to start it is:
manage.py runfcgi daemonize=true method=threaded host=127.0.0.1
port=8882 pidfile=$PIDFILE
Note that my actual ip number is not 127.0.0.1, but you need to put
the 127.0.0.1 here for it to work, so don't just substitute in your
own ip.
>
> 3. Once installed and configured, do I still need to turn on django
> from the manage.py script in my django directory? Or does this script
> matter anymore since I amusing the apache server?
>
You do not need to use the django runserver, but you do need to use
the runfcgi (as I mentioned above).
Your router should have assigned an ip number to your Mac. From
firefox/safari on your mac, you should be able to type in http://
the.assigned.ip.number/admin/ and get the admin application. (as
opposed to typing in http://127.0.0.1:8000, as you would do if you
were using runserver).
Remember that any time you make changes to httpd.conf, you have to
restart apache afterwards. And any time you make changes to any of
your django applications (except in templates), you will have to stop
and then restart the runfcgi from manage.py (and you will probably
have to syncdb while runfcgi is off)
Hopefully this has been helpful. If you run into problems, post back.
Tamara