![how to download apache web server stable on centos 7 how to download apache web server stable on centos 7](https://www.how2shout.com/wp-content/uploads/2019/09/command-to-install-apache-on-Centos-8.jpg)
Insert a # at the beginning of the following lines to disable the modules: #LoadModule info_module modules/mod_info.so You can disable this modules by editing the nf file: sudo nano /etc/httpd//nf You can list all enabled modules on your server using the following command: sudo grep LoadModule /etc/httpd//nfįrom the enabled modules in nf file, some modules like mod_info, mod_userdir, mod_autoindex are enabled but not needed. It is a good policy to disable any unnecessary modules that are not in use. You will get a “Forbidden” error as shown in the image below.īy default Apache comes with lots of unnecessary installed modules. Next, try to visit your website in a browser. Save the file and restart Apache service to reflect these changes. sudo nano /etc/httpd/conf/nfįind the section that begins with Directory /var/www/html and add -Indexes in the Options directive: You can turn off this setting by using the Options directive in the Apache configuration file for a specific web directory. Here is an example of the directory listing of your Apache web root directory: If this is enabled, then a hacker can easily view any file, analyze it, and obtain sensitive information about an application of your Apache server. Directory listing displays all the files from the Apache web root directory. Check the HTTP response headers in Firebug, You can see that setting ServerSignature to Off has removed the version information from Server.ĭirectory listing in the absence of an index file is enabled by default in Apache.
![how to download apache web server stable on centos 7 how to download apache web server stable on centos 7](https://i.imgur.com/gP7iUsZ.png)
Now, open Firefox and access your web server. Save the file and restart the Apache service to reflect these changes: sudo apachectl restart You can do this by editing the nf file: sudo nano /etc/httpd/conf/nfĪdd the following line at the end of file: ServerSignature Off To hide this information from browsers, you will need to make some changes in Apache’s main configuration file. If you check the HTTP response headers in Firebug, it will show the Apache version along with your operating system name and version, as shown in this screenshot: Activate Firebug by clicking the Firebug icon on the top right side. Firefox browser with the Firebug add-on installed (for testing).
![how to download apache web server stable on centos 7 how to download apache web server stable on centos 7](https://res.cloudinary.com/practicaldev/image/fetch/s--oG4wsMeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0o435nq0fziqdkz26wt.png)
In this article, I will explain some tips and tricks that will secure your Apache server. It is also one of the most secure web servers available. Now start the Apache server and also enable them to autostart on system boot.įor CentOS/RHEL 7 and Fedora sudo systemctl start rviceĪs a result of this tutorial, you have successfully configured a web hosting environment on your Red Hat-based system.Apache is one of the most widely-used and popular web servers.
#HOW TO DOWNLOAD APACHE WEB SERVER STABLE ON CENTOS 7 INSTALL#
You may install any other modules with the same command.įor CentOS and RHEL 7/6 sudo yum -enablerepo=remi,remi-php71 install php-cli php-pear php-pdo php-mysqlnd php-gd php-mbstring php-mcrypt php-xmlįor Fedora 31/30/29/28/27/26 sudo dnf -enablerepo=remi install php-cli php-pear php-pdo php-mysqlnd php-gd php-mbstring php-mcrypt php-xmlĪt this point, your system has installed the Apache web server, PHP, and modules. The below command will install some frequently used PHP modules on your system. You also required installing PHP modules required for your application. This will install the latest available packages on your system.įor CentOS and RHEL 7/6 sudo yum -enablerepo=remi,remi-php71 install httpd php php-commonįor Fedora 31/30/29/28/27/26 sudo dnf -enablerepo=remi install httpd php php-common Now install the Apache and PHP packages on your system. On CentOS/RHEL 7 rpm -Uvh Īfter enabling the required yum repositories on your system. Use one of the below commands as per your operating systems.