Webmain - enabling htaccess

3 posts / 0 new
Last post
#1 Sun, 11/12/2006 - 11:06

Webmain - enabling htaccess

Hello. I'm new to webmin and need to enable htaccess. I've built a new site and can't go live until I've done this, but I have no idea what to do except that I have put somthing (?) into httptd.conf

Can some one please help a guy out here?



Sun, 06/07/2009 - 07:00
Joe's picture

Hey John,

I'll first point out that .htaccess files are already enabled by default--but they are very limited. Only password protection, and maybe a couple of indexing options are available by default (for security reasons--it's harder for users to do something stupid, like expose their private data, if they can't use all htaccess directives).

But, if you need most or all of the capabilities, then you'll need to configure it.

You've got a few options for how to handle this.

To make the change for just one domain, you can browse to the Apache Webserver module and click on the domain in question in the Virtual Servers list.

Then within that Virtual Server, click on the folder you want to increase the capabilities of the .htaccess file (public_html is almost certainly the one you want, and it is the only document directory configured by default in Virtualmin).

Then click the Document Options icon.

Finally, locate the option labeled "Options file can override..", click the "Selected below..." option and then check all of the boxes for the options.

Save it, and apply your changes on the Apache main page.

All done!

Now, if you want this to be the default for all of your domains in the future you'll use Server Templates to configure the Apache directives (you'll have to modify existing domains manually using the process listed above or editing the httpd.conf in your favorite text editor), as Server Templates only apply to newly created domains.

To modify your Server Templates to always allow all Options in the .htaccess file, open up System Settings:Server Templates from the Virtualmin menu. Click on the Server Template you'd like this change to apply to (Default, or one you've created from scratch).

Then, in the Apache website section, find the option labeled "Directives and settings for new websites". This is a big free text field, with a bunch of directives already in it.

Find the "Options ..." directive in the <Directory ${HOME}/public_html> section and just below it add a line like this:

<i>AllowOverride All</i>

So that Directory section will then look like:

&lt;Directory ${HOME}/public_html&gt;
Options Indexes IncludesNOEXEC FollowSymLinks
AllowOverride All
allow from all

Save it.

All done. Now, all future domains will have the ability to override all options in the .htaccess.

If you've got more than a couple of domains that already exist that you want to do this for, you might find doing it in a text editor faster than using Webmin (though possibly more error-prone, if you aren't careful).

To do that, simply open up the file where you store your virtual hosts (probably /etc/httpd/conf/httpd.conf, but it depends on the OS), and find the public_html directory of each of your domains and add the AllowOverride All line after each Options ... line. With a reasonably powerful editor, you could simply do a search replace and be done in a minute or so.


Check out the forum guidelines!

Sun, 11/12/2006 - 16:03

Awesome Joe, I can now put up my site :D

Thank you so much.


Topic locked