https://github.com/nandoflorestan/redirector
Pyramid app that redirects any incoming GET requests to another domain
https://github.com/nandoflorestan/redirector
Last synced: 4 months ago
JSON representation
Pyramid app that redirects any incoming GET requests to another domain
- Host: GitHub
- URL: https://github.com/nandoflorestan/redirector
- Owner: nandoflorestan
- License: other
- Created: 2017-04-01T07:36:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T20:01:07.000Z (about 8 years ago)
- Last Synced: 2025-01-09T16:07:22.288Z (6 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
==========
redirector
==========This is a (very small) Pyramid application that does one thing only:
It redirects any incoming GET requests to another domain. Or actually,
to another combination of protocol, domain and port.For more details, please see the redirector/ subdirectory.
Deploying on Webfaction
=======================Here is how I deploy this on http://www.webfaction.com.
First I go into Webfaction's control panel and create an application of type
"Custom app (listening on port)".Then::
cd webapps/redirector # Go into the directory of our application.
pyvenv-3.5 venv # Create a virtual environment with Python 3.5
source venv/bin/activate # Enter our new virtual environment# Install some Python packages:
venv/bin/easy_install -UZ pyramid waitress ipdb# Install redirector
venv/bin/pip install git+https://github.com/nandoflorestan/redirector.git# Paste a production.ini configuration file
wget https://github.com/nandoflorestan/redirector/raw/master/production.ini# Edit your `production.ini`
nano production.ini
# Set the port to the number provided by Webfaction.Now you can run the server temporarily, just to test it::
venv/bin/pserve production.ini
If that works, you can quit the server with CTRL+C.
Now you need to set up cron to run the server when the machine boots::
crontab -e # Open the crontab file in your favorite text editor.
# Add a line similar to this one:
@reboot exec ~/webapps/redirector/venv/bin/pserve ~/webapps/redirector/production.ini >> ~/webapps/redirector/redirector.log 2>&1 &This page explains some of the things we do in the above line:
http://www.somacon.com/p38.php