Posts Tagged Difficulty: Easy
Serving django media files from the same host as the passenger app server
Posted by Adam in Programming, Python on Monday September 20, 2010
WARNING: Please read before continuing ▼
Difficulty: Easy
Time: ~5 Minutes
Last Updated: 20rd September 2010
Applies to: *NIX
The recommended configuration for django is to have any static files, such as script, CSS or images uploaded onto a CDN network. While this is the best configuration for a large site, for toy applications it is overkill.
Also, you may wish to run your development environment using passenger, rather than using manage.py runserver.
To start, we need to make a media directory in your passenger app root, and then create a symbolic link to the admin media files located on your system.
1 2 3 | cd /var/www mkdir media #the directory where our media files will be stored ln -s /usr/lib/pymodules/python2.6/django/contrib/admin/media/ admin_media |
Next, we need to disable passenger on the directories/symlinks we have created, as per the previous article on the blog.
Once this is done, edit settings.py in your django app, specifying the new addresses for your media.
Finally, restart apache, and you should now be able to access the media files you need.
Serving non-python files from a subdirectory of the passenger root.
Posted by Adam in PHP, Programming, Python on Wednesday September 15, 2010
WARNING: Please read before continuing ▼
Difficulty: Easy
Time: ~5 Minutes
Last Updated: 23rd September 2010
Applies to: *NIX
Serving non-python or ruby files from a subdirectory below the passenger app root requires a simple change to the site configuration.
Open it up, and add something similar to this under the VirtualHost entry (this example shows the subdirectory phpPgAdmin being disabled, so that phpPgAdmin can be served by php instead):
1 2 3 4 | Alias /phpPgAdmin /var/www/phpPgAdmin <Location /phpPgAdmin> PassengerEnabled off </Location> |
Once this is done, restart php and any requests made to yourdomain.com/phpPgAdmin will not be served by passenger.
Opening an elevated command prompt
Posted by Adam in Changing Settings, Linux, OS X, Windows on Sunday November 29, 2009
WARNING: Please read before continuing ▼
Difficulty: Easy
Time: varies
Last Updated: 29th November 2009
Applies to: OS X, Windows, *NIX
Often when performing system administration, you will come across a command that needs to be run as a more priviliged user. Depending on what operating system you use, the procedure for opening an elevated command prompt varies. Read the rest of this entry »
Resetting Windows product activation notices
Posted by Adam in Setting Up, Uncategorized, Windows on Thursday November 5, 2009
WARNING: Please read before continuing ▼
Difficulty: Easy
Time: ~1 Minute
Last Updated: 5th November 2009
Applies to: Windows
Since Windows XP, Microsoft has required that all CD keys are validated with them at install time, to combat piracy. Whilst this generally has little impact, if you have misplaced your CD key, or are waiting for one to arrive, you can end up locked out of your own computer.
Read the rest of this entry »
Renaming the admin user on a WordPress 2.8+ blog
Posted by Adam in Improving Security on Friday October 16, 2009
WARNING: Please read before continuing ▼
Difficulty: Easy
Time: ~5 Minutes
Last Updated: 16th October 2009
Applies to: WordPress
By default, WordPress uses “admin” as the log in name for the first user. With this information, a prospective cracker is only a password away from your wordpress admin account. By changing the admin user name, the minimum amount of information required for any miscreant to access the account is increased.
Removing Antivirus Pro 2010
Posted by Adam in Fixing Errors, Improving Security, Windows on Monday October 12, 2009
WARNING: Please read before continuing ▼
Difficulty: Easy
Time: ~30 Minutes
Last Updated: 12th October 2009
Applies to: Windows
Antivirus Pro 2010 is a variety of malware that pops up fake antvirus notifications attempting to coerce you into paying for a full version to remove these fake infections. Whilst its constant nagging is irritating, it is relatively mild as far as malware goes and is fairly simple to remove though it is often packaged with other more serious malware.