cancel
Showing results for 
Search instead for 
Did you mean: 
resplin
Elite Collaborator
Elite Collaborator

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



configuration
Labs

With some installations, the alfresco default port shall be moved from port 8080. This works fine with the Alfresco Explorer, but may break the Alfresco Share authentication application with the error 'Unable to retrieve License information from Alfresco'.


Alfresco Share


To configure Alfresco Share to use a different host or port number.

For tomcat installations, first ensure catalina.properties is configured as per Install_Tomcat6

In the file tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml



  1. Remove the begin and end comment lines and --> surrounding this section

       <config evaluator='string-compare' condition='Remote'>
          <remote>
             <endpoint>
                <id>alfresco-noauth</id>
                <name>Alfresco - unauthenticated access</name>
                <description>Access to Alfresco Repository WebScripts that do not require authentication</description>
                <connector-id>alfresco</connector-id>
                <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
                <identity>none</identity>
             </endpoint>

             <endpoint>
                <id>alfresco</id>
                <name>Alfresco - user access</name>
                <description>Access to Alfresco Repository WebScripts that require user authentication</description>
                <connector-id>alfresco</connector-id>
                <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
                <identity>user</identity>
             </endpoint>

             <endpoint>
                <id>alfresco-feed</id>
                <name>Alfresco Feed</name>
                <description>Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet</description>
                <connector-id>http</connector-id>
                <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url>
                <basic-auth>true</basic-auth>
                <identity>user</identity>
             </endpoint>
          </remote>
       </config>


  2. Change all ports from 8080 to the desired port.

Links


Alfresco Forum Entry

14 Comments
hamzaF
Champ in-the-making
Champ in-the-making

Hello,

I tried changing the ports but still my URL go through 8080, can you please help

abhinavmishra14
World-Class Innovator
World-Class Innovator

@hamzaF Which version you using? 

Changing port is not just require in share config but tomcat server.xml as well.

You can find detailed steps here:

https://javaworld-abhinav.blogspot.com/2020/07/change-alfresco-share-proxy-and-db.html

Also you can review this thread: 

https://hub.alfresco.com/t5/alfresco-content-services-forum/how-to-change-the-port-repository-is-lis...

hamzaF
Champ in-the-making
Champ in-the-making

We are using Alfresco Share v11.77

hamzaF
Champ in-the-making
Champ in-the-making

image

So as per your article https://javaworld-abhinav.blogspot.com/2020/07/change-alfresco-share-proxy-and-db.html

I changed all the ports and when i  try to access my site on http://mysite.local:80/share/page/user/admin/dashboard it gives me the above error

abhinavmishra14
World-Class Innovator
World-Class Innovator

@hamzaF  Can you share the copy of tomcat server.xml, nginx.conf, alfresco-global.properties and solrcore.properties (in case you are also changing the repo port). 

Note that if you are running the alfresco and share in same tomcat instance, then changing the server.xml, will change the port for both apps. 

hamzaF
Champ in-the-making
Champ in-the-making

server.xml file

<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>

<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">

<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->


<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the BIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">

<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->

<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->

<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" /> -->
<Valve className="org.apache.catalina.valves.RemoteIpValve" />
</Host>
</Engine>
</Service>
</Server>

hamzaF
Champ in-the-making
Champ in-the-making

Nginx.conf

user nginx;
worker_processes auto;

error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
}

hamzaF
Champ in-the-making
Champ in-the-making

Alfresco-global.properties

deployment.method=ANSIBLE

db.url=jdbcSmiley Tongueostgresql://${db.host}:5432/alfresco
db.host=10.100.226.207

db.driver=org.postgresql.Driver
db.username=alfresco
db.password=alfresco

alfresco.host=10.100.226.207
alfresco.port=80
alfresco.protocol=http
share.host=10.100.226.207
share.port=80
share.protocol=http
index.subsystem.name=solr6
solr.secureComms=none
solr.port=8983
solr.host=10.100.226.207

dir.root=/var/opt/alfresco/content-services/content
encryption.keystore.location=/var/opt/alfresco/content-services/keystore/keystore
encryption.keystore.keyMetaData.location=/var/opt/alfresco/content-services/keystore/keystore-passwords.properties
encryption.keyAlgorithm=DESede
encryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
encryption.keystore.type=JCEKS
encryption.keystore.backup.type=JCEKS

dir.license.external=/etc/opt/alfresco/content-services/licenses

alfresco.cluster.enabled=false

solr.secureComms=none
solr.port=8983
solr.host=10.100.226.207

dir.root=/var/opt/alfresco/content-services/content
encryption.keystore.location=/var/opt/alfresco/content-services/keystore/keystore
encryption.keystore.keyMetaData.location=/var/opt/alfresco/content-services/keystore/keystore-passwords.properties
encryption.keyAlgorithm=DESede
encryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
encryption.keystore.type=JCEKS
encryption.keystore.backup.type=JCEKS

dir.license.external=/etc/opt/alfresco/content-services/licenses

alfresco.cluster.enabled=false
transform.service.enabled=true
local.transform.service.enabled=true
transform.service.url=http://10.100.226.207:8095
localTransform.core-aio.url=http://10.100.226.207:8090/
alfresco-pdf-renderer.url=${localTransform.core-aio.url}
jodconverter.url=${localTransform.core-aio.url}
img.url=${localTransform.core-aio.url}
tika.url=${localTransform.core-aio.url}
transform.misc.url=${localTransform.core-aio.url}
sfs.url=http://10.100.226.207:8099/

messaging.broker.url=failoverSmiley Sadtcp://10.100.226.207:61616)?timeout=3000

dsync.service.uris=http://10.100.226.207:80/alfresco

aos.baseUrlOverwrite=http://10.100.226.207:80/alfresco/aos

hamzaF
Champ in-the-making
Champ in-the-making

Solr.Properties

#
# solrcore.properties - used in solrconfig.xml
#

enable.alfresco.tracking=true

#
#These are replaced by the admin handler
#
data.dir.root=/var/opt/alfresco/search-services
#data.dir.store=workspace/SpacesStore
#alfresco.stores=workspace://SpacesStore

#
# Properties loaded during alfresco tracking
#

alfresco.host=10.100.226.207
alfresco.port=80
alfresco.port.ssl=443
alfresco.baseUrl=/alfresco

#alfresco.index.transformContent=false
#alfresco.ignore.datatype.1=d:content
alfresco.lag=1000
alfresco.hole.retention=3600000
# alfresco.hole.check.after is not used yet
# It will reduce the hole checking load
alfresco.hole.check.after=300000
alfresco.batch.count=5000
alfresco.recordUnindexedNodes=false

abhinavmishra14
World-Class Innovator
World-Class Innovator

You seems to miss instructions from here: https://javaworld-abhinav.blogspot.com/2020/07/change-alfresco-share-proxy-and-db.html

I see, server.xml still has 8080 whereas you are trying 80 as port. 

alfresco-global.properties is mixed up with same properties multiple time. please clean it up.

you have also missed share-config change as well to map to port 80.

The nginx.conf at /etc/nginx/nginx.conf is the one i was referring to.

Here are high level steps:

1- Update the required ports in $ALFRESCO_INSTALL_DIR/tomcat/conf/server.xml

- Update default connector port 8080 to 80 required ports.

<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />


for reference: https://docs.alfresco.com/content-services/5.2/install/#installing-the-tomcat-application-server

2- Update the required 'alfresco' and 'share' ports in $ALFRESCO_INSTALL_DIR/tomcat/shared/classes/alfresco-global.properties

- Update following properties:

share.port=80
alfresco.port=80


for reference: https://docs.alfresco.com/content-services/5.2/config/repository/#configuring-server-administration-...

3- Update the required 'alfresco' ports in $ALFRESCO_INSTALL_DIR/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml for remote configuration (<config evaluator="string-compare" condition="Remote">).

Update 'alfresco-noauth' endpoint url:
http://localhost:80/alfresco/s

Update 'alfresco' endpoint url:
http://localhost:80/alfresco/s

Update 'alfresco-feed' endpoint url:
http://localhost:80/alfresco/s

Update 'alfresco-api' endpoint url:
http://localhost:80/alfresco/api


for reference: https://docs.alfresco.com/content-services/5.2/develop/share-ext-points/share-config/#setting-defaul...

4- Update the required 'alfresco' port in 'solrcore.properties' file.

Find the 'alfresco.port' property in solrcore.properties file and update:

alfresco.port=80

- For SOLR4, we used below paths:

$ALFRESCO_INSTALL_DIR/solr4/workspace-SpacesStore/conf/solrcore.properties
$ALFRESCO_INSTALL_DIR/solr4/archive-SpacesStore/conf/solrcore.properties


- For SOLR6 (alfresco-search-service), we used below paths:

$SOLR_HOME/solrhome/alfresco/conf/solrcore.properties
$SOLR_HOME/solrhome/archive/conf/solrcore.properties


for reference: https://docs.alfresco.com/search-services/1.3/config/#search-services-externalized-configuration

5- Update the /etc/nginx/nginx.conf to listen to port 80 and allow pass to port 80 for alfresco and share apps.

worker_processes 1;

events {
worker_connections 1024;
}

http {
server {
listen *:80;

client_max_body_size 0;

set $allowOriginSite *;
proxy_pass_request_headers on;
proxy_pass_header Set-Cookie;

# External settings, do not remove
#ENV_ACCESS_LOG

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;

# Protect access to SOLR APIs
location ~ ^(/.*/service/api/solr/.*)$ {return 403;}
location ~ ^(/.*/s/api/solr/.*)$ {return 403;}
location ~ ^(/.*/wcservice/api/solr/.*)$ {return 403;}
location ~ ^(/.*/wcs/api/solr/.*)$ {return 403;}

location ~ ^(/.*/proxy/alfresco/api/solr/.*)$ {return 403 ;}
location ~ ^(/.*/-default-/proxy/alfresco/api/.*)$ {return 403;}

location / {
proxy_pass http://alfresco:80;
}


location /alfresco/ {
proxy_pass http://alfresco:80;

# If using external proxy / load balancer (for initial redirect if no trailing slash)
absolute_redirect off;
}

location /share/ {
proxy_pass http://share:80;

# If using external proxy / load balancer (for initial redirect if no trailing slash)
absolute_redirect off;
}

}
}

for reference: https://github.com/Alfresco/acs-ingress/blob/master/nginx.conf