Forum Moderators: phranque

Message Too Old, No Replies

Trouble with htaccess and a VPS

Can you put htaccess commands in the httpd.conf file?

         

cmendla

7:10 pm on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello

I have a reseller account that runs on apache. You can set up VPS (Virtual Private Server) Accounts and then have a number of domains running on each VPS.

I set up a new domain under one of the VPSs as an add on domain. The problem I am having is that when I tried to install either Joomla or Drupal in the root and activate the htaccess file, I get a 500 Server Error. I don't think it is safe to run either Joomla or Drupal without having a properly configured htaccess.

I tried a couple of variations of the httpd and htaccess files. Whenever I try to enable the rewrite engine or follow symlinks in the htaccess (at the root of my add on domain), I get a 500 server error.

the httpd.conf info for the add on domains looks like

Here is the part of the httpd conf file where my virtual host is located with #*$! being subsituted for my domain name.


<VirtualHost *:80>
ServerName #*$!.com
ServerAlias www.#*$!.com
DocumentRoot /var/www/#*$!
RewriteEngine On
RewriteOptions Inherit
# <Directory “/var/www/#*$!”>
# Options FollowSymLinks MultiViews Includes
# AllowOverride All
# Order allow,deny
# Allow from all
# </Directory>

</VirtualHost>
<VirtualHost *:80>
ServerName www.#*$!.com
ServerAlias www.www.#*$!.com
DocumentRoot /var/www/#*$!
RewriteEngine On
RewriteOptions Inherit
</VirtualHost>

Here are the errors showing up in the error log


[Mon May 04 08:46:47 2009] [alert] [client 72.92.87.xx] /var/www/#*$!/.htaccess: Options not allowed here
[Mon May 04 08:49:35 2009] [alert] [client 72.92.87.xx] /var/www/#*$!/.htaccess: Options not allowed here

Here is the htaccess file that comes with joomla. I have commented everything out right now in order to be able to play with the site. However, I believe that I really need to do some of the rewrites in the file.

<snip>

Would it work and, if so, would it be OK to try to put the rewrite info in the httpd.conf file under the virtual host?

I'd really appreciate any thoughts on this.

thanks

CG

EDIT - just x'd out the last node of my ip in the error although it really doesn't matter because I'm on a dynamic IP

[edited by: jdMorgan at 11:15 pm (utc) on May 4, 2009]
[edit reason] Do not post Copyrighted materials, please. [/edit]

g1smd

9:08 pm on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Check the Apache manual. It lists where each directive can be used.

Some can only be used in http.conf, others in just .htaccess, many in both.

There is a change of syntax, depending on where used, for some directives (especially Mod_Rewrite).

.

I don't think this will work, and in any case it looks like a very bad idea:

# Send all blocked request to homepage with 403 Forbidden error! 
# RewriteRule ^(.*)$ index.php [F,L]

[L] is also redundant when used with [F].

jdMorgan

11:16 pm on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the Options directive is not allowed, the likely reason is that you have not set up your AllowOverride directive properly. See AllowOverride in Apache core documentation.

Jim