Manjaro Linux – Install Apache, PHP, MariaDB – MySQL (LAMP)

To install “LAMP” – Apache, PHP, MySQL on Arch and Manjaro Linux do some steps:

First update Your operating system to latest version:

sudo pacman -Syyu

Apache

After updating Your system lets install Apache web server:

sudo pacman -S apache

Edit file /etc/httpd/conf/httpd.conf, search and comment the following line:
# LoadModule unique_id_module modules/mod_unique_id.so

sudo nano /etc/httpd/conf/httpd.conf

Enable Apache service and restart Apache service using commands:

sudo systemctl enable httpd
sudo systemctl restart httpd

Verify Apache status by command:

sudo systemctl status httpd

PHP

Now install latest version of PHP:

sudo pacman -S php php-apache

After installation we neet to configure out PHP.
Edit file: /etc/httpd/conf/httpd.conf

sudo nano /etc/httpd/conf/httpd.conf

Find the folowing line and comment it:

#LoadModule mpm_event_module modules/mod_mpm_event.so

Also uncomment or add the line:

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

Then add the following lines at the bottom of configuration file:

LoadModule php7_module modules/libphp7.so
AddHandler php7-script php
Include conf/extra/php7_module.conf

PHP installed. Now create index.php file in Apache home directory to check that PHP is installed correctly:

sudo nano /srv/http/index.php
<?php
phpinfo();
?>

Restart the PHP service:

sudo systemctl restart httpd

Go to http://127.0.0.1/ and check that Apache server with latest PHP version installed on your Manjaro Linux:

MySQL MariaDB

Install MySQL Server:

sudo pacman -S mysql

Initialize the MariaDB data directory prior to starting the service:

sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Enable and srart MySQL service:

sudo systemctl enable mysqld 
sudo systemctl start mysqld

Check that MySQL service installed and work correctly:

sudo systemctl status mysqld

After installation MySQL You need to setup root user and password:

sudo mysql_secure_installation

Install Skype on Arch Linux or Manjaro KDE

To install Skype on Arch or Manjaro Linux open terminal and clone latest stable Skype repository:

git clone https://aur.archlinux.org/skypeforlinux-stable-bin

Go to ~/skypeforlinux-stable-bin/ directory and build the AUR package:

cd skypeforlinux-stable-bin/
makepkg -s

When finished the result should be the newly build Skype package ready for the installation:

ls *pkg.tar.xz
skypeforlinux-stable-bin-8.59.0.77-1-x86_64.pkg.tar.xz

Using the pacman command install Skype package. Replace the package name suffix with the Skype version you have compiled previously:

sudo pacman -U --noconfirm skypeforlinux-stable-bin-8.59.0.77-1-x86_64.pkg.tar.xz

That’s all, the Skype installation is now completed. Use the Start menu and search Skype shortcut in Programs->Internet:

or simply start it from terminal:

skypeforlinux

Install Dropbox on Arch Linux or Manjaro KDE

Install Dropbox on Arch based Linux systems is very simple. First of all make sure that on Your system installed GIT, if not install git by command:

sudo pacman -S git

*If you already installed git , you don’t no need.

Now clone Dropbox git repository:

git clone https://aur.archlinux.org/dropbox.git

Go to Dropbox folder:

cd dropbox/

And compile the code by command:

makepkg -si

It’ll take some time so wait for it. If fails to build gpg key then just copy the key and type:

gpg --recv-keys YOUR-KEY

Then again press makepg -si.

Allow SSH root login on Debian and Ubuntu Linux

By default Ubuntu 18.04 installation comes with unset root password. To set root password open up terminal and execute the following linux command:

$ sudo passwd
[sudo] password for user: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Edit SSH configuration file: /etc/ssh/sshd_config and set property PermitRootLogin to yes:

Save configuration file and restart ssh service by command:

sudo service ssh restart

To restart SSH on Debian you can use command:

systemctl restart ssh.service

Turn off clamav for email in VestaCP

You should edit /etc/exim4/exim.conf

#CLAMD =  yes
CLAMD =  no

edit /usr/local/vesta/conf/vesta.conf and comment / remove clamav

#ANTIVIRUS_SYSTEM='clamav'
ANTIVIRUS_SYSTEM=''

than disable and stop the service

systemctl disable clamd
systemctl stop clamd
systemctl restart exim

Test exim (send and receive email)
watch your log

How to install multiple PHP versions on VestaCP

First download and start manager php from Github:

git clone https://github.com/petranikin/mgrvphp.git
cd mgrvphp
bash mgrvphp

Then enter version of PHP You need to install (remember that you need to enter fool version: 7.1.4). All versions of PHP You can see on site: http://php.net/releases

Install packages and dependencies: Yes

Create links in /usr/bin : Yes

Create template in VestaCP: Yes

Then wait when script install PHP on Your server (it took me more than 30 minutes)

Once the installation is complete, you can go to the panel to install the desired template:

How to check PHP version on server and site?

Create the file phpinfo.php. Open it with a text editor and enter the following:

‹?php
phpinfo();
?›

Upload the file to the root of the site → open the file in the browser and look at the installed version of php:

Create Shortcut for Windows program in Ubuntu

  1. Download png icon of your program from Internet.
  2. Create file name.desktop and insert next code:
[Desktop Entry]
Name=ProgramName
Exec=wine "/home/user/Programs/ProgramName/ProgramName.exe"
Icon=/home/user/Programs/ProgramName/ProgramName.png
Type=Application
Categories=Wine;
Name[en_US]=ProgramName

Change text “ProgramName” to name of your program.

Finally change permission for execution this file. That’s all. See the video:

Reinstall youtube-dl on Ubuntu 18.04

First remove old version of youtube-dl if installed:

sudo apt-get remove youtube-dl

Next install latest version of youtube-dl and install it:

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

If you have an error such “/usr/bin/env ‘python’ no such file or directory youtube-dl” – thats meen than you does not have installed python, or you install python3. Install python by command:

sudo apt install python-minimal

Or you can start youtube-dl with python3:

python3 /usr/local/bin/youtube-dl

Or you can create symbolic link python3->python with following command:

sudo ln -s /usr/bin/python3 /usr/local/bin/python

How to Clone a Partition or Hard drive in Linux

First lets show all partitions in system:

fdisk -l

Now clone a partition /dev/sdb1/ to /dev/sdc1 using the following dd command.

dd if=/dev/sdb1  of=/dev/sdc1

The above command tells dd to use /dev/sdb1 as input file and write it to output file /dev/sdc1.

How to Clone Linux Hard Drive

Cloning a Linux hard drive is similar to cloning a partition. However, instead of specifying the partition, you just use the entire drive. Note that in this case it is recommended that the hard drive is same in size (or bigger) than the source drive.

dd if=/dev/sdb of=/dev/sdc

This should have copied the drive /dev/sdb with its partitions on the target hard drive /dev/sdc. You can verify the changes by listing both drives with fdisk command.

fdisk -l

Linux Grub change default boot operating system

Якщо на комп’ютері встановлено декілька операційних систем, по замовчуванню завантажувач Grub завантажує першу операційну систему в списку.

Щоб змінити порядок завантаження операційних систем відкрийте файл

/etc/default/grub

Знайдіть рядок

GRUB_DEFAULT=0

Та змініть цифру 0 на номер операційної системи у вашому списку. (Нумерація рядків починається з 0)

Збережіть зміни в файлі та обновіть налаштування Grub

sudo update-grub