Note all commands are ran as root unless otherwise noted.
Part 1 - basic installation
Install software:
dnf install git httpd php php-json
Increase PHP's post file size limit (by default its 8MB, LibreSpeed posts a 20MB file). Make a backup of php.ini before making any edits:
cd /etc
cp php.ini php.ini.`date +%Y%m%d`.original
Search for "post_max_size" and make it > 20MB since LibreSpeed posts a 20MB file (I use 128 MB which is overkill, I set it high in case LibreSpeed ever increases its post file size):
vi /etc/php.ini
;post_max_size = 8M
post_max_size = 128M
Make a backup of the edited file:
cp php.ini php.ini.`date +%Y%m%d`.post_max_size
ll php.ini*
To have the change take effect you must restart the php-fpm service:
systemctl restart php-fpm
Configure the httpd (Apache) web server:
systemctl status httpd
systemctl enable httpd
systemctl start httpd
systemctl status httpd
systemctl status firewalld
firewall-cmd --permanent --list-all
firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --reload
firewall-cmd --permanent --list-all
systemctl status firewalld
Download LibreSpeed (may do this as a regular user account). I assume you're in your home directory:
git clone https://github.com/librespeed/speedtest.git
Configure basic speedtest:
cd speedtest
cp -R backend example-singleServer-pretty.html *.js /var/www/html
cd /var/www/html
mv example-singleServer-pretty.html index.html
At this point your basic speedtest server should be working. You should be able to access it at http://localhost/ locally or http://servername/ remotely.
Part 2 - advanced (results recording) configuration
Copy files:
cd /root/speedtest/
cp -R results/ /var/www/html
cp example-singleServer-full.html /var/www/html/index.html
Edit the telemetry_settings.php (text) configuration file (I use the "vi" editor) Make a backup of telemetry_settings.php before making any edits:
cd /var/www/html/results/
cp telemetry_settings.php telemetry_settings.php.`date +%Y%m%d`.original
vi /var/www/html/results/telemetry_settings.php
Change these lines:
$stats_password="pass123";
$enable_id_obfuscation=false; //optionally could change this to true
$MySql_username="root";
$MySql_password="root123";
$MySql_hostname="localhost";
$MySql_databasename="speedtest";
Make a backup of the edited file:
cp telemetry_settings.php telemetry_settings.php.`date +%Y%m%d`.statsMySql
ll telemetry_settings.php*
Install required php and MySQL packages then start the MySQL server:
dnf install mysql-server php-mysqlnd php-gd
systemctl status mysqld
systemctl enable mysqld
systemctl start mysqld
systemctl status mysqld
Configure the MySQL root user:
mysql
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'root123';
mysql> flush privileges;
Create the speedtest MySQL database. If you exited out of the MySQL client you can log back into mysql by running mysql -u root -p (note you don't need to be root in Linux to run this). Otherwise if you stayed in the mysql client you may jump straight to these mysql commands:
mysql> show databases;
mysql> create database speedtest;
mysql> show databases;
mysql> use speedtest;
mysql> show tables;
mysql> source /var/www/html/results/telemetry_mysql.sql;
mysql> show tables;
mysql> exit
At this point your advanced speedtest server should be working. You should be able to access it at http://localhost/ locally or http://servername/ remotely. You can view the stats page by logging in with password "pass123" to http://localhost/results/stats.php locally or http://servername/results/stats.php remotely.