Apache/Mongrel/Rails relative path problem

Folks,

I know this is probably a little off topic since I’m looking for
Apache/Mongrel help with a RoR application. But I can’t seem to find
anything to shed some light and was hoping someone on here might be
able to help.

I’ve got a RoR app running via Mongrel under Apache/SSL on a
development server. The application is defined via Apache/SSL to be
running under a certain directory such that
https://host.development.domain.edu/directory
works to get to the application and the application knows about this
directory with this line in in the development.rb file

ActionController::AbstractRequest.relative_url_root = ‘/dps’

I figure RoR/Mongrel understands because the initial page loads and
moving to another page loads. The problem is that none of the CSS an
Javascript files stored under the public directory are loading. The
HTML generated by the link_tag options are working to generate the
appropriate HTML:

In looking at apache error logs, is seems that Apache is trying to
find these .css and .js files under the Apache web root directory
structure. What do I need to do so that Apache passes all requests
onto Mongrel?

Any hints or suggestions would be welcome,
Jak

On Thu, 2008-07-24 at 06:45 -0700, Jack wrote:

works to get to the application and the application knows about this

In looking at apache error logs, is seems that Apache is trying to
find these .css and .js files under the Apache web root directory
structure. What do I need to do so that Apache passes all requests
onto Mongrel?

Any hints or suggestions would be welcome,


1 - why not show us what your http configuration looks like…

2 - I’ve never used any designation for ‘relative_url_root’ in any of
the environment files…not sure why you would do that

3 - the links to your stylesheets & javascripts are clearly being
impacted by your ‘relative_url_root’ which seems clear is the reason
that they are not being located

Craig

On Jul 24, 10:26 am, Craig W. [email protected] wrote:

running under a certain directory such thathttps://host.development.domain.edu/directory


1 - why not show us what your http configuration looks like…

2 - I’ve never used any designation for ‘relative_url_root’ in any of
the environment files…not sure why you would do that

3 - the links to your stylesheets & javascripts are clearly being
impacted by your ‘relative_url_root’ which seems clear is the reason
that they are not being located

Craig

My apologies in advance for the long post. At the end is the httpd
configuration.

Actually if I don’t have the relative_url_root, I still have the same
problem with the css/js files. But in addition, the RoR application
controller fails to be able to route properly.

I should mention a couple of things regarding this RoR config/app
problem:

  1. I’m trying to troubleshoot this because I’m one of the RoR
    programmers for the app. The admin guy is just configuring the server
    and not familiar with the app. (I’m familiar with some of the server
    setup stuff from other work I do.)

  2. This application uses Pubcookie for authentication. This is one of
    the reasons that we have used the relative_url_root, if I’m
    remembering correctly. The other reason has to do with providing a
    user friendly URL in the future when this app is demoed and used.
    Lines 23-257 below are for making sure apache passes the pubcookie
    user id along to the Rails app.

Apache Server Information

Configuration:
In file: /etc/httpd/conf/httpd.conf
44: ServerTokens OS
63: PidFile run/httpd.pid
68: Timeout 120
74: KeepAlive Off
81: MaxKeepAliveRequests 100
87: KeepAliveTimeout 15
101: StartServers 8
102: MinSpareServers 5
103: MaxSpareServers 20
104: ServerLimit 256
105: MaxClients 256
106: MaxRequestsPerChild 4000
134: Listen 80
In file: /etc/httpd/conf.d/BackupPC.conf
1: <Directory /usr/share/BackupPC/sbin/>
9: order deny,allow
10: deny from all
11: allow from 127.0.0.1
12: AuthType Basic
13: AuthUserFile /etc/BackupPC/apache.users
14: AuthName "BackupPC
16: require valid-user
:
21: Alias /BackupPC/images /usr/share/BackupPC/html/
22: ScriptAlias /BackupPC /usr/share/BackupPC/sbin/BackupPC_Admin
In file: /etc/httpd/conf.d/manual.conf
5: AliasMatch ^/manual(?:/(?:de|en|fr|ja|ko|ru))?(/.)?$ “/var/www/
manual$1”
7: <Directory “/var/www/manual”>
8: Options Indexes
9: AllowOverride None
10: Order allow,deny
11: Allow from all
:
In file: /etc/httpd/conf.d/php.conf
11: AddHandler php5-script .php
12: AddType text/html .php
18: DirectoryIndex index.php
In file: /etc/httpd/conf.d/pubcookie.conf
3: PubcookieGrantingCertFile /usr/local/pubcookie/keys/
pubcookie_granting.cert
4: PubcookieSessionCertFile /etc/pki/tls/certs/STAR_LIB_cert.pem
5: PubcookieSessionKeyFile /etc/pki/tls/private/STAR_LIB_key.pem
6: PubcookieKeyDir /usr/local/pubcookie/keys
7: PubcookieDomain .virginia.edu
8: PubcookieAuthTypeNames Pubcookie NetBadge
9: PubcookieLogin https://netbadge.virginia.edu/
12: <Directory “/”>
13: PubcookieInactiveExpire -1
:
In file: /etc/httpd/conf.d/python.conf
9: <Directory “/var/www/manual/mod/mod_python”>
10: <Files .html>
11: SetHandler default-handler
:
:
In file: /etc/httpd/conf.d/squid.conf
6: ScriptAlias /Squid/cgi-bin/cachemgr.cgi /usr/lib64/squid/
cachemgr.cgi
9: <Location /Squid/cgi-bin/cachemgr.cgi>
10: order allow,deny
11: allow from localhost.localdomain
:
In file: /etc/httpd/conf.d/ssl.conf
18: Listen 443
30: AddType application/x-x509-ca-cert .crt
31: AddType application/x-pkcs7-crl .crl
37: SSLPassPhraseDialog builtin
43: SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
44: SSLSessionCacheTimeout 300
49: SSLMutex default
61: SSLRandomSeed startup file:/dev/urandom 256
62: SSLRandomSeed connect builtin
74: SSLCryptoDevice builtin
81:
84: DocumentRoot “/var/www/html_ssl”
89: ErrorLog logs/ssl_error_log
90: TransferLog logs/ssl_access_log
91: LogLevel warn
95: SSLEngine on
100: SSLProtocol all -SSLv2
105: SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:
+LOW
112: SSLCertificateFile /etc/pki/tls/certs/STAR_LIB_cert.pem
119: SSLCertificateKeyFile /etc/pki/tls/private/STAR_LIB_key.pem
187: <Files ~ “.(cgi|shtml|phtml|php3?)$”>
188: SSLOptions +StdEnvVars
:
190: <Directory “/var/www/cgi-bin”>
191: SSLOptions +StdEnvVars
:
220: SetEnvIf User-Agent “.MSIE.” nokeepalive ssl-unclean-
shutdown downgrade-1.0 force-response-1.0
226: CustomLog logs/ssl_request_log “%t %h %{SSL_PROTOCOL}x %
{SSL_CIPHER}x “%r” %b”
229: ProxyRequests Off
230: ProxyPreserveHost On
232: <LocationMatch ^/dps/request/uva|^/dps/admin>
233: RequestHeader set X_FORWARDED_PROTO ‘https’
235: SetEnv force-proxy-request-1.0 1
236: SetEnv proxy-nokeepalive 1
237: AuthType NetBadge
238: require valid-user
239: PubcookieAppId dps
240: ProxyPassReverse http://127.0.0.1:9050
241: RewriteEngine On
242: RewriteCond %{REQUEST_FILENAME} !-f
243: RewriteCond %{REQUEST_URI} !.(js|ico|gif|jpg|png|css)$
244: RewriteRule /dps/(.
) http://127.0.0.1:9050/$1 [E=RU:%
{REMOTE_USER},P,QSA,L]
245: RequestHeader add REMOTE_USER %{RU}e
:
247: <LocationMatch ^/dps>
248: RequestHeader set X_FORWARDED_PROTO ‘https’
250: SetEnv force-proxy-request-1.0 1
251: SetEnv proxy-nokeepalive 1
252: ProxyPassReverse http://127.0.0.1:9050
253: RewriteEngine On
254: RewriteCond %{REQUEST_FILENAME} !-f
255: RewriteCond %{REQUEST_URI} !.(js|ico|gif|jpg|png|css)$
256: RewriteRule /dps/(.
) http://127.0.0.1:9050/$1 [E=RU:%
{REMOTE_USER},P,QSA,L]
257: RequestHeader add REMOTE_USER %{RU}e
:
:
In file: /etc/httpd/conf.d/webalizer.conf
6: Alias /usage /var/www/usage
8: <Location /usage>
9: Order deny,allow
10: Deny from all
11: Allow from 127.0.0.1
12: Allow from ::1
:
In file: /etc/httpd/conf.d/welcome.conf
7: <LocationMatch “^/+$”>
8: Options -Indexes
9: ErrorDocument 403 /error/noindex.html
:
In file: /etc/httpd/conf/httpd.conf
230: User apache
231: Group apache
250: ServerAdmin [email protected]
273: UseCanonicalName Off
280: DocumentRoot “/var/www/html”
290:
291: Options FollowSymLinks
292: AllowOverride None
:
305: <Directory “/var/www/html”>
319: Options Indexes FollowSymLinks
326: AllowOverride None
331: Order allow,deny
332: Allow from all
:
340: <Directory “/var/www/html_ssl”>
355: Options All
363: AllowOverride AuthConfig
368: Order allow,deny
369: Allow from all
:
391: UserDir disable
427: DirectoryIndex index.html index.html.var
434: AccessFileName .htaccess
440: <Files ~ “^.ht”>
441: Order allow,deny
442: Deny from all
:
449: TypesConfig /etc/mime.types
460: DefaultType text/plain
469: MIMEMagicFile conf/magic
480: HostnameLookups Off
508: ErrorLog logs/error_log
515: LogLevel warn
521: LogFormat “%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-
Agent}i”” combined
522: LogFormat “%h %l %u %t “%r” %>s %b” common
523: LogFormat “%{Referer}i -> %U” referer
524: LogFormat “%{User-agent}i” agent
550: CustomLog logs/access_log combined
560: ServerSignature On
575: Alias /icons/ “/var/www/icons/”
577: <Directory “/var/www/icons”>
578: Options Indexes MultiViews FollowSymLinks
579: AllowOverride None
580: Order allow,deny
581: Allow from all
:
589: DAVLockDB /var/lib/dav/lockdb
600: ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”
606: <Directory “/var/www/cgi-bin”>
607: AllowOverride None
608: Options None
609: Order allow,deny
610: Allow from all
:
628: IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
635: AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
637: AddIconByType (TXT,/icons/text.gif) text/*
638: AddIconByType (IMG,/icons/image2.gif) image/*
639: AddIconByType (SND,/icons/sound2.gif) audio/*
640: AddIconByType (VID,/icons/movie.gif) video/*
642: AddIcon /icons/binary.gif .bin .exe
643: AddIcon /icons/binhex.gif .hqx
644: AddIcon /icons/tar.gif .tar
645: AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
646: AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
647: AddIcon /icons/a.gif .ps .ai .eps
648: AddIcon /icons/layout.gif .html .shtml .htm .pdf
649: AddIcon /icons/text.gif .txt
650: AddIcon /icons/c.gif .c
651: AddIcon /icons/p.gif .pl .py
652: AddIcon /icons/f.gif .for
653: AddIcon /icons/dvi.gif .dvi
654: AddIcon /icons/uuencoded.gif .uu
655: AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
656: AddIcon /icons/tex.gif .tex
657: AddIcon /icons/bomb.gif core
659: AddIcon /icons/back.gif …
660: AddIcon /icons/hand.right.gif README
661: AddIcon /icons/folder.gif ^^DIRECTORY^^
662: AddIcon /icons/blank.gif ^^BLANKICON^^
668: DefaultIcon /icons/unknown.gif
686: ReadmeName README.html
687: HeaderName HEADER.html
693: IndexIgnore .??* ~ # HEADER README RCS CVS *,v *,t
733: AddLanguage ca .ca
734: AddLanguage cs .cz .cs
735: AddLanguage da .dk
736: AddLanguage de .de
737: AddLanguage el .el
738: AddLanguage en .en
739: AddLanguage eo .eo
740: AddLanguage es .es
741: AddLanguage et .et
742: AddLanguage fr .fr
743: AddLanguage he .he
744: AddLanguage hr .hr
745: AddLanguage it .it
746: AddLanguage ja .ja
747: AddLanguage ko .ko
748: AddLanguage ltz .ltz
749: AddLanguage nl .nl
750: AddLanguage nn .nn
751: AddLanguage no .no
752: AddLanguage pl .po
753: AddLanguage pt .pt
754: AddLanguage pt-BR .pt-br
755: AddLanguage ru .ru
756: AddLanguage sv .sv
757: AddLanguage zh-CN .zh-cn
758: AddLanguage zh-TW .zh-tw
767: LanguagePriority en ca cs da de el eo es et fr he hr it ja ko
ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
774: ForceLanguagePriority Prefer Fallback
783: AddDefaultCharset UTF-8
803: AddType application/x-compress .Z
804: AddType application/x-gzip .gz .tgz
826: AddHandler type-map var
834: AddType text/html .shtml
835: AddOutputFilter INCLUDES .shtml
873: Alias /error/ “/var/www/error/”
877: <Directory “/var/www/error”>
878: AllowOverride None
879: Options IncludesNoExec
880: AddOutputFilter Includes html
881: AddHandler type-map var
882: Order allow,deny
883: Allow from all
884: LanguagePriority en es de fr
885: ForceLanguagePriority Prefer Fallback
:
913: BrowserMatch “Mozilla/2” nokeepalive
914: BrowserMatch “MSIE 4.0b2;” nokeepalive downgrade-1.0 force-
response-1.0
915: BrowserMatch “RealPlayer 4.0” force-response-1.0
916: BrowserMatch “Java/1.0” force-response-1.0
917: BrowserMatch “JDK/1.0” force-response-1.0
926: BrowserMatch “Microsoft Data Access Internet Publishing
Provider” redirect-carefully
927: BrowserMatch “MS FrontPage” redirect-carefully
928: BrowserMatch “^WebDrive” redirect-carefully
929: BrowserMatch “^WebDAVFS/1.[0123]” redirect-carefully
930: BrowserMatch “^gnome-vfs/1.0” redirect-carefully
931: BrowserMatch “^XML Spy” redirect-carefully
932: BrowserMatch “^Dreamweaver-WebDAV-SCM1” redirect-carefully
939: <Location /server-status>
940: SetHandler server-status
941: Order deny,allow
942: Deny from all
943: Allow from .virginia.edu
:
951: <Location /server-info>
952: SetHandler server-info
953: Order deny,allow
954: Deny from all
955: Allow from .virginia.edu
:

I’m wondering if the order of things matters in the configuration?

Thanks in advance for taking the time to look at this,
Jack

On Jul 24, 2:14 pm, Jack [email protected] wrote:

able to help.
moving to another page loads. The problem is that none of the CSS an
onto Mongrel?
impacted by your ‘relative_url_root’ which seems clear is the reason

  1. I’m trying to troubleshoot this because I’m one of the RoR
    application.
    87: KeepAliveTimeout 15
    10: deny from all
    manual$1"
    In file: /etc/httpd/conf.d/pubcookie.conf
    :
    10: order allow,deny
    61: SSLRandomSeed startup file:/dev/urandom 256
    +LOW
    226: CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %
    240: ProxyPassReversehttp://127.0.0.1:9050
    251: SetEnv proxy-nokeepalive 1
    6: Alias /usage /var/www/usage
    :
    305: <Directory “/var/www/html”>
    :
    480: HostnameLookups Off
    577: <Directory “/var/www/icons”>
    609: Order allow,deny
    610: Allow from all
    :
    628: IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
    635: AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
    637: AddIconByType (TXT,/icons/text.gif) text/*
    638: AddIconByType (IMG,/icons/image2.gif) image/*
    639: AddIconByType

read more »

Just in case this would be helpful in resolving the problem, here is
the mongrel configuration file being used -

:config_script:
:environment: development
:host: 0.0.0.0
:config_file:
:num_processors: 1024
:group:
:docroot: public
:port: “9050”
:prefix:
:timeout: 0
:debug: false
:mime_map:
:cwd: /projects/tracksys
:daemon: true
:user:
:log_file: log/mongrel.log
:includes:

  • mongrel
    :pid_file: tmp/pids/mongrel.pid

I tried setting prefix to dps but that seemed to just add another dps
to the url so it looked like this

https://host.domain.edu/dps/dps/request

which caused other problems.

On Thu, 2008-07-24 at 11:19 -0700, Jack wrote:

I know this is probably a little off topic since I’m looking for
ActionController::AbstractRequest.relative_url_root = ‘/dps’
In looking at apache error logs, is seems that Apache is trying to
the environment files…not sure why you would do that

user friendly URL in the future when this app is demoed and used.
68: Timeout 120
In file: /etc/httpd/conf.d/BackupPC.conf
22: ScriptAlias /BackupPC /usr/share/BackupPC/sbin/BackupPC_Admin
11: AddHandler php5-script .php
9: PubcookieLoginhttps://netbadge.virginia.edu/
6: ScriptAlias /Squid/cgi-bin/cachemgr.cgi /usr/lib64/squid/
43: SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
95: SSLEngine on
:
237: AuthType NetBadge
247: <LocationMatch ^/dps>
:
7: <LocationMatch “^/+$”>
291: Options FollowSymLinks
363: AllowOverride AuthConfig
449: TypesConfig /etc/mime.types
550: CustomLog logs/access_log combined
606: <Directory “/var/www/cgi-bin”>

:num_processors: 1024
:log_file: log/mongrel.log
which caused other problems.


ok - gotcha

First off…isolate

Try using a web browser directly to your mongrel instance…

http://host.domain.edu:9050

and make sure it all works so that your only issue is apache proxy.

Then I would suggest that you get on the mongrel mail list to help with
your proxy setup (after verifying that everything works without proxy)
to get help with the apache configuration (and the mongrel
configuration).

num_processors: 1024 can’t possibly be right

I think ultimately you want to run mongrel_cluster and run 3-5 mongrels
and use proxy_balancer and not the setup that you are running with
ProxyPass but that’s my guess.

Craig

On Jul 24, 10:26 am, Craig W. [email protected] wrote:

running under a certain directory such thathttps://host.development.domain.edu/directory


1 - why not show us what your http configuration looks like…

2 - I’ve never used any designation for ‘relative_url_root’ in any of
the environment files…not sure why you would do that

3 - the links to your stylesheets & javascripts are clearly being
impacted by your ‘relative_url_root’ which seems clear is the reason
that they are not being located

Craig

Actually if I don’t have the relative_url_root, I still have the same
problem with the css/js files. But in addition, the RoR application
controller fails to be able to route properly.

I should mention a couple of things regarding this RoR config/app
problem:

  1. I’m trying to troubleshoot this because I’m one of the RoR
    programmers for the app. The admin guy is just configuring the server
    and not familiar with the app. (I’m familiar with some of the server
    setup stuff from other work I do.)

  2. This application uses Pubcookie for authentication. This is one of
    the reasons that we have used the relative_url_root, if I’m
    remembering correctly. The other reason has to do with providing a
    user friendly URL in the future when this app is demoed and used.
    Lines 232 -257 are for Pubcookie so that when Apache hears back from
    that server, it will pass along the user identified to the RoR
    application.

Apache Server Information

Configuration:
In file: /etc/httpd/conf/httpd.conf
44: ServerTokens OS
63: PidFile run/httpd.pid
68: Timeout 120
74: KeepAlive Off
81: MaxKeepAliveRequests 100
87: KeepAliveTimeout 15
101: StartServers 8
102: MinSpareServers 5
103: MaxSpareServers 20
104: ServerLimit 256
105: MaxClients 256
106: MaxRequestsPerChild 4000
134: Listen 80
In file: /etc/httpd/conf.d/BackupPC.conf
1: <Directory /usr/share/BackupPC/sbin/>
9: order deny,allow
10: deny from all
11: allow from 127.0.0.1
12: AuthType Basic
13: AuthUserFile /etc/BackupPC/apache.users
14: AuthName "BackupPC
16: require valid-user
:
21: Alias /BackupPC/images /usr/share/BackupPC/html/
22: ScriptAlias /BackupPC /usr/share/BackupPC/sbin/BackupPC_Admin
In file: /etc/httpd/conf.d/manual.conf
5: AliasMatch ^/manual(?:/(?:de|en|fr|ja|ko|ru))?(/.)?$ “/var/www/
manual$1”
7: <Directory “/var/www/manual”>
8: Options Indexes
9: AllowOverride None
10: Order allow,deny
11: Allow from all
:
In file: /etc/httpd/conf.d/php.conf
11: AddHandler php5-script .php
12: AddType text/html .php
18: DirectoryIndex index.php
In file: /etc/httpd/conf.d/pubcookie.conf
3: PubcookieGrantingCertFile /usr/local/pubcookie/keys/
pubcookie_granting.cert
4: PubcookieSessionCertFile /etc/pki/tls/certs/STAR_LIB_cert.pem
5: PubcookieSessionKeyFile /etc/pki/tls/private/STAR_LIB_key.pem
6: PubcookieKeyDir /usr/local/pubcookie/keys
7: PubcookieDomain .virginia.edu
8: PubcookieAuthTypeNames Pubcookie NetBadge
9: PubcookieLogin https://netbadge.virginia.edu/
12: <Directory “/”>
13: PubcookieInactiveExpire -1
:
In file: /etc/httpd/conf.d/python.conf
9: <Directory “/var/www/manual/mod/mod_python”>
10: <Files .html>
11: SetHandler default-handler
:
:
In file: /etc/httpd/conf.d/squid.conf
6: ScriptAlias /Squid/cgi-bin/cachemgr.cgi /usr/lib64/squid/
cachemgr.cgi
9: <Location /Squid/cgi-bin/cachemgr.cgi>
10: order allow,deny
11: allow from localhost.localdomain
:
In file: /etc/httpd/conf.d/ssl.conf
18: Listen 443
30: AddType application/x-x509-ca-cert .crt
31: AddType application/x-pkcs7-crl .crl
37: SSLPassPhraseDialog builtin
43: SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
44: SSLSessionCacheTimeout 300
49: SSLMutex default
61: SSLRandomSeed startup file:/dev/urandom 256
62: SSLRandomSeed connect builtin
74: SSLCryptoDevice builtin
81:
84: DocumentRoot “/var/www/html_ssl”
89: ErrorLog logs/ssl_error_log
90: TransferLog logs/ssl_access_log
91: LogLevel warn
95: SSLEngine on
100: SSLProtocol all -SSLv2
105: SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:
+LOW
112: SSLCertificateFile /etc/pki/tls/certs/STAR_LIB_cert.pem
119: SSLCertificateKeyFile /etc/pki/tls/private/STAR_LIB_key.pem
187: <Files ~ “.(cgi|shtml|phtml|php3?)$”>
188: SSLOptions +StdEnvVars
:
190: <Directory “/var/www/cgi-bin”>
191: SSLOptions +StdEnvVars
:
220: SetEnvIf User-Agent “.MSIE.” nokeepalive ssl-unclean-
shutdown downgrade-1.0 force-response-1.0
226: CustomLog logs/ssl_request_log “%t %h %{SSL_PROTOCOL}x %
{SSL_CIPHER}x “%r” %b”
229: ProxyRequests Off
230: ProxyPreserveHost On
232: <LocationMatch ^/dps/request/uva|^/dps/admin>
233: RequestHeader set X_FORWARDED_PROTO ‘https’
235: SetEnv force-proxy-request-1.0 1
236: SetEnv proxy-nokeepalive 1
237: AuthType NetBadge
238: require valid-user
239: PubcookieAppId dps
240: ProxyPassReverse http://127.0.0.1:9050
241: RewriteEngine On
242: RewriteCond %{REQUEST_FILENAME} !-f
243: RewriteCond %{REQUEST_URI} !.(js|ico|gif|jpg|png|css)$
244: RewriteRule /dps/(.
) http://127.0.0.1:9050/$1 [E=RU:%
{REMOTE_USER},P,QSA,L]
245: RequestHeader add REMOTE_USER %{RU}e
:
247: <LocationMatch ^/dps>
248: RequestHeader set X_FORWARDED_PROTO ‘https’
250: SetEnv force-proxy-request-1.0 1
251: SetEnv proxy-nokeepalive 1
252: ProxyPassReverse http://127.0.0.1:9050
253: RewriteEngine On
254: RewriteCond %{REQUEST_FILENAME} !-f
255: RewriteCond %{REQUEST_URI} !.(js|ico|gif|jpg|png|css)$
256: RewriteRule /dps/(.
) http://127.0.0.1:9050/$1 [E=RU:%
{REMOTE_USER},P,QSA,L]
257: RequestHeader add REMOTE_USER %{RU}e
:
:
In file: /etc/httpd/conf.d/webalizer.conf
6: Alias /usage /var/www/usage
8: <Location /usage>
9: Order deny,allow
10: Deny from all
11: Allow from 127.0.0.1
12: Allow from ::1
:
In file: /etc/httpd/conf.d/welcome.conf
7: <LocationMatch “^/+$”>
8: Options -Indexes
9: ErrorDocument 403 /error/noindex.html
:
In file: /etc/httpd/conf/httpd.conf
230: User apache
231: Group apache
250: ServerAdmin [email protected]
273: UseCanonicalName Off
280: DocumentRoot “/var/www/html”
290:
291: Options FollowSymLinks
292: AllowOverride None
:
305: <Directory “/var/www/html”>
319: Options Indexes FollowSymLinks
326: AllowOverride None
331: Order allow,deny
332: Allow from all
:
340: <Directory “/var/www/html_ssl”>
355: Options All
363: AllowOverride AuthConfig
368: Order allow,deny
369: Allow from all
:
391: UserDir disable
427: DirectoryIndex index.html index.html.var
434: AccessFileName .htaccess
440: <Files ~ “^.ht”>
441: Order allow,deny
442: Deny from all
:
449: TypesConfig /etc/mime.types
460: DefaultType text/plain
469: MIMEMagicFile conf/magic
480: HostnameLookups Off
508: ErrorLog logs/error_log
515: LogLevel warn
521: LogFormat “%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-
Agent}i”” combined
522: LogFormat “%h %l %u %t “%r” %>s %b” common
523: LogFormat “%{Referer}i -> %U” referer
524: LogFormat “%{User-agent}i” agent
550: CustomLog logs/access_log combined
560: ServerSignature On
575: Alias /icons/ “/var/www/icons/”
577: <Directory “/var/www/icons”>
578: Options Indexes MultiViews FollowSymLinks
579: AllowOverride None
580: Order allow,deny
581: Allow from all
:
589: DAVLockDB /var/lib/dav/lockdb
600: ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”
606: <Directory “/var/www/cgi-bin”>
607: AllowOverride None
608: Options None
609: Order allow,deny
610: Allow from all
:
628: IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
635: AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
637: AddIconByType (TXT,/icons/text.gif) text/*
638: AddIconByType (IMG,/icons/image2.gif) image/*
639: AddIconByType (SND,/icons/sound2.gif) audio/*
640: AddIconByType (VID,/icons/movie.gif) video/*
642: AddIcon /icons/binary.gif .bin .exe
643: AddIcon /icons/binhex.gif .hqx
644: AddIcon /icons/tar.gif .tar
645: AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
646: AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
647: AddIcon /icons/a.gif .ps .ai .eps
648: AddIcon /icons/layout.gif .html .shtml .htm .pdf
649: AddIcon /icons/text.gif .txt
650: AddIcon /icons/c.gif .c
651: AddIcon /icons/p.gif .pl .py
652: AddIcon /icons/f.gif .for
653: AddIcon /icons/dvi.gif .dvi
654: AddIcon /icons/uuencoded.gif .uu
655: AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
656: AddIcon /icons/tex.gif .tex
657: AddIcon /icons/bomb.gif core
659: AddIcon /icons/back.gif …
660: AddIcon /icons/hand.right.gif README
661: AddIcon /icons/folder.gif ^^DIRECTORY^^
662: AddIcon /icons/blank.gif ^^BLANKICON^^
668: DefaultIcon /icons/unknown.gif
686: ReadmeName README.html
687: HeaderName HEADER.html
693: IndexIgnore .??* ~ # HEADER README RCS CVS *,v *,t
733: AddLanguage ca .ca
734: AddLanguage cs .cz .cs
735: AddLanguage da .dk
736: AddLanguage de .de
737: AddLanguage el .el
738: AddLanguage en .en
739: AddLanguage eo .eo
740: AddLanguage es .es
741: AddLanguage et .et
742: AddLanguage fr .fr
743: AddLanguage he .he
744: AddLanguage hr .hr
745: AddLanguage it .it
746: AddLanguage ja .ja
747: AddLanguage ko .ko
748: AddLanguage ltz .ltz
749: AddLanguage nl .nl
750: AddLanguage nn .nn
751: AddLanguage no .no
752: AddLanguage pl .po
753: AddLanguage pt .pt
754: AddLanguage pt-BR .pt-br
755: AddLanguage ru .ru
756: AddLanguage sv .sv
757: AddLanguage zh-CN .zh-cn
758: AddLanguage zh-TW .zh-tw
767: LanguagePriority en ca cs da de el eo es et fr he hr it ja ko
ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
774: ForceLanguagePriority Prefer Fallback
783: AddDefaultCharset UTF-8
803: AddType application/x-compress .Z
804: AddType application/x-gzip .gz .tgz
826: AddHandler type-map var
834: AddType text/html .shtml
835: AddOutputFilter INCLUDES .shtml
873: Alias /error/ “/var/www/error/”
877: <Directory “/var/www/error”>
878: AllowOverride None
879: Options IncludesNoExec
880: AddOutputFilter Includes html
881: AddHandler type-map var
882: Order allow,deny
883: Allow from all
884: LanguagePriority en es de fr
885: ForceLanguagePriority Prefer Fallback
:
913: BrowserMatch “Mozilla/2” nokeepalive
914: BrowserMatch “MSIE 4.0b2;” nokeepalive downgrade-1.0 force-
response-1.0
915: BrowserMatch “RealPlayer 4.0” force-response-1.0
916: BrowserMatch “Java/1.0” force-response-1.0
917: BrowserMatch “JDK/1.0” force-response-1.0
926: BrowserMatch “Microsoft Data Access Internet Publishing
Provider” redirect-carefully
927: BrowserMatch “MS FrontPage” redirect-carefully
928: BrowserMatch “^WebDrive” redirect-carefully
929: BrowserMatch “^WebDAVFS/1.[0123]” redirect-carefully
930: BrowserMatch “^gnome-vfs/1.0” redirect-carefully
931: BrowserMatch “^XML Spy” redirect-carefully
932: BrowserMatch “^Dreamweaver-WebDAV-SCM1” redirect-carefully
939: <Location /server-status>
940: SetHandler server-status
941: Order deny,allow
942: Deny from all
943: Allow from .virginia.edu
:
951: <Location /server-info>
952: SetHandler server-info
953: Order deny,allow
954: Deny from all
955: Allow from .virginia.edu
:

Thanks in advance for taking a look at this.

Jack

On Thu, 2008-07-24 at 12:40 -0700, Jack wrote:

to get help with the apache configuration (and the mongrel
Thanks, Craig, for the advice. I’ve already tried the first and have
troubles getting the server to respond. But I don’t know if that has
to do with Pubcookie trying to resolve the URL and not having it
match. But I’ll go through all of these in the order you mentioned.

FYI, I did not specify the num_processors. When I ran mongrel_rails to
generate a config file, I only set the flags I understood and wanted a
specific value for. So that 1024 is the default if you don’t specify
anything.


if you can’t connect directly to mongrel served rails app with a web
browser, there’s no way that proxying that connection with apache is
going to make it magically work.

do you need to have pubcookie authentication if you don’t go to /admin?

as for mongrel configuration, I guess I don’t know because I only use
mongrel_cluster - a single mongrel didn’t make much sense to me.

Craig

On Jul 24, 4:19 pm, Craig W. [email protected] wrote:

your proxy setup (after verifying that everything works without proxy)


if you can’t connect directly to mongrel served rails app with a web
browser, there’s no way that proxying that connection with apache is
going to make it magically work.

do you need to have pubcookie authentication if you don’t go to /admin?

as for mongrel configuration, I guess I don’t know because I only use
mongrel_cluster - a single mongrel didn’t make much sense to me.

Craig

SOLUTION: Turns out the sysadmin’s suggestion to add a symbolic link
under the apache web root to the public folder of the RoR app solves
the problem of getting to the CSS and Javascript files. Turns out
that’s what another area does for SSL applications.

Hey Craig,

Thanks for all the help.

Don’t know why we are using mongrel instead of mongrel cluster.
Presently this is just a development server and that may be why. The
sysadmin has decided to try using Passenger module since that is the
way they are moving for production.

FYI, we do need pubcookie if not using admin because our app will
require university members to authenticate themselves when making a
request so we can pull their information from LDAP and pre-fill some
fields on a web form. - Jack

to get help with the apache configuration (and the mongrel
configuration).

num_processors: 1024 can’t possibly be right

I think ultimately you want to run mongrel_cluster and run 3-5 mongrels
and use proxy_balancer and not the setup that you are running with
ProxyPass but that’s my guess.

Craig

Thanks, Craig, for the advice. I’ve already tried the first and have
troubles getting the server to respond. But I don’t know if that has
to do with Pubcookie trying to resolve the URL and not having it
match. But I’ll go through all of these in the order you mentioned.

FYI, I did not specify the num_processors. When I ran mongrel_rails to
generate a config file, I only set the flags I understood and wanted a
specific value for. So that 1024 is the default if you don’t specify
anything.

Jack

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs