1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00
Custom Web app with SFTP access
Find a file
Pierre de La Morinerie 192a8c3e46 Fix path to root directory
SInce installing Yunohost 2.4, I couldn't display the `index.html` page of a vanilla my_webapp installation (404). Nginx logs displayed this error:

> [error] 6345#0: *218 open() "/usr/share/nginx/htmlindex.php" failed (2: No such file or directory), client: 82.66.214.87, server: kemenaran.eu, request: "GET /index.html HTTP/1.1", host: "kemenaran.eu"

Steps to reproduce:

1. Install Yunohost 2.4
2. Add a new custom domain (e.g. mydomain.com)
3. Install a my_webapp using this custom domain
4. Attempt to open `mydomain.com./index.html` in a web browser

Adding this trailing slash solves the issue. I'm not sure this is how it should be solved, but it fixed a painful issue for me :)
2016-05-23 05:35:20 +02:00
conf Fix path to root directory 2016-05-23 05:35:20 +02:00
scripts [enh] Check password strength and check if user exists at removal 2016-05-15 12:14:52 +02:00
sources/www [enh] Rewrite scripts and app to offer an SFTP access instead 2016-05-14 19:26:10 +02:00
.gitignore [enh] Update .gitignore 2016-05-14 19:16:37 +02:00
LICENSE Add LICENSE and use GPL-3 in the manifest 2016-05-14 19:29:13 +02:00
manifest.json [ref] Rename mysql_db argument to with_mysql for comprehension 2016-05-15 12:14:52 +02:00
README.md [doc] Update README.md with typo fix and links 2016-05-19 19:11:24 +02:00

Custom Webapp

Empty application with SFTP access to the Web directory.

Overview

This application allows you to easily install a custom Web application, providing files access with SFTP. It can also create a MySQL database - which will be backed up and restored with your application. The connection details will be stored in the file db_accesss.txt located in the root directory.

Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access - the password is one you give at the installation. Under the Web directory, you will see a www folder which is the public and served one. You can put all the files of your custom Web application inside.

Upgrade

Due to the SFTP access change, the upgrade can not be done from the last my_webapp application - provided with YunoHost 2.2. You will have to remove it first and install this new one, taking care of migrating your data.

Save your files and the database

You will have to save the content of the /var/www/my_webapp/files directory, either from the Web admin interface provided by the old app or connecting to your server using SSH - or SFTP as admin.

If you've created a MySQL database, you can also migrate it since the new version allows to manage it for you. To create a dump, you could either use phpMyAdmin or connect to your server and execute: mysqldump -u root -p$(cat /etc/yunohost/mysql --no-create-db "$dbname" > ./dump.sql (do not forget to replace $dbname by your database name).

Restore your custom Webapp

When you've taken care of saving your files - and optionally your database, you can remove the app and install this new one. You can set the same settings as the previous installation.

To restore your files, connect to the Web directory using the SFTP account - as described at the installation path - and put everything into the www directory.

If you have chosen to migrate your database too, open the file db_access.txt to know the new database, user and password you will have to set in your app configuration. You can restore the dump you've created earlier either using phpMyAdmin or connect to your server and execute: mysql -u "$dbuser" -p"$dbpass" "$dbname" < ./dump.sql (do not forget to replace $dbuser, $dbpass and $dbname with the values given in the file).

## Links

YunoHost: https://yunohost.org/