• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to Secure Apache Web Server on Linuxmint 18.03

  • 0:31 apt-get install apache2 -y
  • 0:53 systemctl start apache2
  • 1:46 vim /etc/apache2/apache2.conf
  • 4:23 a2ensite test.conf
  • 4:56 vim /etc/apache2/sites-available/test.conf
  • 5:38 vim /etc/apache2/apache2.conf
  • 6:26 systemctl restart apache2.service
5299

Securing Apache Web Server on Linuxmint 18.03

Securing your web server is very important, it means allowing others to see only the intended information & protecting your data and restricting access.

Installation

Install the apache web server

linuxhelp ~ # apt-get install apache2 -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap liblua5.1-0
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  .
.
.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...

Start and enable the apache service

linuxhelp ~ # systemctl start apache2
linuxhelp ~ # systemctl enable apache2
apache2.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable apache2

You can also verify by navigating to the Following URL http://domainname or ip adderss 1

Hiding Apache version and OS information:

Apache displays its version and the name of the operating system along with the error code to outside World so thats one of the security flaw and it must be hidden

Open the default apache configuration file & add the following line

linuxhelp ~ # vim /etc/apache2/apache2.conf 
ServerTokens Prod
ServerSignature Off

Restart the apache service.

linuxhelp ~ # systemctl restart apache2.service

Now access the Browser URL: http://domainname/g or ip address/g 3

Disable Directory Listing

If your document root directory does not have an index file, by default your apache web server will show all the content of the document root directory.

Switch to /var/www location then create some Directory and files

linuxhelp ~ # cd /var/www/
linuxhelp www # mkdir data html
linuxhelp www # touch f1 file

configure the virtual host. create test.conf file on following location.

linuxhelp www # vim /etc/apache2/sites-available/test.conf
<virtualhost *:80>
servername linuxhelp1.com
Documentroot /var/www/
<Directory /var/www/>
Allow from all
</Directory>
</virtualhost>

Enable the site access

linuxhelp www # a2ensite test.conf 
Enabling site test.
To activate the new configuration, you need to run:
service apache2 reload

restart the apache service

linuxhelp www # systemctl restart apache2.service 

Now access the Browser 4

As you see the Directories are listed so open the configuration file, add the following line and save & quit the file

linuxhelp www # vim /etc/apache2/sites-available/test.conf
<virtualhost *:80>
servername linuxhelp1.com
Documentroot /var/www/
<Directory /var/www/>
Allow from all
Options -Indexes
</Directory>
</virtualhost>

restart the apache service

linuxhelp www # systemctl restart apache2.service

Now access the Browser 5

Limiting request size

Apache does not have any restriction on the total size of the http request that could lead to a DoS attack. You can limit the request size of an Apache directive “LimitRequestBody” with the directory tag. The value could be set anything from 0 to 2 GB (i.e. 2147483647 bytes) as per your requirement.

Open the apache default configuration file, here add the following line,

linuxhelp www # vim /etc/apache2/apache2.conf 
   LimitRequestBody 512000

restart the apache service

linuxhelp www # systemctl restart apache2.service 

With this, the method to Secure Apache Web Server on Linuxmint 18.03 comes to an end

Tags:
jacob
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is meant by .htaccess Files on Apache?

A

It is better to forbid the creation of .htaccess files as they are configured in the directory level and can override the security settings.

Q

What is Apache Web server and how it works?

A

Apache Web Server and its overall working in detail. Apache Web Server is an open source software that creates, deploys and manages the overall functioning of the web server. Apache can serve both dynamic as well as static contents.

Q

What is the difference between httpd and Apache?

A

httpd is the same as apache2. It depends on the OS you use. For example, in RHEL 6.2 it is called httpd and in Ubuntu, it is called apache2. The directives used in apache2 and httpd config files are slightly different, as well as the directory structure.

Q

What is the use of Weblogic Server?

A

It manages system-level details so you can concentrate on business logic and presentation. WebLogic Server contains Java 2 Platform, Enterprise Edition (J2EE) technologies. J2EE is the standard platform for developing multitier enterprise applications based on the Java programming language.

Q

What is Web server ?

A

A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their requests, which are forwarded by their computers' HTTP clients. Dedicated computers and appliances may be referred to as Web servers as well.

Related Tutorials in How to Secure Apache Web Server on Linuxmint 18.03

Related Tutorials in How to Secure Apache Web Server on Linuxmint 18.03

How to install Apache from Source Code on CentOS 7
How to install Apache from Source Code on CentOS 7
Oct 21, 2017
How to install WinRAR 5.11 on Linuxmint 18.03
How to install WinRAR 5.11 on Linuxmint 18.03
May 22, 2018
How to Setup VNC Server on Linux Mint 20
How to Setup VNC Server on Linux Mint 20
Dec 22, 2020
How to Completely Remove and Install Apache package on CentOS 7.6
How to Completely Remove and Install Apache package on CentOS 7.6
May 23, 2019
How to install and configure samba setup in Linux mint - 18.3
How to install and configure samba setup in Linux mint - 18.3
Mar 26, 2018
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Sep 19, 2018
How to install apache jmeter on ubuntu 18.04
How to install apache jmeter on ubuntu 18.04
May 19, 2018
How to Install Pligg - Content Management System
How to Install Pligg - Content Management System
Jul 26, 2016

Related Forums in How to Secure Apache Web Server on Linuxmint 18.03

Related Forums in How to Secure Apache Web Server on Linuxmint 18.03

CentOS
connor class=
How To Completely Remove Apache package On CentOS 7.6
May 14, 2019
Apache
isaac class=
How to disable apache welcome page on Ubuntu
Dec 15, 2018
Apache
rebeccajazz class=
Apache2 : mod_proxy in opensuse
Jan 3, 2018
Apache
elijah class=
What is the difference between httpd and apache
Feb 18, 2017
Linux
isaac class=
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/mysql-client-core-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb 404 Not Found
Dec 4, 2020
Mongodb
caden class=
Unrecognized option: security In MongoDB 4.0.11 On CentOS 7.6
Aug 31, 2019
Linux Mint
AlxH class=
Complete beginner, install bluegriffon
Jul 1, 2020
Apache
logan class=
How to install Apache GUI
Feb 24, 2017

Related News in How to Secure Apache Web Server on Linuxmint 18.03

Related News in How to Secure Apache Web Server on Linuxmint 18.03

A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
A Newer and a Faster Window Manager for Tina (Linux Mint 19.2)
Apr 9, 2019
5 Best Secure and Private Web Browsers to Look Our For
5 Best Secure and Private Web Browsers to Look Our For
Nov 24, 2018
Linux Mint 18.2 Ubuntu based Operating System is named Sonya
Linux Mint 18.2 Ubuntu based Operating System is named Sonya
May 2, 2017
Refreshed Linux Mint Debian Edition (LMDE) 2 'Betsy' ISO images now available
Refreshed Linux Mint Debian Edition (LMDE) 2 'Betsy' ISO images now available
Mar 14, 2017
The Best Linux Operating System is in the house: Mint 18.2
The Best Linux Operating System is in the house: Mint 18.2
Aug 12, 2017
Linux Mint 18.1 released with smooth features and offers long-term support
Linux Mint 18.1 released with smooth features and offers long-term support
Apr 11, 2017
RoboCyberWall created to block Linux Server Hacks
RoboCyberWall created to block Linux Server Hacks
Oct 5, 2017
Attackers take advantage of Apache Struts vulnerabilities
Attackers take advantage of Apache Struts vulnerabilities
Mar 17, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Ganesh Konka ?
Zentya 6.1 http proxy configuration

please send link for creating zentyal 6.1 for http proxy and firewall as gateway.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.