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

From Notes_Wiki
(Created page with "<yambe:breadcrumb>CentOS_7.x|CentOS 7.x</yambe:breadcrumb> =CentOS 7.x apache configuration= ==Allow access to a particular directory== To allow access to directory via apac...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb>CentOS_7.x|CentOS 7.x</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x Web servers|Web servers]] > [[CentOS 7.x apache configuration]]
=CentOS 7.x apache configuration=


==Allow access to a particular directory==
==Allow access to a particular directory==
Line 6: Line 5:
To allow access to directory via apache use:
To allow access to directory via apache use:
<pre>
<pre>
   <Directory "/home/saurabh/Desktop/workspace/sunil-n-sanjay-site">
   <Directory "/home/saurabh/Desktop/workspace/company-site">
         Options all
         Options all
         AllowOverride all
         AllowOverride all
         Require all granted
         Require all granted
   </Directory>
   </Directory>
   Alias /sanjay /home/saurabh/Desktop/workspace/sunil-n-sanjay-site
   Alias /sanjay /home/saurabh/Desktop/workspace/company-site
</pre>
</pre>
Note:
Note:
Line 19: Line 18:
To allow only a few IPs and not everyone use:
To allow only a few IPs and not everyone use:
<pre>
<pre>
   <Directory "/home/saurabh/Desktop/workspace/sunil-n-sanjay-site">
   <Directory "/home/saurabh/Desktop/workspace/company-site">
         Options all
         Options all
         AllowOverride all
         AllowOverride all
Line 25: Line 24:
         Require ip 2.2.2.2.
         Require ip 2.2.2.2.
   </Directory>
   </Directory>
   Alias /sanjay /home/saurabh/Desktop/workspace/sunil-n-sanjay-site
   Alias /sanjay /home/saurabh/Desktop/workspace/company-site
</pre>
</pre>






<yambe:breadcrumb>CentOS_7.x|CentOS 7.x</yambe:breadcrumb>
 
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x Web servers|Web servers]] > [[CentOS 7.x apache configuration]]

Latest revision as of 15:45, 28 August 2022

Home > CentOS > CentOS 7.x > Web servers > 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



Home > CentOS > CentOS 7.x > Web servers > CentOS 7.x apache configuration