Difference between revisions of "CentOS 7.x apache configuration"

From Notes_Wiki
m
m
Line 1: Line 1:
<yambe:breadcrumb>CentOS_7.x|CentOS 7.x</yambe:breadcrumb>
<yambe:breadcrumb self="Apache configuration">CentOS_7.x_Web_servers|Web servers</yambe:breadcrumb>
=CentOS 7.x apache configuration=
=CentOS 7.x apache configuration=


Line 30: Line 30:




<yambe:breadcrumb>CentOS_7.x|CentOS 7.x</yambe:breadcrumb>
 
<yambe:breadcrumb self="Apache configuration">CentOS_7.x_Web_servers|Web servers</yambe:breadcrumb>

Revision as of 16:51, 14 March 2019

<yambe:breadcrumb self="Apache configuration">CentOS_7.x_Web_servers|Web servers</yambe:breadcrumb>

CentOS 7.x apache configuration

Allow access to a particular directory

To allow access to directory via apache use:

   <Directory "/home/saurabh/Desktop/workspace/company-site">
        Options all
        AllowOverride all
        Require all granted
   </Directory>
   Alias /sanjay /home/saurabh/Desktop/workspace/company-site

Note:

  • SELinux permission might have to be disabled, if SELinux context on given folders is not set correctly.


To allow only a few IPs and not everyone use:

   <Directory "/home/saurabh/Desktop/workspace/company-site">
        Options all
        AllowOverride all
        Require ip 1.1.1.1
        Require ip 2.2.2.2.
   </Directory>
   Alias /sanjay /home/saurabh/Desktop/workspace/company-site



<yambe:breadcrumb self="Apache configuration">CentOS_7.x_Web_servers|Web servers</yambe:breadcrumb>