Skip to content

Commit 9953dd7

Browse files
authored
Merge pull request #71 from NethServer/pull_website
Add pull instructions for website content management
2 parents a0f37de + 8a6270a commit 9953dd7

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ We use local database to store configuration, you can find it `/home/webserver1/
2323
### php-fpm
2424

2525
- add `dyn-9001.custom` to `/home/webserver1/.config/state/php{php version}-fpm-custom.d/` for example `/home/webserver1/.config/state/php7.4-fpm-custom.d/`
26-
- `vim /home/webserver1/.config/state/php7.4-fpm-custom.d/dyn-9001.custom` and wriite a valid php-fpm configuration
26+
- `vim /home/webserver1/.config/state/php7.4-fpm-custom.d/dyn-9001.custom` and write a valid php-fpm configuration
2727
- set the file ownership to webserver1 : `chown webserver1:webserver1 /home/webserver1/.config/state/php7.4-fpm-custom.d/dyn-9001.custom`
2828

29-
## sftpgo
29+
## sftpgo : push the website
3030

3131
Sftpgo is used to upload files to the webserver, once the webserver module is installed the default password and user are admin:admin at http://foo.com/sftpgo/, think to change it
3232

@@ -65,6 +65,22 @@ sftp -P 3092 [email protected]
6565
lcd /path/files
6666
put -r *
6767
```
68+
69+
## alternative method : pull the website
70+
71+
Instead of pushing website content to an SFTP server, you can pull the content directly from the container. This method simplifies the content management
72+
73+
To pull website content from inside the container once the virtualhost has been created (the vhost ID is the default sftp login: 9001, 9002, 9003, ... ):
74+
75+
- Connect to the container:
76+
`runagent -m webserver1 podman exec -ti nginx ash`
77+
- Navigate to the root directory of your virtualhost:
78+
`cd /usr/share/nginx/html/9001`
79+
- Use commands like wget to get the latest content , for rsync (to sync files), or git (to pull from a repository) you need to manually first install them each time you restart the container
80+
`apk add rsync git`
81+
- permissions can be managed (must be adapted to the website)
82+
`chown nginx:root -R /usr/share/nginx/html/9001`
83+
6884
### Create API key
6985

7086
Sftpgo has a rest api that we can use by an API key, this is how we created it

0 commit comments

Comments
 (0)