LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-03-2010, 02:47 AM   #1
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
moving apache directives from .htaccess to httpd.conf in cPanel/WHM environment


I've got a dedicated server using whm/cpanel and there is a particular domain being hosted which contains a very elaborate .htaccess file which is full of mod_rewrite rules, among other things. I've been asked to try and get the contents of this .htaccess file into the httpd.conf (or some appropriate include file) to improve performance.

I've been reading this page and it's really confusing me:
http://www.cpanel.net/documentation/...irectives.html

In the file usr/local/apache/conf/httpd.conf I see that there are two VirtualHost sections that appear to be relevant for my domain (which I'll call mydomain.com). The first listens on port 80 and the second is on 443. Seems to me that my apache directives in .htaccess would belong in this section. In the first section I see this:
Code:
    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/mydomain/mydomain.com/*.conf"
In the second section I see this:
Code:
    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/ssl/2/mydomain/mydomain.com/*.conf"
The problem with both of these is that the directory /usr/local/apache/conf/userdata does not exist, much less the full path to either of those files.

If anyone could advise me on where I should be putting these elaborate rewrite rules, I'd be very grateful. The documentation on this is really hard to follow.
 
Old 03-03-2010, 05:07 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

After reading the documentation from the link you provided, it looks like you have to create this directory structure and add the rewrite rules into a *.conf fie (e.g. /usr/local/apache/conf/userdata/std/2/mydomain/mydomain.com/rewrite.conf), if you want to be compatible with their instructions. Or you can put the *.conf in a path of your choice and change the Include directive accordingly.
If you're using the same rules for both ssl and not-ssl vhost, you can do this only for one of them and point the Include for the other to the same *.conf.

Regards

Last edited by bathory; 03-03-2010 at 05:12 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cpanel/WHM Died at /usr/local/cpanel/Cpanel/Hulk.pm line 92. liang3391 Linux - Software 1 06-22-2009 02:02 PM
Apache case-insensitive username matching with .htaccess directives? shachter Linux - Server 2 04-15-2009 11:40 AM
Help! Why am I getting Apache message about CPanel & WHM websissy Linux - Server 1 11-13-2008 05:52 PM
httpd.conf losing permissions when changed by WHM derricke Linux - Server 3 10-20-2008 10:14 AM
Problems Adding Directives to the httpd.conf file kaplan71 Linux - Software 1 03-25-2005 07:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration