Web server

Centos 7.3 How to install Apache 2.4, PHP 7.1 and MySQL (MariaDB)

Enable Network

Display network status

# nmcli d

Start network manager

# nmtui

Edit the connection to Automatically connect

Make GUI Default

Centos 7

# yum group install "GNOME Desktop" "Graphical Administration Tools"

RHEL 7

# yum groupinstall "Server with GUI"

Run the following to make the GUI start on reboot

# ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

Start SSH service

# systemctl restart sshd.service

# firewall-cmd --add-port=22/tcp --permanent

#  firewall-cmd --reload

Speed up web site

What is Google Page Speed?

Page Speed is an open-source Firefox/Firebug Add-on. Webmasters and web developers can use Page Speed to evaluate the performance of their web pages and to get suggestions on how to improve them.

How To Optimize Your Site With GZIP Compression

Compression is a simple, effective way to save bandwidth and speed up your site. I hesitated when recommending gzip compression when speeding up your javascript because of problems in older browsers.

Subject

NSS_Initialize failed when starting Apache httpd

I got the following error in /var/log/httpd/error_log when trying to start httpd on Fedora11 64 bit:

NSS_Initialize failed. Certificate database: /etc/httpd/alias.
SSL Library Error: -8038 SEC_ERROR_NOT_INITIALIZED

Which led me to discover the file /etc/httpd/install.log

############################################
Generating new server certificate and key database.
############################################
/usr/sbin/gencert: line 91: /usr/bin/certutil: No such file

I found I needed to install certutil by typing

yum install nss-tools*

Then I ran

/usr/sbin/gencert /etc/httpd/alias

Next I tried starting httpd again and it worked.

Update: when I checked the /var/log/httpd/error_log however I found I was still getting errors like the following:

[error] NSS_Initialize failed. Certificate database: /etc/httpd/alias.
[error] SSL Library Error: -8038 SEC_ERROR_NOT_INITIALIZED

So I found this page of instructions and tried it

Subject

Varnish commands

Setting up Varnish

Varnish has a set of command line tools and utilities to monitor and administer Varnish. These are:

  • varnishncsa: Displays the varnishd shared memory logs in Apache / NCSA combined log format
  • varnishlog: Reads and presents varnishd shared memory logs.
  • varnishstat: Displays statistics from a running varnishd instance.
  • varnishadm: Sends a command to the running varnishd instance.
  • varnishhist: Reads varnishd shared memory logs and presents a continuously updated histogram showing the distribution of the last N requests by their processing.
  • varnishtop: Reads varnishd shared memory logs and presents a continuously updated list of the most commonly occurring log entries.
  • varnishreplay: Parses varnish logs and attempts to reproduce the traffic.

For further information and example of usage, please refer to the man-pages.

varnishtop

This command shows the most often-made requests to the backend:

Subject