Alfresco is working fine internally. My next move is to do some work to get Alfresco working externally. I dont think that exposing Tomcat to the external world is appropriate so planning to configure Apache to sit in front of Alfresco. This would mean that Apache would act a bit like a proxy server dealing with requests for Alfresco then passing the requests through Tomcat and then back out to the user.
Just going to start doing some reading up on this. But thought i'd put a post on here to see if any of you lot have any pointers, lessons learnt or anything else to speed up the process?
Many Thanks, Ben
—
zaizi
- Posts
- 800
- Achievements
- 6
- Member for
- 5 years 5 months
- From
- London, UK
Alfresco Partner
Stats
Hint: Search the forum!
Alfresco Partner of the Year 2012.
www.zaizi.com
** If this post was helpful, please click Yes on the Post Rating --> **
bensewell
- Posts
- 65
- Achievements
- 3
- Member for
- 2 years 3 months
Stats
Will do but didnt know if there is any quick pointers. Watch this space.
konsultex
- Posts
- 60
- Achievements
- 3
- Member for
- 6 years 4 months
Stats
Hi Ben,
I use Alfresco in Jboss on a server behind Apache httpd so it's almost the same.
I have this in httpd.conf (Linux)
ProxyVia on ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /alfresco http://localhost:9090/alfresco ProxyPassReverse /alfresco http://localhost:9090/alfresco ProxyPass /share http://localhost:9090/share ProxyPassReverse /share http://localhost:9090/shareNote that I have port 9090 in use. You probably need to put 8080 in there.
So with this setup my external access is http://myserver/alfresco
Miguel Koren O'Brien de Lacy
bensewell
- Posts
- 65
- Achievements
- 3
- Member for
- 2 years 3 months
Stats
Magic! Thanks :)
bensewell
- Posts
- 65
- Achievements
- 3
- Member for
- 2 years 3 months
Stats
Hello Peeps,
Right been doing some tinkering and gome some things working but not the way I wanted.
I tried setting it up using konsultex's straightforward rules but it didnt work out right for me. I got the usual 503 page unavailable error. So i then tried to add a virtual host with a rewrite rule on to divert from Apache to Tomcat. This worked fine but in the real world i wouldnt be happy with the end users seeing the port number just the http://webaddress.co.uk.
So now want to find out where i've gone wrong a bit with the proxypass/reverse rules or put something in front of the initial apache to tomcat to filter out the port numbers.
If i understand it right this is how its currently working:
apache running on port 80
Tomcat running on port 8080
User's Browser ->Apache:80 RW -> Tomcat:8080 -> Alfresco <->Tomcat:8080 ->Apache:80->User's Browser
I think i need it along the lines of
User's Browser ->Apache:80 RW -> Tomcat:8080 -> Alfresco <->Tomcat:8080 <-> Apache Cache -> User's Browser
I set it up using the following in httpd.conf.
Worked no proxying:
ServerName alfresco.localhost.com
RewriteEngine On
RewriteLogLevel 3
RewriteLog "/var/log/httpd/rewrite.log"
RewriteRule ^/(.*) http://XXX.XX.XXX.XXX:8080/share$1
Didnt work with proxying:
ProxyVia on
ProxyRequests Off
Order deny,allow
Allow from all
#Apache to Tomcat Alfresco Rule
ProxyPass /alfresco http://XXX.XX.XXX.XXX:8080/alfresco
ProxyPassReverse /alfresco http://XXX.XX.XXX.XXX:8080/alfresco
#Apache to Tomcat Share Rule
ProxyPass /share http://XXX.XX.XXX.XXX:8080/share
ProxyPassReverse /share http://XXX.XX.XXX.XXX:8080/share
bensewell
- Posts
- 65
- Achievements
- 3
- Member for
- 2 years 3 months
Stats
I tried something else as mentioned in this post:
http://forums.alfresco.com/en/viewtopic.php?f=9&t=22176
And this did work i.e. diverting users to the correct page, but the end user can still see the port number and so and so so not really ideal when the site is moved externally.
Does anyone know how to cache the web port etc and present the end user with just the page they requested minus the port number. I dont want people to see the port number or it could present a security threat? Maybe i'm being a bit too cautious?
bensewell
- Posts
- 65
- Achievements
- 3
- Member for
- 2 years 3 months
Stats
Configured and kind of working now.
In the end used a AJP rule and added mod_jk into the modules. Then setup two worker lines in the httpd.conf and added in one proxy pass rule. My edits are below:
So now the site is accessible by typing http://servername/share and http://servername/alfresco and it works fine and strips out the port number. That was bothering me for some reason. Last thing i want to do now is tell Apache that if a user tries to hit the server on default port 80 to divert it to /share now the ajp bits and bobs are in place.
I did try to integrage my mod-rewrite work I did yesterday but must have done it wrong because it always goes to the default page. If all fails i'll just put a simple re-direct php script in to divert the traffic back to share.