29) Installing phpSysInfo

<-- Previous    Next –>

phpSysInfo is a simple monitoring PHP application that displays some operational details of your computer. It is relatively easy to install and can be protected by a .htaccess / htpasswd file.

We have installed our web site at /websites/www/html/ if you are using the USB drive, or at /var/www/html/ if you are using the default location.

Install phpSysInfo from the terminal using:

sudo apt-get install phpsysinfo

This should have installed it in the folder /usr/share/phpsysinfo

Link the folder to the location of your web site:

sudo ln -s /usr/share/phpsysinfo /var/www/html

or if you have installed the web files a USB drive then:

sudo ln -s /usr/share/phpsysinfo /websites/www/html/

This makes a symbolic link from where phpSysInfo was installed to our web site.

Then, enter into your browser:

http://webhostname/phpsysinfo

This should display the System Information Page.

To protect our page from users who should not have access, we can use .htaccess / htpasswd files to password protect the directory.

We have to create two files, .htpasswd and .htacess

First the .htpasswd file

We normally place this file somewhere outside the root of the web site which cannot be accessed using a web browser. In my case I am going to place it in the folder /websites

So in the terminal, change directory to /websites

cd /websites

You need to generate a username / password which can be done on the web site.

https://www.web2generators.com/apache-tools/htpasswd-generator

For a username of test and a password of test you will get something like the following.

test:$apr1$u0z4qfnb$RZO3oO8gPcF8ztqRyj4Sj/

Now we create an .htpasswd file

sudo nano .htpasswd

and just copy the line into it, save the file by Ctrl-X, Y and Enter.

To see if the file was created, enter:

ls -al

Note that entering ls will not normally display files that begin with a full stop.

Now we create the .htaccess file.

In the terminal, change directory to the folder phpsysinfo, in my case located at /websites/www/html/phpsysinfo

cd /websites/www/html/phpsysinfo

Create a file called .htaccess by:

sudo nano .htaccess

Enter in the following:

AuthType Basic
AuthName “Password Protected Area”
AuthUserFile /path/to/.htpasswd
Require valid-user

The path /path/to/.htpasswd will be the full filename of the .htpasswd file.

Save it by Ctl-X, Y and Enter.

Now when you browse to the phpsysinfo folder, you should be presented with a username / password authentication box. If you enter in the username / password you create, the phpSysInfo page will appear as before.

<-- Previous    Next –>