Jo Grey
2016-06-10 00:14:17 UTC
For background, I am really new to setting up servers via ssh and the
command line so please excuse my inexperience.
I am trying to build a basic app using the bottle (bottlepy) micro
framework, I want to host the app using httpd apache server running on
centOS 6.6
So far I have been able to get httpd to serve a basic index.html file from
the /var/www/html directory. So the apache server is confirmed up and
running.
Where I am stuck is how to serve the bottle app with httpd. I read the
deployment documentation on the bottlepy site but they skip over specific
details. I have tried a few permutations based off other docs I have found,
but nothing has worked so I am looking for some really explicit suggestions
on what to do here.
At a high level I understand that what has to happen is:
1. alter the httpd configuration so that it loads the app.wsgi file
2. write an app.wsgi file that loads the python application file app.py
First off, is that correct? Or does the app.wsgi file "replace" the app.py
file? As in do I just change the file extension and drop into the /var/www
directory? That doesn't seem right, but what do I know.
So my three questions are as follows:
1. httpd config:
- Where *exactly do I put the virtualhost configuration for httpd at?
- Does it go inside the /etc/httpd/conf/httpd.conf file, and if so,
where at in the file does it go?
- Or does it go in its own file, and if so, where do I put that file,
what should I name it, and how will httpd know to read it?
This is the config info I have, based off the bottle docs (server is apache
2.2):
<VirtualHost *>
ServerName test_server
WSGIDaemonProcess app.wsgi user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias / /var/www/my_app/app.wsgi
<Directory /var/www/my_app>
WSGIProcessGroup app.wsgi
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory></VirtualHost>
1.
app.wsgi file:
- What should this file contain to get it to load my python app.py file?
2.
app.py file:
- Where do I put my python app.py file? Or is this explicitly defined in
the app.wsgi file so it can be put anywhere?
- How do I make sure the python code is actually executed and not
just read as a text file?
Thanks in advance.
--
command line so please excuse my inexperience.
I am trying to build a basic app using the bottle (bottlepy) micro
framework, I want to host the app using httpd apache server running on
centOS 6.6
So far I have been able to get httpd to serve a basic index.html file from
the /var/www/html directory. So the apache server is confirmed up and
running.
Where I am stuck is how to serve the bottle app with httpd. I read the
deployment documentation on the bottlepy site but they skip over specific
details. I have tried a few permutations based off other docs I have found,
but nothing has worked so I am looking for some really explicit suggestions
on what to do here.
At a high level I understand that what has to happen is:
1. alter the httpd configuration so that it loads the app.wsgi file
2. write an app.wsgi file that loads the python application file app.py
First off, is that correct? Or does the app.wsgi file "replace" the app.py
file? As in do I just change the file extension and drop into the /var/www
directory? That doesn't seem right, but what do I know.
So my three questions are as follows:
1. httpd config:
- Where *exactly do I put the virtualhost configuration for httpd at?
- Does it go inside the /etc/httpd/conf/httpd.conf file, and if so,
where at in the file does it go?
- Or does it go in its own file, and if so, where do I put that file,
what should I name it, and how will httpd know to read it?
This is the config info I have, based off the bottle docs (server is apache
2.2):
<VirtualHost *>
ServerName test_server
WSGIDaemonProcess app.wsgi user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias / /var/www/my_app/app.wsgi
<Directory /var/www/my_app>
WSGIProcessGroup app.wsgi
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory></VirtualHost>
1.
app.wsgi file:
- What should this file contain to get it to load my python app.py file?
2.
app.py file:
- Where do I put my python app.py file? Or is this explicitly defined in
the app.wsgi file so it can be put anywhere?
- How do I make sure the python code is actually executed and not
just read as a text file?
Thanks in advance.
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.