domingo, 17 de janeiro de 2021

How to install Nextcloud 20 on Ubuntu Server 20.04

0 comentários

How to install Nextcloud 20 on Ubuntu Server 20.04 - TechRepublic


How to install the necessary dependencies

The first thing to be done is the installation of the necessary dependencies. We'll break this into two sections. Log in to your server and access a terminal window. Install the first set of dependencies with the command:

sudo apt-get install apache2 mysql-server -y

When that completes, install the second group of dependencies with the command:

sudo apt-get install php zip libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-mysql php-bcmath php-gmp -y

How to secure the MySQL database

With the dependencies out of the way, the next thing to be taken care of is securing the database server. Back at the terminal window, issue the command:

sudo mysql_secure_installation

Give MySQL a new admin password and answer the remaining questions with y (for yes).

How to create the database

Now we'll create the Nextcloud database and a database user. Log in to the MySQL console with the command:

sudo mysql -u root -p

Create the new database with the command:

CREATE DATABASE nextcloud;

Create a new user with the command:

CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'PASSWORD';

Where PASSWORD is a unique and strong password.

Give the new user the necessary permissions with the command:

GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';

Flush the privileges and exit the console with the commands:

FLUSH PRIVILEGES;
exit

How to download and unpack the Nextcloud file

In order to install Nextcloud, we have to first download the necessary zipped file. To do that, issue the command:

get actual version in Install – Nextcloud

Unpack that file with the command:

unzip nextcloud-20.0.0.zip

Move the newly-created nextcloud file to the Apache document root with the command:

sudo mv nextcloud /var/www/html/

Next, we'll give the Nextcloud folder the necessary ownership with the command:

sudo chown -R www-data:www-data /var/www/html/nextcloud

How to configure the web server

With the Nextcloud directory in place, we now have to make Apache aware of it. For that, we have to create a .conf file with the command:

sudo nano /etc/apache2/sites-available/nextcloud.conf

In that file, paste the following:

Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All
      <IfModule mod_dav.c>
        Dav off
      </IfModule>     

     SetEnv HOME /var/www/html/nextcloud
    SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>

Save and close the file. 

Enable the new site with the command:

sudo a2ensite nextcloud

We'll now enable the necessary Apache modules by issuing the command:

sudo a2enmod rewrite headers env dir mime

Finally, we'll change the PHP memory limit with the command:

sudo sed -i '/^memory_limit =/s/=.*/= 512M/' /etc/php/7.4/apache2/php.ini

Restart Apache with the command:

sudo systemctl restart apache2

How to finish the installation

Your venture into the command line is complete. Now you can open a browser and point it to http://SERVER_IP/nextcloud (where SERVER_IP is the IP address of the hosting server). You'll first be greeted by the web-based installer (Figure A).

Figure 

nc20a.jpg

The Nextcloud web-based installer.

Create a new admin user and fill out the details for the database, which will be:

  • Database user: nextcloud

  • Database password: The password you created for the nextcloud database user

  • Database name: nextcloud

Leave localhost as is and leave Install Recommended Apps checked.

After you've entered the information, click Finish Setup. When the installation completes, you'll find yourself logged in with the Admin user and on the new Nextcloud Dashboard (Figure B).

Figure B

nc20b.jpg

The new Nextcloud Dashboard awaits customization.


Continue reading →
quarta-feira, 6 de janeiro de 2021

Reparar o HD (Disco Rígido)

0 comentários

 Como reparar o HD isolando BadBlocks usando Linux ou Windows | Ariane Brandão (arianebrandao.github.io)


Primeiramente é interessante verificar se o HD contém badblocks, para então executar o comando para reparar. Precisamos saber qual partição do HD vamos testar, para isso, abrimos o terminal e digitamos o comando:

sudo fdisk -l

As partições então serão listadas, geralmente algo parecido com “/dev/sda1”. Você também pode usar o programa GParted (já vem instalado em algumas distros) para listar as partições do HD.

Verificando o disco

Para executar o teste por badblocks apenas por leitura de informações digite o comando no terminal, onde o X é substituído pelo número da partição:

sudo badblocks -sv -c 1024 /dev/sdaX

Este próximo comando testa o HD lendo, escrevendo e também verificando as informações, é um método mais completo e mais lento:

sudo badblocks -nsv -c 10240 /dev/sdaX

Isolando os badblocks

Antes de prosseguir, salve os dados importantes do seu HD em um lugar seguro. O próximo comando usa o método anterior e também formata a partição selecionada:

sudo badblocks -wsv -c 10240 /dev/sdaX

Explicando os parâmtros do comando:

-s = Mostra o avanço do procedimento
-v = verbose mode
-c 10240 = Verifica 10 mil blocos de HD por vez
-n = non-destructive read-write
-w = destructive write-mode

Lembrando que podem demorar horas para fazer a verificação por completo.

Continue reading →
segunda-feira, 4 de janeiro de 2021

Instalar por terminal o pacote de idiomas Português do Ubuntu

0 comentários

 sudo apt-get install language-pack-gnome-pt language-pack-pt-base

dpkg-reconfigure -f noninteractive locales
Continue reading →
domingo, 3 de janeiro de 2021

Script para controlar FAN case Argon One

0 comentários

 https://download.argon40.com/argon1.sh | bash

Continue reading →