WHAT'S NEW?
Loading...
Showing posts with label hosting. Show all posts
Showing posts with label hosting. Show all posts
https://pages.github.com/

https://firebase.google.com/docs/hosting/

https://about.gitlab.com/features/pages/

https://www.netlify.com/features/

https://surge.sh/


Where to host a blog  


https://www.tumblr.com/ 
https://tumblr.zendesk.com/hc/it/articles/231256548-Custom-domains 

 https://www.blogger.com

What is Dat?

Share, backup, and publish your filesystem. You can turn any folder on your computer into a dat. Dat scans your folder, allowing you to:
  • Track your files with automatic version history.
  • Share files with others over a secure peer to peer network.
  • Automate live backups to external HDs or remote servers.
  • Publish and share files with built in HTTP server.
First you must install Node.js

Just follow the steps below.
wget https://nodejs.org/dist/v8.6.0/node-v8.6.0-linux-armv7l.tar.gz
tar -xvf node-v8.6.0-linux-armv7l.tar.gz 
cd node-v8.6.0-linux-armv7l
Copy to /usr/local
sudo cp -R * /usr/local/
To check Node.js is properly installed and you have the right version, run the command node -v

Installing via npm

The Dat command line tool can be installed with npm:
npm install -g dat
Make sure you have node and npm installed first. 

Sharing Data

You can start sharing your website files with a single command:
dat share <dir>

<dir> is the path directory with your static website files. Use dat share mywebsitedir to create a dat and sync your files from your computer to other users. Dat scans your files inside <dir>, creating metadata in <dir>/.dat. Dat stores the public link, version history, and file information inside the dat folder.

Point your domain to your website, install dathttpd

A Web server for Dat and HTTPS.
Dat sites are hosted at public keys, which are the equivalent of IP addresses in the P2P network. The pubkeys are ugly, though! Wouldn't it be nice if your dats could have nice DNS shortnames, and also rehost over HTTPS for people still on legacy browsers? Follow these instructions
Create a config file .dathttpd.yml, 

letsencrypt:
  email: 'bob@foo.com'
  agreeTos: true
sites:
  mywebsite.com:
    url: dat://yourdaturl/
    datOnly: false
replace url with your DAT URL , after you must specify the path of the file .dathttpd.yml
In bash you can set the variable like this:
export DATHTTPD_CONFIG=/home/raspberry/
most other shells follow this convention, but not all. You can set it permanently in ~/.profile for bash (and as before, other shells have other locations). In the example /home/raspberry is the path where is the file.

Use the printenv command to print the names and values of all currently defined environment variables:
printenv 


Install dathttpd

# install build dependencies
sudo apt-get install libtool m4 automake

# install dathttpd 
npm install -g dathttpd

# give node perms to use ports 80 and 443
sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``

# start dathttpd
sudo dathttpd
[sudo] password for raspberry:
Serving from /home/raspberry/.dathttpd
le.challenges[tls-sni-01].loopback should be defined as function (opts, domain, token, cb) { ... } and should prove (by external means) that the ACME server challenge 'tls-sni-01' will succeed
Handling ACME challenges and redirecting to https on plain port 80
Handling ACME challenges and serving https 443
Serving dat.local dat://yourdaturl/

To daemonify the server, stop the dathttpd process and then run:
# install a helper tool
sudo npm install -g add-to-systemd

# create a systemd entry for dathttpd
sudo add-to-systemd dathttpd --user $(whoami) $(which dathttpd)

# start the dathttpd service
sudo systemctl start dathttpd
raspberry@raspberry-desktop:~$ sudo systemctl status dathttpd
â dathttpd.service
   Loaded: loaded (/lib/systemd/system/dathttpd.service; enabled; vendor preset:
   Active: active (running) since mer 2017-09-27 14:35:12 CEST; 1s ago
 Main PID: 3318 (node)
   CGroup: /system.slice/dathttpd.service
           Ã¢Ã¢3318 node /usr/local/bin/dathttpd

set 27 14:35:12 raspberry-desktop systemd[1]: Started dathttpd.service.

Create the home directory while creating a user

useradd -m THEUSERNAME
You can then set the password with:
passwd THEUSERNAME

You can disable logins to the account by setting the shell to /sbin/nologin

usermod -s /sbin/nologin THEUSERNAME


Enable usedir.conf of apache.
1
nano /etc/httpd/conf.d/userdir.conf
Change from:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disabled
  
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    UserDir public_html
  
</IfModule>
  
<Directory /home/*/public_html>
        Options Indexes Includes FollowSymLinks
         Require all granted
</Directory>
To:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    #UserDir disabled
  
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    UserDir public_html
  
</IfModule>
  
<Directory /home/*/public_html>
        Options Indexes Includes FollowSymLinks
         Require all granted
</Directory>
Then restart apache…
1
systemctl restart httpd.service

Create user’s public_html and assign permissions.
Then here’s the other new things, especially you are using SELinux


2
setsebool -P httpd_enable_homedirs true
chcon -R -t httpd_sys_content_t /home/THEUSERNAME/public_html
Create an index.html file
/home/THEUSERNAME/public_html/index.html

Change ownership 
Run the test by navigating to the following URL from your browser.