How to Solve Error Message AH01276: Cannot serve directory /: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive

This article will discuss about how to solve an error message as exist in the title of this article itself. Basically, the context of this article is troubleshooting to solve why a web-based application using Yii framework is not working. The actual error message exist as follows :

Continue reading

How to Solve Error Message .htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration in Linux Ubuntu 19.10 Operating System

This is an article where the main focus is to handle the error message as in the title. The error mesage is ‘.htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration’. It exist as part of the error log of the Apache Webserver. Basically, the error appear in the error log file upon accessing a web-based page. That web-based page has a Yii platform as its framework. Furthermore, there is a ‘.htaccess’ file in the root folder of the web page. The ‘.htaccess’ file actually support  the URL modification of the web page itself. The following is the actual content of the .htaccess file :

Continue reading

How to Install PHP for Displaying PHP Webpage in Apache Webserver on Linux Ubuntu 19.10 Operating System

This is another article displaying on how to install PHP so that Apache Webserver can process and display a webpage written in PHP programming language. Furthermore, the Apache Webserver mentioned exist in a Linux Ubuntu operating system. In this context, it is a Linux Ubuntu 19.10 operating system. But before installing a PHP programming language or PHP module in Apache Webserver, it is obvious that the most important step is installing the Apache Webserver. For more information about the Apache Webserver’s installation process, it exist in this link. The following is the step for achieving the purpose :

1.Execute the following command for installing PHP and the associated PHP module in Apache Webserver :

root@hostname:/var/www/html# apt install php libapache2-mod-php php-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php7.3 php-common php7.3 php7.3-cli php7.3-common php7.3-json php7.3-mysql php7.3-opcache php7.3-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  libapache2-mod-php libapache2-mod-php7.3 php php-common php-mysql php7.3 php7.3-cli php7.3-common php7.3-json php7.3-mysql php7.3-opcache php7.3-readline
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 4.048 kB of archives.
After this operation, 18,1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan/main amd64 php-common all 2:69ubuntu2 [11,8 kB]
Get:2 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 php7.3-common amd64 7.3.11-0ubuntu0.19.10.1 [919 kB]                                                                                     
Get:3 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 php7.3-json amd64 7.3.11-0ubuntu0.19.10.1 [18,9 kB]                                                                                      
Get:4 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 php7.3-opcache amd64 7.3.11-0ubuntu0.19.10.1 [184 kB]                                                                                    
Get:5 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 php7.3-readline amd64 7.3.11-0ubuntu0.19.10.1 [12,3 kB]                                                                                  
Get:6 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 php7.3-cli amd64 7.3.11-0ubuntu0.19.10.1 [1.411 kB]                                                                                      
Get:7 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 libapache2-mod-php7.3 amd64 7.3.11-0ubuntu0.19.10.1 [1.354 kB]                                                                           
Get:8 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan/main amd64 libapache2-mod-php all 2:7.3+69ubuntu2 [2.928 B]                                                                                                 
Get:9 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 php7.3 all 7.3.11-0ubuntu0.19.10.1 [9.240 B]                                                                                             
Get:10 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan/main amd64 php all 2:7.3+69ubuntu2 [2.800 B]                                                                                                               
Get:11 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan-updates/main amd64 php7.3-mysql amd64 7.3.11-0ubuntu0.19.10.1 [119 kB]                                                                                     
Get:12 http://xxxxxxxxxxxxxxxxxxxxx/ubuntu eoan/main amd64 php-mysql all 2:7.3+69ubuntu2 [2.012 B]                                                                                                         
Fetched 4.048 kB in 21s (189 kB/s)                                                                                                                                                                         
Selecting previously unselected package php-common.
(Reading database ... 153834 files and directories currently installed.)
Preparing to unpack .../00-php-common_2%3a69ubuntu2_all.deb ...
Unpacking php-common (2:69ubuntu2) ...
Selecting previously unselected package php7.3-common.
Preparing to unpack .../01-php7.3-common_7.3.11-0ubuntu0.19.10.1_amd64.deb ...
Unpacking php7.3-common (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package php7.3-json.
Preparing to unpack .../02-php7.3-json_7.3.11-0ubuntu0.19.10.1_amd64.deb ...
Unpacking php7.3-json (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package php7.3-opcache.
Preparing to unpack .../03-php7.3-opcache_7.3.11-0ubuntu0.19.10.1_amd64.deb ...
Unpacking php7.3-opcache (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package php7.3-readline.
Preparing to unpack .../04-php7.3-readline_7.3.11-0ubuntu0.19.10.1_amd64.deb ...
Unpacking php7.3-readline (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package php7.3-cli.
Preparing to unpack .../05-php7.3-cli_7.3.11-0ubuntu0.19.10.1_amd64.deb ...
Unpacking php7.3-cli (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package libapache2-mod-php7.3.
Preparing to unpack .../06-libapache2-mod-php7.3_7.3.11-0ubuntu0.19.10.1_amd64.deb ...
Unpacking libapache2-mod-php7.3 (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package libapache2-mod-php.
Preparing to unpack .../07-libapache2-mod-php_2%3a7.3+69ubuntu2_all.deb ...
Unpacking libapache2-mod-php (2:7.3+69ubuntu2) ...
Selecting previously unselected package php7.3.
Preparing to unpack .../08-php7.3_7.3.11-0ubuntu0.19.10.1_all.deb ...
Unpacking php7.3 (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package php.
Preparing to unpack .../09-php_2%3a7.3+69ubuntu2_all.deb ...
Unpacking php (2:7.3+69ubuntu2) ...
Selecting previously unselected package php7.3-mysql.
Preparing to unpack .../10-php7.3-mysql_7.3.11-0ubuntu0.19.10.1_amd64.deb ...
Unpacking php7.3-mysql (7.3.11-0ubuntu0.19.10.1) ...
Selecting previously unselected package php-mysql.
Preparing to unpack .../11-php-mysql_2%3a7.3+69ubuntu2_all.deb ...
Unpacking php-mysql (2:7.3+69ubuntu2) ...
Setting up php-common (2:69ubuntu2) ...
Created symlink /etc/systemd/system/timers.target.wants/phpsessionclean.timer → /lib/systemd/system/phpsessionclean.timer.
Setting up php7.3-common (7.3.11-0ubuntu0.19.10.1) ...

Creating config file /etc/php/7.3/mods-available/calendar.ini with new version

Creating config file /etc/php/7.3/mods-available/ctype.ini with new version

Creating config file /etc/php/7.3/mods-available/exif.ini with new version

Creating config file /etc/php/7.3/mods-available/fileinfo.ini with new version

Creating config file /etc/php/7.3/mods-available/ftp.ini with new version

Creating config file /etc/php/7.3/mods-available/gettext.ini with new version

Creating config file /etc/php/7.3/mods-available/iconv.ini with new version

Creating config file /etc/php/7.3/mods-available/pdo.ini with new version

Creating config file /etc/php/7.3/mods-available/phar.ini with new version

Creating config file /etc/php/7.3/mods-available/posix.ini with new version

Creating config file /etc/php/7.3/mods-available/shmop.ini with new version

Creating config file /etc/php/7.3/mods-available/sockets.ini with new version

Creating config file /etc/php/7.3/mods-available/sysvmsg.ini with new version

Creating config file /etc/php/7.3/mods-available/sysvsem.ini with new version

Creating config file /etc/php/7.3/mods-available/sysvshm.ini with new version

Creating config file /etc/php/7.3/mods-available/tokenizer.ini with new version
Setting up php7.3-mysql (7.3.11-0ubuntu0.19.10.1) ...

Creating config file /etc/php/7.3/mods-available/mysqlnd.ini with new version

Creating config file /etc/php/7.3/mods-available/mysqli.ini with new version

Creating config file /etc/php/7.3/mods-available/pdo_mysql.ini with new version
Setting up php7.3-opcache (7.3.11-0ubuntu0.19.10.1) ...

Creating config file /etc/php/7.3/mods-available/opcache.ini with new version
Setting up php-mysql (2:7.3+69ubuntu2) ...
Setting up php7.3-json (7.3.11-0ubuntu0.19.10.1) ...

Creating config file /etc/php/7.3/mods-available/json.ini with new version
Setting up php7.3-readline (7.3.11-0ubuntu0.19.10.1) ...

Creating config file /etc/php/7.3/mods-available/readline.ini with new version
Setting up php7.3-cli (7.3.11-0ubuntu0.19.10.1) ...
update-alternatives: using /usr/bin/php7.3 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.3 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.3 to provide /usr/bin/phar.phar (phar.phar) in auto mode

Creating config file /etc/php/7.3/cli/php.ini with new version
Setting up libapache2-mod-php7.3 (7.3.11-0ubuntu0.19.10.1) ...

Creating config file /etc/php/7.3/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.3
Setting up libapache2-mod-php (2:7.3+69ubuntu2) ...
Setting up php7.3 (7.3.11-0ubuntu0.19.10.1) ...
Setting up php (2:7.3+69ubuntu2) ...
Processing triggers for man-db (2.8.7-3) ...
root@hostname:/var/www/html# 

2. In order to prove that the Apache Webserver can execute a webpage with a PHP script exist in it, just create a new file containing the following line :

<?php
phpinfo();
?>

Save the file in the root folder or root document of the Apache Webserver. Normally, it exists in ‘/var/www/html’. So, just save it in a file with the name of ‘phpinfo.php’ for an example. So, the full complete file exist in ‘/var/www/htm/phpinfo.php’.

3. Execute the file in a Web Browser application. If the installation of the PHP module is a success in an Apache Webserver, the following page will appear :

4. Last but not least, execute the following command to persist or to auto start the Apache Webserver’s service every time the operating system starts :

root@hostname:~# systemctl enable apache2
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
root@hostname:~#

How to Install Apache Webserver in Linux Ubuntu 19.10 in Command Line

Introduction

This is an article for installing Apache Webserver in a Linux Ubuntu 19.10 operating system. The installation process will be exist in a command line interface using a specific command. There are two parts for the installation of Apache Webserver. The first one is the preparation step. The other one is the actual installation sptep. So, continue on to the installation, just perform the preparation step first as follows :

 

Preparation for Apache Webserver Installation in Linux Ubuntu 19.10

The following is the preparation step :

1. First of all, don’t forget to switch to root or admin user account. In order to switch to it, just execute the following command in the command line :

user@hostname:~$ sudo su - 
[sudo] password for user: 
root@hostname:~# 

2. In order to make sure that everything is up-to-date, including the package file installation of Apache Webserver, just execute the following command :

apt update

Installation Process of Apache Webserver in Linux Ubuntu 19.10

1. After successfully switching to a root or an admin user account, execute the following command. It is a command which is utilizing the ‘apt’ tool. There is an additional parameter ‘install’ followed by the name of the package for the installation process. The following is the output of the command process execution :

Continue reading

How to install Apache Webserver in Ubuntu Linux 18.04

Introduction

This article presents how to install Apache Webserver in Ubuntu Linux 18.04. The way for installing it is very easy. Performing the installation is possible by executing certain command in the command line.

But first of all, check whether the Apache Webserver exist in the package repository by typing the following command :

apt search --names-only ^.*apache.*$

If there is a package with the name of ‘apache’, the following output will appear :

user@hostname:~$ apt search --names-only ^.*apache.*$
Sorting... Done
Full Text Search... Done
apache2/bionic-updates,now 2.4.29-1ubuntu4.5 amd64 [installed]
  Apache HTTP Server

...

Another alternative command for searching the package contain the keyword ‘apache’ exists as follow :

Continue reading