Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Now that you know how to configure and secure a web server, let’s look at some more advanced deployments and how to share data. For this first example, let’s deploy a CGI application on the web server.
Step 1. | Create a directory to hold your web application: # mkdir /var/www/web-app-01 |
Step 2. | Copy any required files into the newly created directory: # cp /home/user01/app.py /var/www/web-app-01Note You can get the app.py from http://sourceforge.net/projects/rhcelabscripts/. |
Step 3. | Add the following section to your /etc/httpd/conf/httpd.conf file: ScriptAlias /webapp "/var/www/web-app-01"
<Directory "/var/www/web-app-01/">
Options ExecCGI FollowSymLinks
Order allow,deny
Allow from all
</Directory> |
Step 4. | Check the config file for syntax errors: # service httpd configtest
Syntax OK |
Step 5. | Set the correct permissions for the directory: # chmod 755 –R /var/www/web-app-01 |
Step 6. |