1

I have jira installed on my server.
It was running at http://[my ip address]:8100. I changed it to http://jira.[my domain].com.

Now after I access it at http://jira.[my domain].com, a browser path changes to http://jira.[my domain].com:8100/secure/Dashboard.jspa.

  1. Why does the port show up?
  2. Is there any way to remove 8100 port from this redirect. I'd like it to be http://jira.[my domain].com/secure/Dashboard.jspa
  3. Also my jira now responds both to jira.[my domain].com and [my ip address]:8100. The latter one is corrupted. Is it possible to stop user accessing it?
pjmorse
  • 1,550
  • 1
  • 17
  • 34
Ivan Zamylin
  • 85
  • 1
  • 10

2 Answers2

2

As you're not mentioning having JIRA configured with SSL which can include needing to place a proxyName entry in the jira/conf/server.xml which could redirect I'll assume that you haven't gone into the Administration screen and updated your Base URL setting. You don't mention what you have listening on port 80 for the jira hostname but I assume it's Apache.

Below is the Apache config I use for my JIRA instance:

<VirtualHost *:80>
    ServerName jira.example.net

        ErrorLog ${APACHE_LOG_DIR}/jira-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/jira-access.log combined

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

    # ProxyRequests Off
    # ProxyPreserveHost on
    # ProxyPass / http://jira.internal.host:8080/ connectiontimeout=5 timeout=300
    # ProxyPassReverse / http://jira.internal.host:8080/
</VirtualHost>
<VirtualHost *:443>
    ServerName jira.undergrid.net

        ErrorLog ${APACHE_LOG_DIR}/jira-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/jira-access.log combined

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    SSLEngine on
    SSLProxyEngine on
    SSLCertificateFile    /etc/ssl/certs/jira.example.net.crt
    SSLCertificateKeyFile /etc/ssl/private/jira.example.net.key
    SSLCACertificatePath  /etc/ssl/certs/

    ProxyRequests Off
    ProxyPreserveHost on
    ProxyPass / http://jira.internal.host:8080/ connectiontimeout=5 timeout=300
    ProxyPassReverse / http://jira.internal.host:8080/
</VirtualHost>

In my case the Apache and JIRA servers are running on 2 different machines but the config can work regardless of that. With that in place I then updated the jira/conf/server.xml to include the following:

    <Connector port="8080"

               maxThreads="150"
               minSpareThreads="25"
               maxSpareThreads="75"
               connectionTimeout="20000"

               scheme="https"
               proxyName="jira.example.net"
               proxyPort="443"

               enableLookups="false"
               maxHttpHeaderSize="8192"
               protocol="HTTP/1.1"
               useBodyEncodingForURI="true"
               redirectPort="8443"
               acceptCount="100"
               disableUploadTimeout="true"/>

        <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
          maxHttpHeaderSize="8192" SSLEnabled="true"
          maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
          enableLookups="false" disableUploadTimeout="true"
          acceptCount="100" scheme="https" secure="true"
          keystoreFile="${user.home}/.keystore" keyAlias="jira.example.net"
          clientAuth="false" sslProtocol="TLS" useBodyEncodingForURI="true"/>

          <Connector port="8009" redirectPort="8443" enableLookups="false" protocol="AJP/1.3" URIEncoding="UTF-8"/>

The final step was to update the Base URL by logging into JIRA as a JIRA Administrator and going to Administration -> System -> General Configuration and editing the Base URL to ready https://jira.example.net

Jeremy Bouse
  • 11,341
  • 2
  • 28
  • 40
0

Previous answer is almost correct. If you are not able to start 7.3+ Jira server after this, please look into this link. There is bug in 7.3+ versions of Jira.

Use this connector:

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
              maxHttpHeaderSize="8192" SSLEnabled="true"
              maxThreads="150" minSpareThreads="25"
              enableLookups="false" disableUploadTimeout="true"
              acceptCount="100" scheme="https" secure="true"
              clientAuth="false" sslProtocol="TLS" useBodyEncodingForURI="true"
              keyAlias="jira" keystoreFile="<JIRA_HOME>/jira.jks" keystorePass="changeit" keystoreType="JKS"/>
Dzintars
  • 201
  • 1
  • 2
  • 7