agosto 16, 2022

How to install LAMP on Fedora 29 or Fedora 30?

 

How to install LAMP on Fedora 29 or Fedora 30?

A LAMP server (Linux + Apache + MariaDB + PHP) allows us to have a web server ready to host sites made with each of the components of the acronym. So, this article will teach you how to install LAMP on Fedora 29 and Fedora 30.

Many web developers use Fedora for their work. It’s not uncommon because we’re talking about a very stable and carefully made Linux distribution. However, it is true that Fedora is not the first choice to install LAMP so many don’t know how to do it.

Install LAMP on Fedora 29
Install LAMP

A LAMP server as I said before is composed of Linux, a web server as Apache, a database manager in MariaDB and a programming language to interpret and make the application work, in this case, PHP. Together, they form an ideal combination to develop web applications and to run applications.

- Advertisement -

Let’s start.

Install LAMP on Fedora

1. Install Apache web server

First, you need to install apache web server. It is perhaps the most used web server in the world. It stands out for its ease of use, its great documentation and its compatibility with almost all Linux distributions. In addition, its installation is quite simple. Let’s get to it.

Open a Terminal and run:

:~# sudo dnf install httpd
1.- Install apache web server
1.- Install Apache web server

Once the installation is complete, you need to start the service and enable it to run at system startup.

:~$ sudo systemctl enable httpd
:~$ sudo systemctl start httpd
2.- Enabling httpd service
2.- Enabling httpd service

So far there should be no problems, however, if you want to enable remote access, you have to configure something in the firewall.

:~$ sudo firewall-cmd --permanent --zone=FedoraWorkstation --add-service=http

And finally, restart the Firewall service.

:~$ sudo systemctl restart firewalld
3.- Restarting the Firewall service
3.- Restarting the Firewall service

Next, open the web browser and go to localhost. You will see this:

Apache default page on Fedora 30
Apache default page on Fedora 30

And you can continue with the next step.

3. Install PHP

PHP is another fundamental component of LAMP. Without it, you will not be able to execute correctly web applications created in this language. So, it is necessary to install it.

:~$ sudo dnf install php php-cli php-xml php-pdo php-mysqlnd php-pear php-mbstring php-mcrypt
4.- Installing PHP
4.- Installing PHP

Now it is necessary to test the installation. Create a file named example.php in /var/www/html/ with the following content.

:~$ sudo vi /var/www/html/example.php
<?php
phpinfo();
?>5. Creating a PHP file for test

5. Creating a PHP file for testRestart apache service.

:~$ sudo systemctl restart httpd

Open a web browser and open it. http://IP_ADDRESS/example.php and if you see something like this, then everything goes in order.

6.- PHP installed
6.- PHP installed

The next step is to install MariaDB.

4. Install MariaDB

Now it’s MariaDB’s turn to install. This is so that the applications that require database can run. MariaDB is a MySQL fork that inherits its strength, robustness, and stability.

:~$ sudo dnf install mariadb mariadb-server
7.- Install MariaDB
7.- Install MariaDB

Then, enable the MariaDB service.

:~$ sudo systemctl enable mariadb
:~$ sudo systemctl start mariadb
8.- Enabling MariaDB service
8.- Enabling MariaDB service

Now, you have to define a password and some extra settings. For this, you will use the MySQL script.

:~$ sudo mysql_secure_installation
9.- mysql_secure_installation
9.- mysql_secure_installation
10.- Configuring MariaDB using mysql_secure_installation
10.- Configuring MariaDB using mysql_secure_installation

To the questions that arise, I have answered: Y, N, Y, Y.

And that’s it.

Conclusion

As you may have noticed, installing LAMP is really easy. The key is to do it methodically and everything becomes easy.

The LAMP is necessary for any web developer and for system administrators to be able to run their web applications.

Please spread this article through your social networks.


Fuente: https://www.osradar.com/how-to-install-lamp-on-fedora-29/

junio 05, 2022

Borrar la partición usando el comando Parted

El artículo original está en: https://www.thegeekdiary.com/how-to-delete-disk-partition-using-parted-command/

How To Delete Disk Partition using Parted Command

Before removing the partition, make sure to unmount any partitions on the device and turn off any swap space on the device. Do not remove a partition on a device that is in use. Also take backup of the mount point using that partition, if the data is important to you.

1. Execute parted command to start

# parted

2. Suppose, /dev/sda is the device on which to remove the partition. Use the parted commnad with the /dev/sda device as shown below:

# parted /dev/sda

3. View partition table to determine the minor number of the partition to remove:

# print

4. Remove the partition with the command rm. For example, to remove the partition with minor number 2:

# rm 2
Note: The changes start taking place as soon as Enter has been pressed, please review the command before executing and committing to it.

5. After the partition has been removed, use print command to confirm that it is removed from the partition table. You cam view the output of /proc/partitions to make sure the kernel knows the partition has been removed.

# cat /proc/partitions

6. Remove entry from the /etc/fstab file. Find the line that declares the removed partition, and remove it from the file.

# vi /etc/fstab

 

El artículo original está en: https://www.thegeekdiary.com/how-to-delete-disk-partition-using-parted-command/ 

Gestión de particiones con parted en Linux

 El artículo original está en: https://rm-rf.es/gestion-de-particiones-con-parted-en-linux/

Gestión de particiones con parted en Linux

gnu partedHace un tiempo aprendimos a gestionar discos y particiones con fdisk, ahora vamos ver como trabajar con el programa GNU parted, que permite particionar y redimensionar discos, así como crear, redimensionar y copiar sistemas de fichero extX, swap, FAT y FAT32 (luego veremos que es recomendable utilizar las herramientas propias de Linux en lugar que las que ofrece parted en algunos casos).

Vamos a partir de un disco (virtual) sin particionar. Lo primero que vemos al acceder a parted es un error, ya que parted necesita que el disco tenga una etiqueta (LABEL) para poder trabajar con él:

# parted /dev/sdb
GNU Parted 2.1
Usando /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Error: /dev/sdb: unrecognised disk label

Normalmente se utiliza la etiqueta ‘msdos’ ya que Microsoft y OS/2 es la que reconocen, así que la asignamos con el comando mklabel:

(parted) mklabel                                                          
¿Nuevo tipo de etiqueta de disco? msdos

En todo momento podéis ver los comandos disponibles escribiendo el signo de interrogación (?)

(parted) ?                                                                
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  check NUMBER                             do a simple check on the file system
  cp [DESDE-DISPOSITIVO] DE-NUMERO A-NUMERO   copia el sistema de ficheros a otra partición
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partition NUMBER
  mkpart TIPO-PART [TIPO-SF] INICIO FIN     crea una partición
  mkpartfs TIPO-PART TIPO-SF INICIO FIN     crear una partición con un sistema de ficheros
...
...
...

print: listar discos duros, particiones y espacio libre

El comando print nos permite por un lado mostrar todos los dispositivos (discos duros) reconocidos por el sistema:

(parted) print devices                                                    
/dev/sdb (268MB)
/dev/sda (12,7GB)

También las particiones de cada uno y/o el espacio libre:

(parted) print free                                                       
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 268MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Numero  Inicio  Fin    Tamaño  Typo  Sistema de ficheros  Banderas
        32,3kB  268MB  268MB         Free Space

mkpart: crear una partición sin filesystem

Parted nos da la opción de crear una partición y al mismo tiempo el sistema de ficheros (lo vemos más adelante), pero de momento únicamente vamos a crear una partición estándar sin asignar filesystem. Podemos hacer dos cosas, o seguir el asistente o escribir la línea de comandos completa directamente. Para comenzar lo más sencillo es el asistente:

Partición primaria de 100MB que será usada como filesystem ext4

(parted) mkpart
¿Tipo de partición?  primary/primaria/extended/extendida? primary         
¿Tipo de sistema de ficheros?  [ext2]? ext4                               
¿Inicio? 1                                                                
¿Fin? 100

Si ejecutamos un print list veremos la nueva partición lista para ser formateada con mkfs.ext4:

(parted) print                                                            
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 268MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Numero  Inicio  Fin     Tamaño  Typo     Sistema de ficheros  Banderas
 1      1049kB  99,6MB  98,6MB  primary

mkpartfs: crear una partición con filesystem

Como comentaba antes, parted permite dar formato a la partición en el proceso de creación, aunque claramente vemos al ejecutarlo que recomiendan encarecidamente hacer uso de las herramientas adecuadas para ello (mkfs.extX, e2fsprogs). Así que simplemente vamos a ver como hacerlo por curiosidad (además no soporta ni ext3 ni ext4, sólo ext2…):

WARNING: you are attempting to use parted to operate on (mkpartfs) a file system.
parted’s file system manipulation code is not as robust as what you’ll find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.

(parted) mkpartfs                                                         
WARNING: you are att.....
will be removed in an upcoming release.
¿Tipo de partición?  primary/primaria/extended/extendida? primary         
¿Tipo de sistema de ficheros?  [ext2]? ext2                               
¿Inicio? 100                                                              
¿Fin? 200

Y ya tenemos la partición con sistema de ficheros ext2:

(parted) print                                                            
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 268MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Numero  Inicio  Fin     Tamaño  Typo     Sistema de ficheros  Banderas
 1      1049kB  99,6MB  98,6MB  primary
 2      99,6MB  200MB   101MB   primary  ext2
# mount /dev/sdb2 /test
# df -h | grep /test
/dev/sdb2              90M   13K   86M   1% /test
# umount /test

rm: eliminar una partición

Para eliminar una partición con parted es tan simple como ejecutar «rm» seguido del número de la partición:

(parted) print                                                            
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 268MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Numero  Inicio  Fin     Tamaño  Typo     Sistema de ficheros  Banderas
 1      1049kB  99,6MB  98,6MB  primary
 2      99,6MB  200MB   101MB   primary  ext2
(parted) rm 2  /pre>

check: comprobación de un filesystem

Existen otras opciones, como por ejemplo hacer un check al sistema de ficheros, pero igual que con mkpartfs recomiendan utilizar herramientas propias del sistema como fsck. Además, no soportan sistemas de ficheros ext4 o ext3:

(parted) check 1                                                          
WARNING: you are attempting to use parted to operate on (check) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs.  We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Sin Implementación: El soporte para abrir el sistema de ficheros ext4 aún no está implementado.


Si revisáis la página man o la propia salida de ‘?’ veréis otras opciones, como mkfs para formatear sistemas de ficheros (como comentaba antes, no recomendable) y otras más interesantes como rescue, que permite recuperar una partición perdida indicando su posición de inicio y fin:

(parted) rescue INICIO FIN

Os recomiendo como siempre revisar la página man o la salida de ‘?’ para descubrir todas sus posibilidades, como redimensionar una partición con resize, moverla con move, etc. Eso sí, recordad que es preferible usar los comandos/herramientas propios del sistema para mayor seguridad en estos casos.

 

 El artículo original está en: https://rm-rf.es/gestion-de-particiones-con-parted-en-linux/

Como crear una nueva partición con el sistema de archivos ext4 en Linux

El artículo original está en: https://www.tecmint.com/create-new-ext4-file-system-partition-in-linux/


How to Create a New Ext4 File System (Partition) in Linux

 

The ext4 or fourth extended filesystem is a widely-used journaling file system for Linux. It was designed as a progressive revision of the ext3 file system and overcomes a number of limitations in ext3.

It has significant advantages over its predecessor such as improved design, better performance, reliability, and new features. Although it is best suited for hard drives, it can also be used on removable devices.

This article will show you how to create a new ext4 file system (partition) in Linux. We will first of all look at how to create a new partition in Linux, format it with the ext4 file system and mount it.

Note: For the purpose of this article:

  • We will assume that you have added a new hard drive to your Linux machine, in which you will create the new ext4 partition, and
  • If you are operating the system as an administrative user, use the sudo command to gain root privileges to run the commands shown in this article.

Creating a New Partition in Linux

List the partitions using the fdisk -l or parted -l commands to identify the hard drive you want to partition.

# fdisk -l 
OR
# parted -l
List Linux Partitions
List Linux Partitions

Looking at the output in the screenshot above, we have two hard disks added on the test system and we will partition disk /dev/sdb.

Now use parted command to start creating the partition on the selected storage device.

# parted /dev/sdb

Now give the new disk a label using the mklabel command.

(parted) mklabel msdos

Then create a partition using the mkpart command, give it additional parameters like “primary” or “logical” depending on the partition type that you wish to create. Then select ext4 as the file system type, set the start and end to establish the size of the partition:

(parted) mkpart                                                            
Partition type? primary/extended? primary 
File system type? [ext2]? ext4 
Start? 1 
End? 20190
Create a New Ext4 Partition
Create a New Ext4 Partition

To print the partition table on the device /dev/sdb or detailed information about the new partition, run the print command.

(parted) print
Print Partition Table
Print Partition Table

Now exit the program using the quit command.

Formatting New Ext4 Partition

Next, you need to properly format the new partition with the ext4 file system type using the mkfs.ext4 or mke4fs command as follows.

# mkfs.ext4 /dev/sdb1
OR
# mke4fs -t ext4 /dev/sdb1
Format a New Ext4 Partition
Format a New Ext4 Partition

Then label the partition using the e4label command as follows.

# e4label /dev/sdb1 disk2-part1
OR
# e2label /dev/sdb1 disk2-part1

Mounting New Ext4 Parition in File System

Next, create a mount point and mount the newly created ext4 partition file system.

# mkdir /mnt/disk2-part1
# mount /dev/sdb1 //mnt/disk2-part1

Now using the df command, you can list all file systems on your system together with their sizes in a human readable format (-h), and their mount points and file system types (-T):

# df -hT
Show Linux Filesystem with Mount Points
Show Linux Filesystem with Mount Points

Lastly, add the following entry in your /etc/fstab to enable persistent mounting of the file system, even after a reboot.

/dev/sdb1   /mnt/disk2-part1  ext4   defaults    0   0

You might also like to read these following related articles:

  1. How to Add New Disks Using LVM to an Existing Linux System
  2. How to Add a New Disk to an Existing Linux Server
  3. 10 Best File and Disk Encryption Tools for Linux
  4. How to Create a Virtual HardDisk Volume Using a File in Linux

That’s all! In this article, we’ve explained how to create a new partition in Linux, format it with ext4 file system type and mount it as a filesystem. For more information or to share any queries with us, use the feedback form below

 

El artículo original está en: https://www.tecmint.com/create-new-ext4-file-system-partition-in-linux/



 

febrero 23, 2022

Error desconocido. (TAG2 NO (NOPERM) Permission denied (0.001 + 0.000 secs).)

 Error desconocido. (TAG2 NO (NOPERM) Permission denied (0.001 + 0.000 secs).)


Feb 23 11:51:55 servidor dovecot: imap(usuario): Error: fchown(/home/usuario/mail/.imap/INBOX, group=12(mail)) failed: Operation not permitted (egid=877(usuario), group based on /var/mail/usuario - see http://wiki2.dovecot.org/Errors/ChgrpNoPerm)

Feb 23 11:51:55 servidor dovecot: imap(usuario): Logged out in=32 out=494



Solución

mkdir /home/usuario/mail/.imap/INBOX

febrero 08, 2022

Error al instalar capitan en Mac Apple

My problem is that my Mac starts up to the "El Capitan" installer. After restarting several times, OS X is still on screen telling me that "no packages were eligible for install".

Can someone help please, and can you bear in mind that I’m not technically minded so keep instruction in simple terms.








As explained here, OS X 10.11 "El Capitan" fails to install because it is too old (the technical reason being that the signing certificate is no longer valid).

Como se explica aquí, OS X 10.11 "El Capitán" no se instala porque es demasiado antiguo (la razón técnica es que el certificado de firma ya no es válido).


But you can trick the OS X installer into thinking that it is 2017 and it will happily run without any errors.

Pero puede engañar al instalador de OS X para que piense que es 2017 y se ejecutará felizmente sin errores. 


How to trick the OS X installer. Cómo engañar al instalador de OS X.

  1. When the OS X installer complains that "No packages were eligible for install" and displays this window: Cuando el instalador de OS X se queja de que "No hay paquetes elegibles para instalar" y muestra esta ventana:

    enter image description here

    don't restart your Mac. no reinicie su Mac.

  2. Turn Wi-Fi off or unplug the Ethernet cord, depending on your configuration, to prevent your Mac from connecting to the Internet: Apague Wi-Fi o desconecte el cable Ethernet, según su configuración, para evitar que su Mac se conecte a Internet:

    enter image description here

  3. Select Utilities>Terminal: Seleccione Utilidades>Terminal:

    enter image description here

  4. Click the window that appears: Haga clic en la ventana que aparece:

    enter image description here

    and type date 0115124517 (this will reset the date to Jan 1st 12:45 2017). After typing the command, press Enter: y escriba la fecha 0115124517 (esto restablecerá la fecha al 1 de enero a las 12:45 de 2017). Después de escribir el comando, presione Enter: 

    enter image description here

    Terminal will confirm that the date has been changed with a line of output that displays the new date. La terminal confirmará que la fecha se ha cambiado con una línea de salida que muestra la nueva fecha.

  5. Quit Terminal: Salga de Terminal:

    enter image description here

  6. In the OS X installer window, press Restart: En la ventana del instalador de OS X, presione Reiniciar:

    enter image description here

  7. When your Mac comes back up, disable Wi-Fi and leave the Ethernet cord unplugged, as explained in step 2, and press Continue: Cuando su Mac vuelva a funcionar, deshabilite el Wi-Fi y deje el cable Ethernet desconectado, como se explica en el paso 2, y presione Continuar:

    enter image description here

  8. Read the software license agreement, press Agree to accept it and press Continue: Lea el acuerdo de licencia de software, presione Aceptar para aceptarlo y presione Continuar:

    enter image description here

  9. Select the disk on which you want to install "El Capitan" and press Continue (note that the icon and name of the disk will be different in your case) (there is usually only one option. If you have several options because the Time Machine drive is plugged in to your computer, make sure you select the correct drive and not the Time Machine drive): Seleccione el disco en el que desea instalar "El Capitan" y presione Continuar (tenga en cuenta que el ícono y el nombre del disco serán diferente en su caso) (generalmente solo hay una opción. Si tiene varias opciones porque la unidad Time Machine está conectada a su computadora, asegúrese de seleccionar la unidad correcta y no la unidad Time Machine):

    enter image description here

  10. The installation should now proceed without any errors: La instalación ahora debería continuar sin ningún error:

    enter image description here


  • I had to set the date to the current date first, to get the initial reinstall setup to download from the internet (https/ssl downloads require current date) from the recovery screen, then it failed, then change the date to the past e.g. date 0102030417 (bit easier to type), so that the package installation doesn't fail (that's when it says 24 minutes remaining (Macbook5,1)). 
  • Primero tuve que establecer la fecha en la fecha actual, para obtener la configuración de reinstalación inicial para descargar desde Internet (las descargas de https/ssl requieren la fecha actual) desde la pantalla de recuperación, luego falló, luego cambiar la fecha al pasado, por ejemplo fecha 0102030417 (un poco más fácil de escribir), para que la instalación del paquete no falle (es cuando dice que quedan 24 minutos (Macbook5,1)).

If after you set the date , the WiFi keeps automatically connecting and resetting the date to current date: Si después de configurar la fecha, el WiFi sigue conectándose automáticamente y restableciendo la fecha a la fecha actual:

  1. Turn on WiFi then connect to 'Other' Network. Choose a any network and put in wrong password on purpose. It can't automatically reconnect to WiFi then period. Encienda WiFi y luego conéctese a ' Otra red. Elija cualquier red e ingrese una contraseña incorrecta a propósito. No puede volver a conectarse automáticamente a WiFi y punto. 

  2. Now open the terminal, set the date and reboot. When it boots back in it WiFi will be off. Ahora abra la terminal, configure la fecha y reinicie. Cuando se reinicie, WiFi estará apagado. 

  3. Follow the screens and setup will then go through normally. Siga las pantallas y la configuración se realizará normalmente.


 https://apple.stackexchange.com/questions/394259/mac-stuck-in-el-capitan-installer-loop-no-packages-were-eligible-for-install/394758

enero 18, 2022

Moodle - Quitar [Personalizar esta página] para los usuarios autenticados excepto para administrador

Moodle - Quitar [Personalizar esta página]


Bloque "Ajustes" -> 

Sección "Administración del sitio" ->

Usuarios ->

Permisos ->

Definir roles ->

Dar clic en el botón de edición del rol “Authenticated user” ->

[Elegir la opción “No ajustado” para las capacidades “Gestionar bloques de página Mi Moodle”]




Fuente de la solución:

https://moodle.org/mod/forum/discuss.php?d=204239

https://moodle.org/mod/forum/discuss.php?d=203393

enero 12, 2022

ip link show

ip link show

El comando IP es la navaja suiza de los comandos de red de Linux.

Estamos viendo específicamente el comando IP LINK, el comando usado para nombrar y modificar interfaces de red.

Para sólo enumerar o mostrar los nombres de todas las interfaces de red, utilice lo siguiente:

# ip link show

1: lo: xxxxxxx

2: eth0: xxxxxxx

3: eth1: xxxxxxx


¿Cómo poner el conteo de las filas en una consulta en MySql?

 ¿Cómo poner el conteo de las filas en una consulta en MySql? SELECT  @rownum := @rownum + 1 AS contador,  /*Contador*/ t.*  /* nombre d...