Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Sep 28, 2010 8:50 pm 
Offline
Senior Member

Joined: Tue Sep 28, 2010 12:05 pm
Posts: 90
Website: http://www.theatereleven.com
AOL: theatereleven
Location: Santa Monica, CA
I've read and had verified that HTACCESS is a performance hit on Drupal. So I don't want to do clean URLs that way.

Has anyone been sucessful in this? I'm using UBUNTU 8.04 and Drupal 6.19.

THANKS.

_________________
kyler d. boudreau
theatereleven.com


Top
   
 Post subject:
PostPosted: Tue Sep 28, 2010 9:41 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Put the rewrite rules into your virtual host configuration file. It'll probably need to go inside a <Directory> block. That way, the rewrite rules will be loaded and parsed only once when the server starts up.


Top
   
 Post subject:
PostPosted: Wed Sep 29, 2010 12:01 pm 
Offline
Senior Member

Joined: Tue Sep 28, 2010 12:05 pm
Posts: 90
Website: http://www.theatereleven.com
AOL: theatereleven
Location: Santa Monica, CA
Thanks - could you expound on that a touch?

I take the same lines out of htaccess and put them in with Apache file? I'm on Ubuntu 8.04 and Apache2. I see a couple configuration files:

httpd.conf
ports.conf
apache2.conf

Those are all in the /etc/apache2 directory. Is that even the right place to look for my server configuration file?

_________________
kyler d. boudreau

theatereleven.com


Top
   
 Post subject:
PostPosted: Wed Sep 29, 2010 12:18 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Did you put all of your website files in /var/www? If so, the file is
Code:
/etc/apache2/sites-available/default

There'll be a section that begins with
Code:
<Directory /var/www>

You put your rewrite rules inside those tags.


Top
   
 Post subject:
PostPosted: Wed Sep 29, 2010 1:40 pm 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
theatereleven wrote:
Thanks - could you expound on that a touch?


Read this.

There is a common misconception that .htaccess files must be used, be in reality anything in .htaccess can go in your configuration file.

Quote:
When should I, and should I not use .htaccess files?

Allowing .htaccess files will make Apache look for them upon every access to your server. Since parent directories are searched as well, this will take some (small) amount of time, and can impact your server's performance. For a better explanation, see HtaccessGotchas. (move that explanation here?)

Should use

.htaccess files should really only be used when you cannot directly edit the main configuration files.

Should not use

You should not use .htaccess when:

    1. you have access to edit the main server configuration file(s).
    2. server performance is of concern to you.
    3. untrusted people host websites on the server. (See How can I prevent users from using .htaccess? and How can I control what users can do with .htaccess files? (How to link to headings of this doc????))


Top
   
PostPosted: Thu Sep 30, 2010 12:43 pm 
Offline
Senior Member

Joined: Tue Sep 28, 2010 12:05 pm
Posts: 90
Website: http://www.theatereleven.com
AOL: theatereleven
Location: Santa Monica, CA
Thanks for the feedback!

I have only one Drupal site and one instance of Apache2 installed in the normal places.

I took the rewrite rules out of .htaccess and put them in the directory area of /etc/apache2/sites-available/default but it didn't work. bummer! Here are the rewrite rules I tried:

Set one:

# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Those didn't work so after reading another article i tried:

RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

And of course was reloading and restarting Apache each time. These didn't work for me. Any tips on what I might have wrong? THANKS.

_________________
kyler d. boudreau

theatereleven.com


Top
   
 Post subject:
PostPosted: Thu Sep 30, 2010 3:24 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Are there any other files in the sites-available folder? Are you using a control panel that might load configuration files from different locations?

I don't think %{SERVER_PORT} would be relevant here. The port is usually specified in the <VirtualHost> tag.

Try adding a slash between %{DOCUMENT_ROOT} and %{REQUEST_FILENAME}.

You might have to play with a RewriteBase configuration.

Check /var/log/apache2/error.log for any errors.

What else...?


Top
   
 Post subject:
PostPosted: Thu Sep 30, 2010 4:59 pm 
Offline
Senior Member

Joined: Tue Sep 28, 2010 12:05 pm
Posts: 90
Website: http://www.theatereleven.com
AOL: theatereleven
Location: Santa Monica, CA
Thanks for the reply...

There is one other site specified in sites available that I just added. "monitor.servername.com" for use with munin monitoring.

I'm just so new to this stuff I don't even know what to mess with when it comes to these rewrite variables. I have a very vanilla drupal 6.19 installation. One site, one domain name, etc.

_________________
kyler d. boudreau

theatereleven.com


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: sjnorton and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group