• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How to Optimize Dedicated Server for WordPress Site

By Abhishek Ghosh April 13, 2023 7:46 pm Updated on April 13, 2023

How to Optimize Dedicated Server for WordPress Site

Advertisement

Usually with a budget of 70 to 150 USD per month, you’ll get a decent dedicated server to host a WordPress site with medium traffic. We are discussing unmanaged budget dedicated servers from any reputed web host. With proper optimization of the backend, the server can reliably run without 24×7 monitoring.

You must take regular backups and probably keeping a cheap OpenVZ server as live standby is a good idea since quickly changing the DNS will keep the website online. VPSDime is a good OpenVZ server provider for staging, testing etc. It is a costly option but less costly than adding a managed layer.

 

What Server Software/Packages We Need

 

We will need:

Advertisement

---

  1. Latest Apache2 web server with some modules
  2. PHP with some module
  3. Latest MariaDB
  4. IPTables
  5. Fail2Ban
  6. PageSpeed module
  7. APCu

and some time in hand. We suggest using Apache and PHP from Ondřej’s repository. Avoid installing a lot of server packages on the main server since they will consume resources. Avoid installing a web hosting panel and PHPMyAdmin in case you host a single website or a couple on one server and the server is unmanaged. They will consume resources and will increase security risks.

How to Optimize Dedicated Server for WordPress Site

 

How to Optimize the Server for WordPress

 

Install Apache2:

Vim
1
2
3
sudo apt-get update
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get install apache2

Usually, you’ll need the below Apache modules (running apache2ctl -M command will list the modules):

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
core_module
so_module
watchdog_module
http_module
log_config_module
logio_module
version_module
unixd_module
access_compat_module
alias_module
auth_basic_module
authn_core_module
authn_file_module
authz_core_module
authz_host_module
authz_user_module
autoindex_module
brotli_module
deflate_module
dir_module
env_module
expires_module
filter_module
geoip_module
headers_module
http2_module
mime_module
mpm_prefork_module
negotiation_module
pagespeed_module
php7_module (shared) or php8_module
reqtimeout_module
rewrite_module
setenvif_module
slotmem_shm_module
socache_dbm_module
socache_shmcb_module
ssl_module
status_module
unique_id_module

You need to install PHP to enable some of them. We have a lot of guides on Apache2 on this website (perform a site search with the phrase Apache2). These two guides will help you:

  • Apache2 HTTP/2, HSTS
  • Apache2 IPv6 Virtual Host

The MPM prefork handles one connection at a time without creating separate threads. Running apache2ctl -V command will list the required info. It is good for non-thread-safe modules like mod_php. There are at least two ways of running PHP, one is by using CGI and the second way is to run PHP as an Apache module (mod_php). We have a guide on optimizing MPM prefork. There is a shell script to check the memory used by Apache2:

Vim
1
2
3
wget http://cloudinservice.com/wp-content/uploads/2011/03/ap.sh.zip
unzip ap.sh.zip
sh ap.sh

mpm_prefork cannot be made performant which is the reason people are abandoning it. But for WordPress, it is risky for the plugins to avoid mpm_prefork since it is the PHP code which makes the other modules to safe to use. Even with mpm_prefork, you’ll get PHP warnings from a few plugins. Optimization depends on traffic and plugins.

Next is PHP. Here is our old guide on installation of PHP 7.2. The installation will be similar in all versions of PHP and PHP will not need radical tweaking.

Install and tweak APCu, install iptables and Fail2Ban and Apache PageSpeed.

The final thing is MariaDB. It is a straightforward installation. Here is an example configuration file as GitHub gist.

You can secure the server with FTP software and port knocking. You can install memcached to test the response time. But, APCu will deliver a better result with WP Super Cache.

 

Required WordPress Plugins

 

You’ll need certain plugins to support and control the server software. All of them are free:

  1. APCu Manager
  2. DecaLog
  3. IP Geo Block
  4. MySQL query cache stats
  5. PageSpeed Module
  6. Prevent XSS Vulnerability
  7. WP Super Cache
  8. WP Fail2Ban Redux

Install tuned:

Vim
1
2
3
sudo apt install tuned tuned-utils tuned-utils-systemtap
tuned-adm active
sudo tuned-adm profile throughput-performance

You need to reboot the server. Always remember that any dedicated server takes a long time to reboot than a virtual server. Always check the status of major components after a reboot.

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Optimize Dedicated Server for WordPress Site

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • How To Install APC on PHP 7.2 (Ubuntu LAMP Server)

    APC is an Important Part For WordPress Like Web Software to Speed Up. Here is How To Install, Configure APC on PHP 7.2 on Ubuntu LAMP Server.

  • PHP 8.2 : How to Install the PHP APCu Extension

    Yes, PHP APCu Extension (Version 5.1.22 and newer) works with PHP 8.2. Installing and configuring APC (and APCu) on the Apache server was never just running one command. However, PHP 8 changed many things and installing and configuring APCu become more complex. Our old article on Installing APC on PHP 7.2 shows how we used […]

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy