# AWS EC2 Ubuntu Tomcat PostgreSQL

**URL:** <https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874>\
**Category:** Help / Discuss\
**Tags:** configuration, installation\
**Created:** [April 9, 2018, 7:58pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874 "2018-04-09T19:58:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 9, 2018, 7:58pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/1 "2018-04-09T19:58:46Z")

</div>

Goal: to download and get XWiki set up with Apache Tomcat and PostgreSQL in an EC2 instance running Ubuntu

Versions after updates:

Ubuntu 16.04.4  
openjdk version 1.8.0\_162

Steps taken during installation:

1. Set up an EC2 instance that’s using Ubuntu
2. Configured PuTTy to open it  
3.to update the Ubuntu instance, I ran the command:

> sudo apt-get update

1. to download Java, I ran the command:

> sudo apt-get install openjdk-8-jdk

1. Ran the command(s):

> wget -q “[https://maven.xwiki.org/public.gpg](https://maven.xwiki.org/public.gpg)” -O- | sudo apt-key add -

> sudo wget “[https://maven.xwiki.org/stable/xwiki-stable.list](https://maven.xwiki.org/stable/xwiki-stable.list)” -P /etc/apt/sources.list.d/

as per tutorial found here: [http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT](http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT)  
6. Ran

> sudo apt-get update

1. Ran

> sudo apt-get install xwiki-tomcat8-pgsql

1. “Setting up xwiki-psql-common (10.2) …” is written to the screen and then a pink/purple package configuration GUI shows up and here’s where I get stuck despite the different combinations of input I’ve provided.

First prompt:

> Select a remote hostname to use or select new host to enter a new host.
> 
> new host  
> localhost

Which is best to select and why?

Say I select localhost

> Please provide a password for xwiki to register with the database  
> │ server. If left blank, a random password will be generated.  
> │  
> │ If you are using “ident” authentication, the supplied password will not  
> │ be used and can be left blank. Otherwise, PostgreSQL access may need to  
> │ be reconfigured to allow password-authenticated access.  
> │  
> │ PostgreSQL application password for xwiki:

Should I use “ident” authentication? Or type in an application password for xwiki?

I opt to type in an application password and then this prints to screen:

> Creating config file /etc/xwiki/hibernate.cfg.xml with new version  
> creating postgres user xwiki: success.  
> verifying creation of user: success.  
> creating database xwiki: success.  
> verifying database xwiki exists: success.  
> dbconfig-common: flushing administrative password  
> allow xwiki user to create new schemas in database xwiki  
> Setting up xwiki-tomcat8-common (10.2) …  
> Setting up xwiki-tomcat8-pgsql (10.2) …  
> Setting up authbind (2.1.1+nmu1) …  
> Processing triggers for libc-bin (2.23-0ubuntu10) …  
> Processing triggers for systemd (229-4ubuntu21.1) …  
> Processing triggers for ureadahead (0.100.0-19) …  
> W: Operation was interrupted before it could finish

What could’ve interrupted this process?

Since I saw the last line, I ran command:

> sudo apt-get install xwiki-tomcat8-pgsql

and this was printed to the screen:

> Reading package lists… Done  
> Building dependency tree  
> Reading state information… Done  
> xwiki-tomcat8-pgsql is already the newest version (10.2).  
> 0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.

does this mean postgresql and tomcat has been set up still?

So since I assumed everything was set up, I ended up following the instructions for the memory allocation for tomcat8 and replaced the current JAVA\_OPTS line of code with the recommended line of code:

> JAVA\_OPTS=“-Djava.awt.headless=true -Xmx1024m”

When I tried to point my browser to:

> [http://localhost:8080/xwiki](http://localhost:8080/xwiki)

and/or

[http://myEC2Address.compute.amazonaws.com:8080/xwiki](http://myEC2Address.compute.amazonaws.com:8080/xwiki)

I got:

> HTTP ERROR 500

- Where did I go wrong here?
- Is there any resources to walk a new user through this dbconfig-common configuration stage for postgres and tomcat?
- If not, would any of you mind walking through this process for a new user?

We’re really excited to use XWiki over here and we’re looking forward to getting past this hurdle here. If there’s any additional information you require, feel free to ask!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [April 10, 2018, 8:05am UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/2 "2018-04-10T08:05:39Z")

</div>

ERROR 500 just mean “something bad happen”. You should take a look at Tomcat log in {{/var/log/tomcat8/catalina.out}}. Concentrate on the very first error you can find after starting it (most of the following errors are going to be consequences of the first one).

> [@larocheaj](#):
>
> Which is best to select and why?

I did not know the host was asked for Postgres. In any case both Postgres and XWiki are supposed to run on the same server with this setup so I guess the best here is localhost.

> [@larocheaj](#):
>
> Should I use “ident” authentication? Or type in an application password for xwiki?

XWiki is configured to access the database with a user and a password in this package so indeed you need to make sure XWiki can do that.

> [@larocheaj](#):
>
> What could’ve interrupted this process?

No idea, the log does not give any kind of error so this is weird. The message feel like something killed dpkg process (you probably get the same kind of message if you do ctrl+c).

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 10, 2018, 1:27pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/3 "2018-04-10T13:27:42Z")

</div>

Thank you for responding so promptly and answering all of my questions! I’ll go ahead and check the Tomcat logs right now to see what happened.

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 10, 2018, 2:03pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/4 "2018-04-10T14:03:38Z")

</div>

I ran the command:

> cd /var/log/tomcat8

To get the top 5 lines from the the log file, I ran the command:

> head -n 5 catalina.out

Got these messages:

> Apr 09, 2018 7:10:23 PM org.apache.catalina.startup.ClassLoaderFactory validateFile  
> WARNING: Problem with directory [/usr/share/tomcat8/common/classes], exists: [false], isDirectory: [false], canRead: [false]  
> Apr 09, 2018 7:10:23 PM org.apache.catalina.startup.ClassLoaderFactory validateFile  
> WARNING: Problem with directory [/usr/share/tomcat8/common], exists: [false], isDirectory: [false], canRead: [false]  
> Apr 09, 2018 7:10:23 PM org.apache.catalina.startup.ClassLoaderFactory validateFile

To get the last 5 lines of the log file, I then ran the command:

> tail -f catalina.out

this error message was the only error printed to screen:

> Apr 10, 2018 1:52:30 PM org.apache.tomcat.util.net.NioEndpoint checkParachute  
> SEVERE: SEVERE:Memory usage is low, parachute is non existent, your system may start failing.  
> Apr 10, 2018 1:52:40 PM org.apache.tomcat.util.net.NioEndpoint checkParachute  
> SEVERE: SEVERE:Memory usage is low, parachute is non existent, your system may start failing.  
> Apr 10, 2018 1:52:50 PM org.apache.tomcat.util.net.NioEndpoint checkParachute

Unfortunately my experience with Apache Tomcat is rather limited, however, when I ran the command:

> cd /usr/share/tomcat8

then used “ls” to peek at what was in this directory-- I didn’t see /common or /classes here. Could these two things be requirements for apache tomcat to run that weren’t installed for some reason due to an error during installation?

In the meantime, I’ll wipe my EC2 instance and spin a fresh one up and redownload/install everything and see what happens.

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [April 10, 2018, 2:07pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/5 "2018-04-10T14:07:37Z")

</div>

> [@larocheaj](#):
>
> SEVERE: SEVERE:Memory usage is low, parachute is non existent, your system may start failing.

This seems to suggest that your memory setup was not taken into account.

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 10, 2018, 2:18pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/6 "2018-04-10T14:18:41Z")

</div>

That makes sense, however, I double checked to make sure my changes for the memory allocation were made to the file found at:

> /etc/default/tomcat8

Here’s my tomcat8 file from the location in the instructions:

> # The home directory of the Java development kit (JDK). You need at least
> 
> # JDK version 7. If JAVA\_HOME is not set, some common directories for
> 
> # OpenJDK and the Oracle JDK are tried.
> 
> #JAVA\_HOME=/usr/lib/jvm/java-7-openjdk
> 
> # You may pass JVM startup parameters to Java here. If unset, the default
> 
> # options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
> 
> # 
> 
> # Use “-XX:+UseConcMarkSweepGC” to enable the CMS garbage collector (improved
> 
> # response time). If you use that option and you run Tomcat on a machine with
> 
> # exactly one CPU chip that contains one or two cores, you should also add
> 
> # the “-XX:+CMSIncrementalMode” option.
> 
> JAVA\_OPTS=“-Djava.awt.headless=true -Xmx1024m”
> 
> # To enable remote debugging uncomment the following line.
> 
> # You will then be able to use a java debugger on port 8000.
> 
> #JAVA\_OPTS=“${JAVA\_OPTS} -Xdebug -Xrunjdwp:transport=dt\_socket,address=8000,server=y,suspend=n”
> 
> # Java compiler to use for translating JavaServer Pages (JSPs). You can use all
> 
> # compilers that are accepted by Ant’s build.compiler property.
> 
> #JSP\_COMPILER=javac
> 
> # Use the Java security manager? (yes/no, default: no)
> 
> #TOMCAT8\_SECURITY=no
> 
> # Number of days to keep logfiles in /var/log/tomcat8. Default is 14 days.
> 
> #LOGFILE\_DAYS=14
> 
> # Whether to compress logfiles older than today’s
> 
> #LOGFILE\_COMPRESS=1
> 
> # Location of the JVM temporary directory
> 
> # WARNING: This directory will be destroyed and recreated at every startup !
> 
> #JVM\_TMP=/tmp/tomcat8-temp
> 
> # If you run Tomcat on port numbers that are all higher than 1023, then you
> 
> # do not need authbind. It is used for binding Tomcat to lower port numbers.
> 
> # (yes/no, default: no)
> 
> #AUTHBIND=no

Also, when I tried to hit the end point while I was running the error logs feed I got this:

> Apr 10, 2018 2:11:20 PM org.apache.coyote.http11.AbstractHttp11Processor process  
> SEVERE: Error processing request  
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.buf.B2CConverter  
> at org.apache.catalina.connector.CoyoteAdapter.parsePathParameters(CoyoteAdapter.java:1102)  
> at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:816)  
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:517)  
> at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)  
> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)  
> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)  
> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)  
> at java.lang.Thread.run(Thread.java:748)

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [April 10, 2018, 2:36pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/7 "2018-04-10T14:36:29Z")

</div>

One way to really be extra sure your memory setup was take into account is to execute:

`ps aux | grep java`

and see of you have -Xmx1024m in the result.

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 10, 2018, 2:42pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/8 "2018-04-10T14:42:01Z")

</div>

I ran the command

> ps aux | grep java

and got:

> tomcat8 12458 5.6 31.5 2226980 319772 ? Sl Apr09 65:18 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.endorsed.dirs=/usr/share/tomcat8/endorsed -classpath /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat8 -Dcatalina.home=/usr/share/tomcat8 -Djava.io.tmpdir=/tmp/tomcat8-tomcat8-tmp org.apache.catalina.startup.Bootstrap start  
> ubuntu 25150 0.0 0.0 12944 988 pts/0 S+ 14:37 0:00 grep --color=auto java

I see the

> -Djava.awt.headless=true -Xmx128m

Is there a better way I can implement this memory allocation step?

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [April 11, 2018, 9:19am UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/9 "2018-04-11T09:19:23Z")

</div>

`/etc/default/tomcat8` is the standard way and it always worked for me on Ubuntu or Debian (Including Ubuntu 16.04). If it’s not taken into account that would mean that it’s overwritten some way but not sure what have the priority over `/etc/default/tomcat8`. Maybe there is some leftover customization directly in `/etc/init.d/tomcat8` (this is the one which start by including `/etc/default/tomcat8` and then start Tomcat).

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 11, 2018, 3:21pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/10 "2018-04-11T15:21:50Z")

</div>

Good news!

Since we had the code changed in /etc/default/tomcat8 and it we weren’t getting our page up, I decided to do a fresh Ubuntu instance with the installs and configurations but I also edited the etc/init.d/tomcat8 file with the JAVA\_OPTS=“-Djava.awt.headless=true -Xmx1024m” line included in the appropriate spot.

After this, I decided to run the command:

> sudo /etc/init.d/tomcat8 restart

I then saw the output to the screen:

> […] Restarting tomcat8 (via systemctl): tomcat8.serviceWarning: tomcat8.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.

I checked the DNS:8080 and saw the tomcat default page which is good!  
I then checked the DNS:8080/Xwiki which hung around 20%-24% initialization and didn’t move.

I went back to my ubuntu instance and ran the command:

> sudo systemctl daemon-reload

which keeps returning:

> Failed to execute operation: Connection timed out

again, I appreciate your time and patience in helping me through this matter!

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 11, 2018, 4:58pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/11 "2018-04-11T16:58:24Z")

</div>

Another update:

I started the process two more times, the next try I got to 95% and it hung again. My instance started lagging greatly. I then tried to run Putty again, got a black window that hung there, solved this by restarting the instance itself in the AWS console.

After reboot:

The instance is not lagging anymore, I ran the command:

> sudo systemctl daemon-reload

the command went through fine.

ran the command:

> sudo service tomcat8 status

the status looked good.

while pointing my browser to: DNS:8080/wiki, I ran the command:

> /var/log/tomcat8$ tail -f catalina.out

Got these logs as the Xwiki intilization hung at 18%:

> Apr 11, 2018 4:11:15 PM org.apache.catalina.startup.HostConfig deployDirectory  
> INFO: Deploying web application directory /var/lib/tomcat8/webapps/ROOT  
> Apr 11, 2018 4:11:16 PM org.apache.jasper.servlet.TldScanner scanJars  
> INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.  
> Apr 11, 2018 4:11:16 PM org.apache.catalina.startup.HostConfig deployDirectory  
> INFO: Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 977 ms  
> Apr 11, 2018 4:11:16 PM org.apache.coyote.AbstractProtocol start  
> INFO: Starting ProtocolHandler [“http-nio-8080”]  
> Apr 11, 2018 4:11:16 PM org.apache.catalina.startup.Catalina start  
> INFO: Server startup in 37316 ms  
> 2018-04-11 16:17:13,232 [XWiki initialization] INFO .HibernateDataMigrationManager - Storage schema updates and data migrations are enabled  
> 2018-04-11 16:17:13,784 [XWiki initialization] INFO .HibernateDataMigrationManager - No data migration to apply for wiki [xwiki] currently in version [1001000]  
> 2018-04-11 16:17:13,785 [XWiki initialization] INFO .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki]  
> ubuntu@ip-172-31-19-117:/var/log/tomcat8$ tail -f catalina.out  
> Apr 11, 2018 4:11:15 PM org.apache.catalina.startup.HostConfig deployDirectory  
> INFO: Deploying web application directory /var/lib/tomcat8/webapps/ROOT  
> Apr 11, 2018 4:11:16 PM org.apache.jasper.servlet.TldScanner scanJars  
> INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.  
> Apr 11, 2018 4:11:16 PM org.apache.catalina.startup.HostConfig deployDirectory  
> INFO: Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 977 ms  
> Apr 11, 2018 4:11:16 PM org.apache.coyote.AbstractProtocol start  
> INFO: Starting ProtocolHandler [“http-nio-8080”]  
> Apr 11, 2018 4:11:16 PM org.apache.catalina.startup.Catalina start  
> INFO: Server startup in 37316 ms  
> 2018-04-11 16:17:13,232 [XWiki initialization] INFO .HibernateDataMigrationManager - Storage schema updates and data migrations are enabled  
> 2018-04-11 16:17:13,784 [XWiki initialization] INFO .HibernateDataMigrationManager - No data migration to apply for wiki [xwiki] currently in version [1001000]  
> 2018-04-11 16:17:13,785 [XWiki initialization] INFO .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki]  
> OpenJDK 64-Bit Server VM warning: INFO: os::commit\_memory(0x00007f7cc5c40000, 65536, 1) failed; error=‘Cannot allocate memory’ (errno=12)
> 
> # 
> 
> # There is insufficient memory for the Java Runtime Environment to continue.
> 
> # Native memory allocation (mmap) failed to map 65536 bytes for committing reserved memory.
> 
> # An error report file with more information is saved as:
> 
> # /tmp/hs\_err\_pid1308.log
> 
> # 
> 
> # Compiler replay data is saved as:
> 
> # /tmp/replay\_pid1308.log

After this, I changed the appropriate file’s memory allocation from 1024 to 2048 then I restarted tomcat so the changes would reflect this.

I went to DNS:8080/Xwiki again and this time it hung at 50%.

I ran the command:

> ps aux | grep java

got the output:

> tomcat8 1789 17.6 70.4 4396136 714304 ? Sl 17:08 0:52 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager **-Djava.awt.headless=true -Xmx2048m** -Djava.endorsed.dirs=/usr/share/tomcat8/endorsed -classpath /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat8 -Dcatalina.home=/usr/share/tomcat8 -Djava.io.tmpdir=/tmp/tomcat8-tomcat8-tmp org.apache.catalina.startup.Bootstrap start  
> ubuntu 1884 0.0 0.1 12944 1324 pts/0 S+ 17:12 0:00 grep --color=auto java

_I see that the changes I made to tomcat’s memory took effect. Could there not be enough space/memory in my Ubuntu instance for this?_

---

<div class="post-metadata">

**Author:** ![rbr](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rbr](https://forum.xwiki.org/u/rbr)\
**Post date:** [April 11, 2018, 6:04pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/12 "2018-04-11T18:04:30Z")

</div>

Please post the output of `free -h`  
You should have more than 2GiB memory without swap in the machine for -Xmx2048m.

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 11, 2018, 6:14pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/13 "2018-04-11T18:14:44Z")

</div>

Ran the free -h command, here’s my output:

```
         total used free shared buff/cache available
     Mem: 990M 889M 63M 3.0M 37M 2.7M
   Swap: 0B 0B 0B
```

---

<div class="post-metadata">

**Author:** ![rbr](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rbr](https://forum.xwiki.org/u/rbr)\
**Post date:** [April 11, 2018, 7:13pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/14 "2018-04-11T19:13:38Z")

</div>

I’m sorry this will not work, you are trying to allow a max of 2000MiB of 990MiB to the Java memory pool alone. For an instance with with Xmx1024m I’d suggest 2048Mib (2GiB) sytem memory at least, for Xmx2048m min. 3GiB. So you need a bigger instance. Remember the operating system and the database need memory too.  
Hope that helps.

---

<div class="post-metadata">

**Author:** ![larocheaj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@larocheaj](https://forum.xwiki.org/u/larocheaj)\
**Post date:** [April 11, 2018, 7:56pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/15 "2018-04-11T19:56:35Z")

</div>

Tmortagne, Rbr,

After creating a fresh ubuntu instance with 4GiB (3 wasn’t an option), XWiki completed initiliziation and the distribution wizard is now on screen! Thank you both for your patience and guidance through this process! I learned a lot about Ubuntu,Linux, and Tomcat (and how to diagnose and troubleshoot issues). I’m actually almost done with a write up of this process if this would prove useful here on the forums.

Cheers!

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [April 12, 2018, 8:02am UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/16 "2018-04-12T08:02:42Z")

</div>

> [@larocheaj](#):
>
> I’m actually almost done with a write up of this process if this would prove useful here on the forums.

Great !

Note that a link in [http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/#HOtherInstallationMethods](http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/#HOtherInstallationMethods) would be nice too since that’s the reference place to look at to find install tutorials.

---

<div class="post-metadata">

**Author:** ![rbr](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rbr](https://forum.xwiki.org/u/rbr)\
**Post date:** [April 12, 2018, 8:07am UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/17 "2018-04-12T08:07:37Z")

</div>

Great to hear. Enjoy your wiki.

@tmortagne: Is there any reasonable setup possible, except for development, on a machine with less than 2GiB memory? If not maybe this should be more explicitly stated in the prerequisites? I looked through the docs but I found nothing that states minimum system memory requirements.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [April 12, 2018, 8:11am UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/18 "2018-04-12T08:11:54Z")

</div>

> [@rbr](#):
>
> Is there any reasonable setup possible, except for development, on a machine with less than 2GiB memory? If not maybe this should be more explicitly stated in the prerequisites? I looked through the docs but I found nothing that states minimum system memory requirements.

> **[Installation (XWiki.org)](http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/#HHardwareandSoftwarerequirements)**
>
> Enterprise wiki for sharing knowledge

This leads to [http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Performances/#HMemory](http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Performances/#HMemory) for memory.

---

<div class="post-metadata">

**Author:** ![rbr](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rbr](https://forum.xwiki.org/u/rbr)\
**Post date:** [April 12, 2018, 9:41am UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/19 "2018-04-12T09:41:09Z")

</div>

I reviewed both of the documents before and, correct me if I’m wrong, nothing tells you the minimum system memory (i.e. size of “plugged-in memory modules”) requirements.  
Everything refers to Java memory parameters. While it should be clear that system memory should be bigger than Java memory, why not add sensible defaults for minimum system memory requirements?  
Actually that is what I’d expect to find in the documentation of any application.

---

<div class="post-metadata">

**Author:** ![rbr](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/r/58f4c7/32.png) [@rbr](https://forum.xwiki.org/u/rbr)\
**Post date:** [April 13, 2018, 11:57pm UTC](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874/20 "2018-04-13T23:57:52Z")

</div>

I updated the docs. Revert if you dislike it. I feel the info on the hardware requirements should be there. Hope that helps anyone in the future to not run through the same hassle that we saw in the above thread.

[Next page](https://forum.xwiki.org/t/aws-ec2-ubuntu-tomcat-postgresql/2874.md?page=2)
