cancel
Showing results for 
Search instead for 
Did you mean: 

Access Alfresco by Domain Name

mrudmann
Champ in-the-making
Champ in-the-making
Hi,
I have been scouring these forums for a good answer to this.  Seems others have that same question, but I have yet to find a decent solution.

I would like to access my Alfresco from a web browser by typing http://www.myalfrescosite.com, instead of typing http://www.myalfrescosite.com:8080/alfresco.

Can someone provide insight as to how this can be accomplished?

Thanks!
-Matt
12 REPLIES 12

alexander
Champ in-the-making
Champ in-the-making
I think, it is best to proxy Alfresco through Apache for this.

1) In most cases  Apache already has mod proxy installed.
in this case add something like this to httpd.conf file (or domain files if you are using more advanced config):

ProxyPass /alfresco http://127.0.0.1:8080/alfresco
ProxyPassReverse /alfresco http://127.0.0.1:8080/alfresco

2) Then you may want make root app to redirect to your /alfresco subfolder if user just enters IP address. Edit tomcat\webapps\ROOT\index.jsp to have this lines only:
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
<meta http-equiv="refresh" content="0;url=/alfresco">
</head>
</html>
Then you need to disable pre-compiled page in web.xml in ROOT\WEB-INF.
Comment out these lines:
    <servlet>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <servlet-class>org.apache.jsp.index_jsp</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>
Hope this helps - it worked for me.

Alternative for 1), if you run on windows or as root is to change tomcat to run on port 80 in server.xml (just search for 8080  and change it.)

mrudmann
Champ in-the-making
Champ in-the-making
Thanks for the feedback!

I have been trying that proxy approach through httpd.  I am running apache 2.0.54 and Alfresco 1.4 with tomcat.

I placed those proxy lines, similar to the ones you mention, in my httpd.conf as shown below.  However, when I web to the ServerName http://www.mydomain.com/alfresco, I get an error message stating:

Forbidden, "You don't have permission to access /alfresco on this erver."

Any ideas why this is happening?

Thanks!
-Matt

— snip of httpd.conf —

<virtualhost 10.0.0.2:80>
        ServerName http://www.mydomain.com
        DocumentRoot /opt/alfresco/tomcat/webapps/ROOT
        ProxyRequests off
        ProxyPass /alfresco http://10.0.0.2:8080/alfresco
        ProxyPassReverse /alfresco http://10.0.0.2:8080/alfresco
        ProxyPreserveHost On
</virtualhost>

alexander
Champ in-the-making
Champ in-the-making
Unfortunately, I am not Apache specialist, so not sure which statement is responsible for error. I did it globally, and just these 2 lines worked for me.

BTW, part 2) of what I wrote above was used on windows when changing Tomcat port to 80. In case of proxy simple HTML file, placed in document root, should be enough.

mrudmann
Champ in-the-making
Champ in-the-making
Was there a specific location in httpd.conf where you placed the proxy lines?

mrudmann
Champ in-the-making
Champ in-the-making
Good news!  I got the first part, proxy, to work.  I needed to specify the machine IP namein the proxypass and proxypassreverse lines.

Now, as for step 2, there is a lot os "stuff" in the index.jsp file you mention.  I see things like font information, header information, etc.

Are you saying that in your proposed step 2, the ONLY lines in this index.jsp can be the ones you mention?  What about all of that other info in this file?  Is it needed?

Thanks!
-Matt

alexander
Champ in-the-making
Champ in-the-making
Hi

As I mentioned before, in case of proxy you will not require changing index.jsp, as your root application is not proxied (only /alfresco).

It means, if user accesses your server by domain name, it can be served simple index.html file with only lines I mentioned (meta refresh). It should probably be placed in DocumentRoot location (does not need to be anywhere in tomcat - make sure Apache has a right to access it)

mrudmann
Champ in-the-making
Champ in-the-making
I see the first batch of lines above that you mention to include:

<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
<meta http-equiv="refresh" content="0;url=/alfresco">
</head>
</html>

These aren't the lines that belong in the index.html file you mention…are they?  Can you reiterate the lines that belong in this index.html file I will create?

Thanks!
-Matt

alexander
Champ in-the-making
Champ in-the-making
Hi

File can contain just single line:
<meta http-equiv="refresh" content="0;url=/alfresco">

It will instruct browser immediately request "/alfresco" from the server.

Other lines just for HTML standard compliance (meta should be in head element)

mabayona
Champ on-the-rise
Champ on-the-rise
I´m using mod_jk together with Apache. This the right way of doing it. You can find it in:

http://tomcat.apache.org/download-connectors.cgi

(Use mod_jk and NOT mod_jk2).