Load Times Under 2s: MySQL, Apache, PHP7 & Composer
May 6, 2018 | By David Selden-Treiman | Filed in: hosting.Installing MySQL
Next we need to install MySQL. This will be our database of choice however you can easily use any database that you’re looking for. Use the latest “Red Hat” repository mentioned here: https://dev.mysql.com/downloads/repo/yum/. Click “Download”, then use the link “No thanks, just start my download”. Replace the wget and rpm lines with the link you selected here.
You should see “Active: active (running)” in the output if everything was successful. To secure your MySQL installation, run the following command.
Follow the instructions and set a root password, remove root accounts that are accessible from outside the local host, remove anonymous-user accounts, and remove the test database and privileges that permit anyone to access databases with names that start with test_. When you create your root password, I recommend keeping it to only numbers and letters (uppercase and lowercase, no symbols). This will make it easier to use the password later in shell commands. If you run into any issues, please read the second note below.
Keep the root MySQL password somewhere; we will need it later on.
Note: Your MySQL installation should have either a blank password (e.g. no value) or a temporary password. To find the temporary password, use:
Note: if you can’t log in when if it asks for your root password (either because you set the password, or you just can’t log in), add “skip-grant-tables” to the [mysqld] section of /etc/my.cnf , run systemctl restart mysqld; and log in again. Run: mysql -uroot -e “FLUSH PRIVILEGES;”;mysql -uroot -e “ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘[[Root MySQL Password]]’;”; When you’re done, edit the /etc/my.cnf file again (nano /etc/my.cnf), remove the “skip-grant-tables”, and restart the MySQL server again (systemctl restart mysqld).
Another Note: I recommend that you decrease the password validation policy to “LOW”. The reason for this is that it’s advantageous to have a password without any special characters, since entering them in the command line directly can prove difficult. Open the my.cnf file
… and add the following line in the “[mysqld]” section
Finally, restart your mysql service.
Install Apache
Now we need to install Apache.
And if you have SELinux, we will need to add another setting allowing Nginx to connect to Apache
At this point, if you go to http://[[your IP address]] you should see the Apache test page.
Installing PHP
To install PHP, run the following command. Feel free to upgrade the “71w” to the latest version of PHP that provides all of the packages that you’re looking for.
In my case, I needed to link the inotify .so file to the PHP modules folder. If you install other PHP packages, you may need to do the same with those as well.
Installing Composer
Composer is great for PHP package management. To install it and enable it, just run:
Automatic Installation?
If you like the result of the tutorial, but run into problems or would just like to have the work done automatically, we can help you with that. We have an automated script that can SSH into your server and run this tutorial from beginning to end (as long as it’s running CentOS 7). If you would like this done for you ($100), please contact us using the form below.
- Part 1: Introduction and Planning
Why it’s important to have your pages load in under 2 seconds, and a plan of how we will set up and configure the server.
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 2: Installing Software
Initial setup of the server, including installing CentOS7, installing tools, installing SSH and SSL, enabling repositories, and installing support packages.
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 3: MySQL, Apache, PHP7, & Composer
Installation of MySQL database server, Apache web server, PHP, and Composer package manager for PHP
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 4: PHPMyAdmin & Redis
How to download, install, and configure PHPMyAdmin; How to install and configure Redis
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 5: SSL Certificate & Apache Configuration
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 6: FTP & DNS
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 7: Installing Nginx
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 8: Configuring Nginx
How to set up Nginx configuration files including (with explanations): nginx.conf, Gzip compression settings, visitor browser caching settings, SSL settings, reverse proxy settings for sending data to the Apache server, reverse proxy connection configurations, file access restrictions, and WordPress configuration settings
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 9: Adding a WordPress Website
How to add a WordPress website to the server including configuring the DNS Server, adding a verified SSL certificate, either manually or for free using Let’s Encrypt, setting up FTP for your site, configuring Apache, configuring Nginx, uploading your WordPress site files, and importing your MySQL database.
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
- Part 10: WordPress Website Speed Improvements
Speeding up your WordPress installation using a Redis plugin and a caching plugin.
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
David Selden-Treiman is Director of Operations and a project manager at Potent Pages. He specializes in custom web crawler development, website optimization, server management, web application development, and custom programming. Working at Potent Pages since 2012 and programming since 2003, David has extensive expertise solving problems using programming for dozens of clients. He also has extensive experience managing and optimizing servers, managing dozens of servers for both Potent Pages and other clients.
Comments are closed here.