Purpose
This topic describes how to change the default portal URL to give users a more user friendly URL, e.g. to change from 'http://hostname.domain.com:50000/irj/portal' to 'http://hostname.company.com'.
Overview
To change the URL which users employ to access the portal, there are in general 3 approaches, which are discussed in turn below.
- Change the instance configuration - for single-instance installations
- Use a load balancer - for clustered installations
- Use a reverse-proxy
1. Change the instance configuration
1.1 Remove the Port from the URL:
For Enterprise Portal 7.0X: Update the AS Java Configuration
- Open the Web AS Java Visual Administrator
- Goto -> Cluster -> Dispatcher -> Services -> HTTP Provider
- Choose Ports
- Change the port number to 80 for HTTP and 443 for HTTPS (SSL) - as these are the default ports for these protocols, they don't need to be explicitly entered in the URL used to call the portal
- Choose Update and save.
For Enterprise Portal 7.3X: Update the ICM Configuration
- As 7.3 uses the ICM instead of the Java Dispatcher for accepting incoming HTTP requests, the port configuration now takes place in the instance profile via parameter icm/server_port_0
- For example, to set the HTTP port to the HTTP default port 80 and the HTTPS port to the SSL default port 443 (so that the ports do not need to be explicitly stated in the URL), you would adjust the instance profile as follows:
# Definition of the ports
icm/server_port_0 = PROT=HTTP, PORT=80
icm/server_port_1 = PROT=HTTPS, PORT=443
Note: On UNIX systems, you need root access to bind to ports less than 1024 - but you don't want to start your Application Server with the root user. You can achieve this by using the external program icmbnd, and updating the instance profile as follows:
# Use default ports
# icmbnd needs root permissions
# "chown root icmbnd" and "chmod 4755 icmbnd"
icm/server_port_0 = PROT=HTTP, PORT=80, EXTBIND=1
icm/server_port_1 = PROT=HTTPS, PORT=443, EXTBIND=1
exe/icmbnd = <path of executable>
1.2 Remove the irj/portal:
For Enterprise Portal 7.0X:
- Goto Cluster-> Server-> Services-> HTTP provider
- Enter /irj/portal in the start page text field
- Choose the save properties button
- Restart the instance.
For Enterprise Portal 7.3X:
- In 7.3x, this is done via the NetWeaver Administrator: 'http://<host>:<port>/nwa'
- Follow menu path: Configuration > Connectivity > HTTP Provider Configuration
- Enter /irj/portal in the default start page property
- Click save
Alternate approach for Enterprise Portal 7.3X:
- You could also achieve this at the ICM level using a redirect rule like the following:
icm/HTTP/redirect_0 = PREFIX=/,TO=/irj/portal,HOST=hostname.company.com
Note: Both of these approaches will result in a redirect response being issued to the browser, redirecting from 'http://hostname.company.com' to 'http://hostname.company.com/irj/portal', so users will still see /irj/portal in the adress bar - it just won't appear in the link provided to the users. If you want to avoid that it appears in the address bar, consider using a reverse proxy instead.
2. Use a Load Balancer
The above configurations take effect at the instance level. If you use a cluster, you need to use a load balancer in front of the portal, and you should perform any configuration on this component instead. You can use many types of software or hardware load balancer with the portal, the most common is probably the SAP Web Dispatcher, so the below example is for the Web Dispatcher. Configuration of the Web Dispatcher is similar to configuration of the ICM for the instance (since they are based on the same technology). So, to have the web dispatcher listen for HTTP requests on port 80, and redirect requests with no path to /irj/portal, you would use the following configuration:
icm/server_port_0 = PROT=HTTP,PORT=80,HOST=hostname.company.com
icm/HTTP/redirect_0 = PREFIX=/,TO=/irj/portal,HOST=hostname.company.com
Note: The comments above about using icmbnd for ports less than 1024 on UNIX systems still apply. It's also worth noting that you could use a Web Dispatcher even for a singe-instance system for exactly this use case: if you want to accept requests on port 80 on UNIX systems.
3. Use a Reverse Proxy
You can use a fully featured reverse proxy in addition to a load balancer, or the reverse proxy can also perform load balancing functions. There are several software solutions that can act as a reverse proxy. The most often used software is probably Apache. The general solution looks like this:
Browser <-> Reverse Proxy <-> Portal
The user connects to the URL 'http://reverseproxy.company.com', whereas the Reverse Proxy connects to the portal with 'http://hostname.company.com:50000/irj/portal'. This access is transparent for the user. If your reverse proxy is configured to perform URL rewriting, then the /irj/portal path can also remain invisible to the end user.
Related Content
Related Documents
SAP Help (Web Dispatcher):
SAP Help (Sample Profiles for the ICM on 7.30):
SDN Article on Apache Reverse Proxy
6 Comments
Unknown User (1071bo5dx)
good~
Unknown User (l3nsiga)
1.1 - Good.
WRT 1.2: It doesn't work. ("The page cannot be displayed"). And if start page will be http://hostname.company.com , what about main page of Web AS ?
Unknown User (fhelxiu)
Good article !
Beginning with release 7.2 the SAP Web Dispatcher is now able to rewrite URL (as Apache) and not only to redirect URLs.
It means that it is now possible to use the technique number 3 with a SAP web dispatcher. No more need to cascade an Apache reverse proxy (for URL rewriting) and a SAP Web Dispatcher (for load balancing).
Shankar Agarwal
Very useful article.
This is a common and yet critical requirement by most of the customers.
Former Member
I am using option three with SAP Web Dispatcher as a reverse proxy. The problem with this is that a cookie set by the portal is set with the path /irj and will therefore not be attached to subsequent requests (since the requests from the browser do not contain "/irj"). The cookie's name is com.sap.engine.security.authentication.original_application_url.
Is it possible to a) configure the portal to set the path "/" for the cookie or b) use SAP Web Dispatcher to rewrite the path of the cookie in the http response where it gets set (similar to what can be done in the Apache proxy: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreversecookiepath)?
Muhammad Irfan
after the above changes , my system starts normally but link is not accessible through usl both old and new , can you help