PDA

View Full Version : Suse 9.3 And ModReWrite


marketingmaven
17th August 2005, 02:13
Hi everyone,

I am new the the Linux environment, but I have installed ISPConfig, and it has made my life a lot easier with operating my new Linux Box.

I am installing WordPress sites on the box, and one of the options I need is to enable Mod ReWrite.

I have Apache and everything else installed right as per the Suse 9.3 install faq on the ISPConfig site, but I am not sure how to enable it. Do I enable it on the server in httpd.conf or do I do it in ISPConfig for each site with the Apache Directives option (which I dont know how to use either)?

Anyway, everytime I try to invoke anything to do with Mod ReWrite with WordPress, the WordPress site no longer works until I delete .htaccess. Please help. I really am not sure what to do, or how to do it. Thanks in advance.

falko
17th August 2005, 14:43
From the howto:

Edit /etc/sysconfig/apache2 and add rewrite to the APACHE_MODULES line:

APACHE_MODULES="access actions alias auth [...] setenvif ssl suexec userdir php4 php5 rewrite"

[...]

Then run

SuSEconfig
/etc/init.d/apache2 start

Then mod_rewrite is enabled.
You can then define rewrite conditions/rules in an .htaccess file, in the Apache Directives field in ISPConfig or by using the forward mechanism for Co-Domains (forwarding uses rewrite rules).

thevinster
17th August 2005, 17:09
I'm trying to install Wikka, and the .htaccess file reads:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^\./]*[^/])$ $1/
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</IfModule>


This keeps giving me a 403 error. It looks like a common problem, along with the people trying to set up Drupal.

Any suggestions?

falko
17th August 2005, 17:33
I'm trying to install Wikka, and the .htaccess file reads:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^\./]*[^/])$ $1/
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</IfModule>


This keeps giving me a 403 error. It looks like a common problem, along with the people trying to set up Drupal.

Any suggestions?

Have a look at this thread: http://www.howtoforge.com/forums/showthread.php?t=38

marketingmaven
17th August 2005, 17:39
From the howto:



Then mod_rewrite is enabled.
You can then define rewrite conditions/rules in an .htaccess file, in the Apache Directives field in ISPConfig or by using the forward mechanism for Co-Domains (forwarding uses rewrite rules).

Thanks Falko. I guess I did that when setting up ISPConfig, just didnt know how to activate it. So let me see if I understand this. I dont actually upload a .htaccess file to the directory I need it in, I just set the define the rewrite rules in a .htacces file and put that file in the Apache Directives Field? Thanks in advance. :)

Oh, I need the .htaccess in a subfolder of the main site it seems. Do I still put the .htaccess file in the Apache Directives Field? When I upload the .htaccess file directly to the subfolder, the site fails. When I delete it, everything is fine again. Thanks.

thevinster
17th August 2005, 19:05
Have a look at this thread: http://www.howtoforge.com/forums/showthread.php?t=38


Falko,

That is the thread I was referring to in my post. I still don't completely understand how to modify the .htaccess system for these scripts. I am currently having trouble with Helpcenterlive as well.

The .htaccess file reads:

php_value upload_max_filesize 128M
php_value post_max_size 128M
LimitRequestBody 134217728


Only if I delete the .htaccess file is it working.

till
17th August 2005, 19:07
Falko,

That is the thread I was referring to in my post. I still don't completely understand how to modify the .htaccess system for these scripts. I am currently having trouble with Helpcenterlive as well.

The .htaccess file reads:

php_value upload_max_filesize 128M
php_value post_max_size 128M
LimitRequestBody 134217728


Only if I delete the .htaccess file is it working.

Have you tried to put exactly this

php_value upload_max_filesize 128M
php_value post_max_size 128M
LimitRequestBody 134217728

in the apache directives field of the ISPConfig site?

thevinster
17th August 2005, 19:16
Have you tried to put exactly this

php_value upload_max_filesize 128M
php_value post_max_size 128M
LimitRequestBody 134217728

in the apache directives field of the ISPConfig site?

Hi Till,

Yes I have. It works of course. But if I wanted to isolate those instructions to one particular directory, say /home/www/web150/web/seperate_directory, how would I do that?

falko
17th August 2005, 19:36
Hi Till,

Yes I have. It works of course. But if I wanted to isolate those instructions to one particular directory, say /home/www/web150/web/seperate_directory, how would I do that?

Like this:

<Location '/seperate_directory'>
php_value upload_max_filesize 128M
php_value post_max_size 128M
LimitRequestBody 134217728
</Location>

thevinster
17th August 2005, 19:55
Like this:

<Location '/seperate_directory'>
php_value upload_max_filesize 128M
php_value post_max_size 128M
LimitRequestBody 134217728
</Location>

Perfect!

Many thanks for this. ISPConfig is such an extremely useful piece of software, even if you're managing just one site on it.

marketingmaven
18th August 2005, 00:11
Hi,

Anyone have a answer for my question from my original question on how to use the Apache Directive if I need .htaccess for a subfolder? I am new to this and am not sure exactly what to do and how to do it. Thanks. I guess I need to understand how to use the Apache Directive for both the root folders and subfolders. If someone could explain how to use it to me, I would appreciate it.

falko
18th August 2005, 01:45
Oh, I need the .htaccess in a subfolder of the main site it seems. Do I still put the .htaccess file in the Apache Directives Field? When I upload the .htaccess file directly to the subfolder, the site fails. When I delete it, everything is fine again. Thanks.

You can copy your .htaccess file to the Apache Directives field (you must use the <Location> directive if your directives are meant for a subdirectory only), or you can use the .htaccess file itself. If you get an error, then something is wrong with your .htaccess file.

marketingmaven
18th August 2005, 05:07
You can copy your .htaccess file to the Apache Directives field (you must use the <Location> directive if your directives are meant for a subdirectory only), or you can use the .htaccess file itself. If you get an error, then something is wrong with your .htaccess file.

Hi Falko,

Can you do me a favor and give me a example of how to do this? Like I said, Linux is new to me, and I'm amazed I got this far with ISPConfig. I am trying to copy and paste the contents of the .htaccess file into the Apache Directives field, but the site is still not working. I know when Wordpress creates the .htaccess file, it puts in in a sub directory. I don't understand how to place it there, or how any of this works. Could you please give me a example? Thank you.

falko
18th August 2005, 11:40
Like here:

<Location '/seperate_directory'>
php_value upload_max_filesize 128M
php_value post_max_size 128M
LimitRequestBody 134217728
</Location>

This means that these directives are valid only for the directory seperate_directory in the site's document root.