• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


apache server tutorial (install,config, performance tuning, security, error handling)

apache server tutorial (install,config, performance tuning, security, error handling).

 

apache performance tuning mpm-worker vs prefork vs event modules

apache modules list (explained, enable disable)

apache2 conf sample explained apache configuration file modules etc

Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4

red hat family CentOS,fedora, reshat (yum repository)

Debian & ubuntu apt or apt-get( repository)

Installation

sudo apt-get install apache2

apt install php-mod

Configuration

/etc/apache2/apache.conf

Virtual hosts

To map domains to directory

<VirtualHost *:80>
  ServerName domain.com
  DocumentRoot /var/www/
 # ErrorLog /var/log/apache2/error.log
  #CustomLog /var/log/apache2/access.log combined
</VirtualHost>

SSL

<VirtualHost *:443>
ServerName newdomain.com

DocumentRoot /var/www/
#ErrorLog /var/log/apache2/error.log
#CustomLog /var/log/apache2/access.log combined

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
</VirtualHost>

Apache modules

Dynamic modules

Check enabled modules
to enable
a2endmod (module name)
to disable
sudo a2dismod module name mod_rewrite

Or edit

vi /etc/httpd/conf/httpd.conf#LoadModule auth_digest_module modules/mod_auth_digest.so
comment or remove the load module.
You can sell list of installed modules.
Modules in directory.
Modules nothing but additional features to core apache server. Just like apps in android.
apache2 -M | grep “php7_module”
grep used to search
httpd vs apache2
httpd is apache version 1,while apache2 is the latest version apache2.4 or 2.6.

strengthening apache server security

Hiding apache version info
nano /etc/apache2/apache.conf
ServerSignature Off
ServerTokens Prod
service apache2 reload
or
service apache2 restart

Iptables friendly interference ufw.
block ports.

Once you commented the module, save
Security strengthening
Mod-evasis
avoids boot force attack by rate limiting

apache Mod_security

Disable directory listing in apache

Options -Indexes

Limit request size

LimitRequestBody 512000

Maximum upload size.

Virtual host sample format

Don’t include error log for every website.
Because files gets increase the size.
so log rotation feature for every directory.
Just check universal apache error log by command line or sftp client or cpanel whm.

Note: cpanel only works with apache not with nginx.

Gui based softwares for Apache server
cPanel, Plesk, ISPConfig, Ajenti, Kloxo, Open Panel,
Zpanel etc

Know more on apache modules
apache server security
apache performance tuning
apache configuration file.
apache server errors
installation in various os.
niginx vs apache

 

Installing lamp stack

 

Linux , apache, MySQL, php.

sudo apt-get update

sudo apt-get install apache2

sudo apt-get install mysql-server

sudo apt-get install php libapache2-mod-php php-mysql

Check apache server running or not by this command.

sudo service apache2 status

 

sudo apt-get install apache2
service apache2 status
service nginx stop && service apache2 start
sudo systemctl disable nginx
service nginx status
sudo service apache2 reload
apache 2.4 enable mod_rewrite
/etc/httpd/conf/httpd.conf AllowOverride All

02. Introduction To Apache
**************************
Apache in a Nutshell 1:57
History of Apache 1:42
Features 2:43
Integration 2:12

03. Installing Apache on Linux
******************************
Installing Apache on Linux 2:39
Installing Apache from RPMs 1:42
Installing Apache from Source 2:44
Demo: Installing on Linux 1:54

04. Installing Apache on Windows
********************************
Installation 3:45
Configuration Methods on Windows 2:16
Basic Apache Adminstration on Windows 2:29
Demon: Installing on Windows 4:53

05. Configuring Apache on Linux
*******************************
Configuration Files 4:23
Configuring Apache at the Command Line 2:20
Configuring Apache With the GUI 1:39
Configuring Apache With Webmin 2:49
Apache Modules 2:19
Demo: Configuring Apache Web Server 2:08

06. Managing Content on Apache Server
*************************************
Virtual Hosting 3:06
Content Publishing 1:26
Proxying with Apache 2:35
Caching 1:45
Demo: Managing Content on Apache 2:13

07. Configuring MySQL on Apache
*******************************
Intro to MySQL 3:19
Installing MySQL 2:04
Configuring MySQL 2:18
Securing MySQL 2:35

08. Configuring PHP on Apache
*****************************
Intro to PHP 1:53
Installing PHP 2:29
Configuring PHP 3:06
PHP Security 2:16
Demo: Configuring PHP on Apache 2:50

09. Apache Web Server Admin
***************************
Remote Administration 3:57
Performance Monitoring 2:08
Authentication 1:49
Logging 1:17
Demo: Remote Administration of Apache 4:20

10. Security Testing Apache
***************************
Introduction To Penetration Testing 2:31
Pen Testing Platforms & Tools 2:24
Testing Web Servers 3:54
Testing Web Applications 2:49
Testing Databases 3:26

11. Securing Apache
*******************
Securing the Server 4:14
Securing the OS 4:06
Securing Apache Web Server 2:47
Securing Apache Applications 4:20
Securing the Network 2:39

12. Best Practices to Running Apache
************************************
Installation & Configuration 1:55
Administration 1:17
Security 3:52

to check all enabled modules in apache

apachectl -M
hhh# apachectl -M
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)

apachectl -M | sort

or
ls /etc/apache2/mods-available/
Addthis apache virtual host file
<Directory /var/www/mysite>
  Options Indexes FollowSymLinks
  Require all granted
  AllowOverride All
</Directory>
a2enmod rewrite
a2endmod php5
sudo apt-get install libapache2-mod-php5
service apache2 restart
a2enmod rewrite
Module rewrite already enabled
Enable caching on apache server
a2enmod expires
Enabling module expires.
To activate the new configuration, you need to run:
  service apache2 restart
/etc/apache2/sites-available/default
add it to htaccess or vhosts or document root of apache server ( <Directory “/var/www/html”> and </Directory>
[root directory]
<IfModule mod_expires.c>
  <FilesMatch “\.(jpe?g|png|gif|js|css)$”>
  ExpiresActive On
  ExpiresDefault “access plus 1 week”
  </FilesMatch>
</IfModule>
[root directory]

Expires_module and mod_headers module

setup expire headers on Apache
htaccess
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault “access plus 30 seconds”
ExpiresByType text/html “access plus 15 days”
ExpiresByType image/gif “access plus 1 months”
ExpiresByType image/jpg “access plus 1 months”
ExpiresByType image/jpeg “access plus 1 months”
ExpiresByType image/png “access plus 1 months”
ExpiresByType text/js “access plus 1 months”
ExpiresByType text/javascript “access plus 1 months”
</IfModule>
or
Browser caching
## BEGIN BROWSER CACHING ##
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/javascript “access 1 month”
ExpiresByType application/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 2 days”
## END BROWSER CACHING ##
<IfModule mod_expires.c> ExpiresActive on ExpiresDefault “access plus 1 month” # CSS ExpiresByType text/css “access plus 1 year” # Data interchange ExpiresByType application/json “access plus 0 seconds” ExpiresByType application/ld json “access plus 0 seconds” ExpiresByType application/xml “access plus 0 seconds” ExpiresByType text/xml “access plus 0 seconds” # Favicon (cannot be renamed!) and cursor images ExpiresByType image/x-icon “access plus 1 week” # HTML components (HTCs) ExpiresByType text/x-component “access plus 1 month” # HTML ExpiresByType text/html “access plus 0 seconds” # JavaScript ExpiresByType application/javascript “access plus 1 year” # Manifest files ExpiresByType application/x-web-app-manifest json “access plus 0 seconds” ExpiresByType text/cache-manifest “access plus 0 seconds” # Media ExpiresByType audio/ogg “access plus 1 month” ExpiresByType image/gif “access plus 1 month” ExpiresByType image/jpeg “access plus 1 month” ExpiresByType image/png “access plus 1 month” ExpiresByType video/mp4 “access plus 1 month” ExpiresByType video/ogg “access plus 1 month” ExpiresByType video/webm “access plus 1 month” # Web feeds ExpiresByType application/atom xml “access plus 1 hour” ExpiresByType application/rss xml “access plus 1 hour” </IfModule>

Cache Control Headers in apache

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
  <filesMatch “\.(ico|jpe?g|png|gif|swf)$”>
  Header set Cache-Control “public”
  </filesMatch>
  <filesMatch “\.(css)$”>
  Header set Cache-Control “public”
  </filesMatch>
  <filesMatch “\.(js)$”>
  Header set Cache-Control “private”
  </filesMatch>
  <filesMatch “\.(x?html?|php)$”>
  Header set Cache-Control “private, must-revalidate”
  </filesMatch>
</ifModule>
# END Cache-Control Headers
<ifModule mod_headers.c> Header unset Last-Modified </ifModule>
<ifModule mod_headers.c> Header unset ETag </ifModule>FileETag None

#Gzip in enable in apache

<ifModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf AddOutputFilterByType DEFLATE font/truetype font/opentype </ifModule>
a2enmod deflate
compress Gzip enable on apache
/etc/apache2/mods-available/deflate.conf
by default it eables
vhost enable
#enable the vhost
sudo a2ensite vogella.conf
#disable the vhost
sudo a2dissite www.vogella.com
Leverage browser caching
<IfModule mod_expires.c>

loggin size

/etc/logrotate.conf
Normally, in the vhost entry for the site, you will have something like:
CustomLog /var/log/apache2/access-example.com.log combined
Now we replace it with this:
SetEnvIf Request_URI “\.(jpg|xml|png|gif|ico|js|css|swf|js?.|css?.)$” DontLog
CustomLog /var/log/apache2/access-example.com.log combined Env=!DontLog
For example, on a site that used to get around 2 million page views per day, the log size had 133,910,121 entries for only one week, and consumed over 38 gigabytes!
The access log file typically grows 1 MB or more per 10,000 requests.
delete or moving cannot possible while server running
split-logfile
https://httpd.apache.org/docs/2.4/programs/rotatelogs.html

 

Related topics:

  1. apache performance tuning mpm-worker vs prefork vs event modules
  2. Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
  3. nginx server tutorials (installation, configuration, performance tuning, security)
  4. enable caching in apache server (mod cache disk cache) vs fastcgi cache
  5. Apache vs nginx (connection handling, modules, memory usage)

tutorials

  • Vivek Bindra Videos Transcription (business strategy)
  • git commands
  • new relic php agent install in 3 steps
  • new relic mysql install integration - 2 ways fix problems
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)
    • what is If-Modified-Since HTTP header how to add to Wordpress website
    • htaccess tutorial tips for wordpress #redirect #leverage browser cache #Gzip #KeepAlive
    • apache modules list (explained, enable disable)
    • connect to server by SSH client Putty SFTP client winscp LAMP, LEMP nginx apache etc linux
    • Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
    • apache performance tuning mpm-worker vs prefork vs event modules
    • enable caching in apache server (mod cache disk cache) vs fastcgi cache
    • how to enable KeepAlive connections in apache nginx wordpress
    • Cache control Header & expires headers How to set Properly
    • apache2 conf sample explained apache configuration file modules etc
    • restart apache in ubuntu (start | stop | reload | config test) centos debian mac linux windows 10 xampp
    • uninstall apache2 ubuntu in 3 steps Debian

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy