# How to set up the webwallet

**URL:** <https://forum.universal-credit-system.org/t/how-to-set-up-the-webwallet/109>\
**Category:** Documents and Sources\
**Created:** [October 19, 2022, 4:26pm UTC](https://forum.universal-credit-system.org/t/how-to-set-up-the-webwallet/109 "2022-10-19T16:26:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0e](https://forum.universal-credit-system.org/user_avatar/forum.universal-credit-system.org/m0e/32/74_2.png) [@m0e](https://forum.universal-credit-system.org/u/m0e)\
**Post date:** [October 19, 2022, 4:26pm UTC](https://forum.universal-credit-system.org/t/how-to-set-up-the-webwallet/109/1 "2022-10-19T16:26:33Z")

</div>

**HOW TO SET UP THE WEBWALLET**

This thread is about how you can set up the webwallet. The webwallet is a safe and easy built solution to provide access to the wallet via a webpage. It was developed and tested on a setup with **nginx and php-fpm**.

From a technical point of view the users start at a landing page named `index.html` served by nginx. The users credentials are send via POST method to the script `wallet.php` which runs on the server side. The script itself then calls a shell script named `webwallet.sh` that acts as a connector between the wallet client and the webserver. It manages the sessions and triggers the calls of `ucs_client.sh`, catches the output and builds a webpage for the user based on that data. The script basically outputs a stream of html code to STDOUT that is then forwarded to the webserver.

**STEP 1 : HAVE A RUNNING NGINX WITH PHP-FPM SETUP**

Once you have a [working nginx and php-fpm set up](https://forum.universal-credit-system.org/t/how-to-set-up-nginx-with-php-fpm/110) it is important to increase the timeouts that are set in the NGINX config. Add the following lines inside the _server block_ (`server {`) of your NGINX config.:

`proxy_read_timeout 300;`  
`proxy_connect_timeout 300;`  
`proxy_send_timeout 300;`

In the _php block_ (`location ~ \.php$`) of the NGINX config you have to add the following line right below the line containing `fastcgi_pass`:

`fastcgi_read_timeout 300s;`

Finally you have to modify `php.ini` file and set `max_execution_time` to the same values as the other timeout values so it doesn’t interfere:  
`max_execution_time = 300`

These timeout values can be different, but keep in mind that depending on your hardware it could take some minutes for the script to calculate everything. So to avoid getting a server timeout we suggest to set this value to few minutes. You also have to make sure that the user under which PHP is running has write access to the wallets home directory because files are uploaded into this folder.

**STEP 2 : EXTRACT THE SOURCES**

Step into the wallet home directory and unpack `webwallet_home.tar`:

`tar -xvf webwallet_home.tar`

After that extract the file `webwallet_www-data.tar`. The target folder that is used in below command is your webservers directory (`/var/www/html`). If your webserver uses a different directory you have to change the path after ‘-C’ option to the one that your webserver is using ( **make sure you have write permissions for this directory ! If you don’t have these permissions use** `sudo` **in front of this command** ):

`tar -xvf webwallet_www-data.tar -C /var/www/html`

**STEP 3 : RUN THE INSTALL SCRIPT**

Now run the installer script (the user that runs this scirpt must have write access to the webservers content directory e.g. /var/www/html so you may used `sudo` in front. Also change /var/www/html to your needs if your webserver is using a different directory):

`sudo ./install_webwallet.sh /var/www/html`

**STEP 4 : START NGINX AND PHP-FPM**

Start **nginx** and **php-fpm** and you should be able to access the webwallet via browser.
