<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.define-technology.com/mediawiki-1.35.0/index.php?action=history&amp;feed=atom&amp;title=Redhat%3A_Apache_webserver_Directories</id>
	<title>Redhat: Apache webserver Directories - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?action=history&amp;feed=atom&amp;title=Redhat%3A_Apache_webserver_Directories"/>
	<link rel="alternate" type="text/html" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Redhat:_Apache_webserver_Directories&amp;action=history"/>
	<updated>2026-05-04T17:25:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Redhat:_Apache_webserver_Directories&amp;diff=3280&amp;oldid=prev</id>
		<title>Michael: Created page with &quot;==  .htaccess files ==   the .htaccess file can be used to simplity the options in the httpd.conf file.  This is becuase it can be used to override inherited permissions for v...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Redhat:_Apache_webserver_Directories&amp;diff=3280&amp;oldid=prev"/>
		<updated>2013-08-25T10:01:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==  .htaccess files ==   the .htaccess file can be used to simplity the options in the httpd.conf file.  This is becuase it can be used to override inherited permissions for v...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  .htaccess files ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the .htaccess file can be used to simplity the options in the httpd.conf file.  This is becuase it can be used to override inherited permissions for virtual hosts and directories.&lt;br /&gt;
&lt;br /&gt;
To do so an option must be added to the the directory or virtual host container:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;directory&amp;gt;&lt;br /&gt;
AllowOverride Options&lt;br /&gt;
&amp;lt;/directory&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A .htaccess file can now be used to override inherited options by storing it in any web directory with the httpd_config_t SELinux context.&lt;br /&gt;
&lt;br /&gt;
== Password Protected Access ==&lt;br /&gt;
&lt;br /&gt;
To add password access to website, a seperate database of usernames and passwords must be created.  Apache provides commands to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
htpasswd -c /etc/httpd/webpass engineer1 #creates a file and adds user engineer1&lt;br /&gt;
htpasswd /etc/httpd/webpass engineer2  #adds engineer2 to the same file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Home Directory Access ==&lt;br /&gt;
&lt;br /&gt;
The default httpd.conf file contains some options to enable home directory access. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
UserDir disabed&lt;br /&gt;
#UserDir public_html&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enabling this will give user access to weboages in their ~/public_html directory.  But this is a security issue as as the users entire home directory would need to be give 701 permissions - in other words executable for everyone. This would allow a cracker to execute any script he finds as any logged in user. &lt;br /&gt;
&lt;br /&gt;
There is an alternative: use ACLs.  If the filesystem has been mounted with ACL permissions then access can be given to the apache user using the setfacl command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
setfacl -m U:apache:x /home/michael&lt;br /&gt;
setfacl -m U:apache:x /home/michael/public_html&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing that must be done is to enable the httpd_enable_homedirs boolean in SELlinux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
setsebool -P httpd_enable_homedirs  1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Group Managed Directories ==&lt;/div&gt;</summary>
		<author><name>Michael</name></author>
	</entry>
</feed>