Slow local windows django dev environment - windows

My local django dev environment (apache 2.2, Python 2.6, Django 1.2a, mod_wsgi, sqlite, win7 64bit) is really slow. It usually takes 15sec-30sec to load a page.
Any ideas what might be slowing it down? Same application on the production server runs just fine.
Task manager shows:
Task Manager http://img268.imageshack.us/img268/4396/20100201210438.gif

What host name are you using to access your site? Are you using 'localhost'? If so, try using '127.0.0.1' instead and see if it runs quicker.
Seen a few times where people would experience delays because of fact that IPV6 is enabled by default on Windows 7. This was causing issues when accessing via localhost. The solution was to edit:
C:\Windows\system32\drivers\etc\hosts
and comment out the line:
::1 localhost
Ie., make it so it reads:
# ::1 localhost
If there is a line:
# 127.0.0.1 localhost
uncomment it so it reads:
127.0.0.1 localhost
Anyway, think that was what the changes needed to be.

Related

Can't connect to 127.0.0.1 on High Sierra

I have set up localhost on High Sierra and have all of my web projects in the Sites directory. Everything works fine in that I can access my site using:
http://localhost/~foo/my-site
No problems here. However, I now require Cassandra for one of my projects and I am trying to connect to it on the default ports using:
127.0.0.1:9042
It doesn't work. If I go to 127.0.0.1 I get:
Forbidden
You don't have permission to access / on this server.
I can ping 127.0.0.1 though. Any ideas on how I can get localhost to work while still using Sites?

Safari can’t connect to the server local host

Whenever I start Tomcat, and open http://localhost:8080 I get the following error.
Safari can’t open the page “localhost:8080” because Safari can’t connect to the server “localhost”.
It used to work before today. All I did earlier today was block some websites using the host files, but I restored them back again, and now it looks like this.
#
##
# Host Database
#
#
# localhost is used to configure the lookback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
If I start and stop the server using Eclipse, it works. But localhost can’t connect to server using Safari or Google Chrome either..
I know there are a lot of similar questions, but none of them seemed to help.
Thanks a lot in advance!

OSX can't access localhost, only username.local

I've been facing this problem in mountain lion 10.8.3 and I cannot seem to find an answer. The problem is that I can access my "localhost" using username.local or http://127.0.0.1/ but not through localhost. I'm using apache 2.2 and virtualhostx, and for now is fine becuase I map every virtual host with a folder, but when developing in java, using Tomcat, I cannot access localhost, also there I have to access username.local..
my hosts file
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
If I cant find a solution I only can think of a fresh reinstall.. And this will be very annoying..
check your httpd.conf for this line
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
i had the same issue. Then i discovered that the httod-vhosts.conf file was commented out when i upgraded my OS.

Using dnsmasq on a Windows VM in VirtualBox on a Mac (+ MAMP)

I'm using dnsmasq on the Mac (OS X 10.7) to facilitate local development (along with MAMP), with just this pretty simple config:
[dnsmasq.conf]
address=/dev/127.0.0.1
.. pretty darn simple. All my *.dev domains resolve to 127.0.0.1 (localhost). Together with:
[DNS Servers]
127.0.0.1
8.8.8.8
8.8.8.4
..as my Mac's DNS settings, this works a treat.
But then I also have a pretty stock Windows 7 SP 1 VM running in VirtualBox (latest). It uses 10.0.2.* as its IP subnet within Windows. At the moment I have to use a service like http://xip.io + another hostname alias to use my *.dev sites in Windows, e.g:
[ if Mac's local IP is 192.168.1.50 ]
something.dev.192.168.1.50.xip.io
..and I need to have this extra ServerAlias manually set up in my Apache config, and keep it updated each time my local IP address changes.
Is there any way I can set up either dnsmasq, VirtualBox, or my Windows IP settings (or a combination of these) so that I can use my .dev hostnames (e.g. http://something.dev/) directly from Windows?
Try this:
https://github.com/stackia/DNSAgent
It has functions similar to Dnsmasq server= and address=
and a rule converter: https://stackia.github.io/masq2agent/
If you mean that you want to run something like dnsmasq on your windows vm then I share your pain. I have been trying to get something setup on a windows host to do wildcard localhost sites without doing something like xip.io but I am having problems getting it to work. Dnsmasq on the osx machine I have was a breeze, but trying to get Acrylic DNS to work on windows the same way hasn't worked. I do have it running as a local caching DNS, and it should be doing the wildcard part, but having problems getting over the final steps.
Check it out. Looks neat, free, and a dnsmasq alternative on windows. And if you get it working post your results! I'll do the same if I can get it going.

How to set up Virtual Hosting on a Mac (local)

How can I setup a virtual hosting on my Mac. It should be easy by adding a 127.0.0.1 line to the hosts file and editing the apache configuration. But for some reason, it doesn't work with me...
And no, MAMP is not an option since you can't setup vhosts in MAMP (except if you buy the MAMP Pro...)
Any advice?
It works just fine, i have several vhosts set up on my OS X box under apache. Make sure that you are using name-based virtual hosting AND that if you are using apache that is distributed with OS X and the vhosts config is in a separate file (e.g. in /etc/apache2/other/httpd-vhosts.conf) that it is actually getting included. Also you can always test apachectl -t -D DUMP_VHOSTS to see if the virtual hosts are actually getting defined.

Resources