Posts

Showing posts with the label Apache

Install Nginx on CentOS 7

Install Nginx on CentOS 7 Table of Contents Introduction Requirements Install Nginx Start Nginx Introduction Nginx is a popular light-weight and high performance web server and commonly used as a proxy. It is quite flexible and a good alternative to Apache. Requirements CentOS 7 or Red Hat Enterprise Linux 7 Local Linux and ProfitBricks firewall ports need to be opened for external requests Install Nginx Many distributions include Nginx as part of the default distribution repository. However, this version can become outdated and it is recommended installing from a repository containing the latest version. One common repository added to CentOS and Red Hat Enterprise Linux (RHEL) servers is the Extra Packages for Enterprise Linux (EPEL). The following command will add the EPEL repository to CentOS 7 or RHEL 7. sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm Optionally, the Nginx project also maintains a repository c...

How to Set Up Name-Based Virtual Hosting (Vhosts) With Apache Web Server on CentOS 7

Image
How to Set Up Name-Based Virtual Hosting (Vhosts) With Apache Web Server on CentOS 7 Table of Contents Introduction Requirements Create the directory structure Create test web pages for each virtual host Set up ownership and permissions Create virtual host configuration files Test the virtual hosts Introduction The Apache web server is the most popular web server all over the world. Virtual hosting is a method for hosting multiple websites (domains) on a single server. You can host multiple websites on a single machine with a single IP using virtual hosting. All domains on that server will be sharing a single IP. Virtual hosting is very useful in shared web hosting environments, where hundreds of websites are hosted on a single dedicated server. In this article we will be hosting two websites (www.vhost1.com and www.vhost2.com) on a single IP address (192.0.2.0). Requirements A server running CentOS v. 7 with Apache installed A desktop machine running Linux A...

How to Set Up IP and Port-Based Virtual Hosting (Vhosts) With Apache Web Server on CentOS 7

Image
How to Set Up IP and Port-Based Virtual Hosting (Vhosts) With Apache Web Server on CentOS 7 Table of Contents Introduction Requirements Set up multiple IP addresses on a single network interface Set up multiple instances of Apache Create the directory structure Create test web pages for each virtual host Set up ownership and permissions Create virtual host files Allow Apache through the firewall Test the virtual hosts Introduction Virtual hosting is a method for hosting multiple websites on a single machine. There are two types of virtual hosting:  Name-based virtual hosting  and  IP-based virtual hosting . IP-based virtual hosting is a technique to apply different directives based on the IP address and port a request is received on. You can assign a separate IP for each website on a single server using IP-based virtual hosting. This is mainly used to host different websites on different ports or IP addresses. In this article we will be creating: ...

Set up Basic Authentication in Apache Using .htaccess On CentOS 7

Image
Set up Basic Authentication in Apache Using .htaccess On CentOS 7 Introduction Apache is one of the most widely-used and popular web servers in the world. Configuring your websites with password authentication can prevent unauthorized users from accessing your website without the correct user ID and password. This tutorial explains an easy way to password protect a web directory in Apache using .htaccess. Requirements A server running CentOS v. 7 with Apache installed Static IP address or URL for your website Configure Apache to allow .htaccess authentication By default Apache does not allow the use of  .htaccess  files in CentOS 7. You will need to set up Apache to allow  .htaccess  based authentication. You can do this by editing the Apache config file: sudo nano /etc/httpd/conf/httpd.conf Find the section that begins with  <Directory "/var/www/html"> . Change the line from  AllowOverride none  to  AllowOverride Au...