Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Last Resort with Apache, PHP5 and MOD_Rewrite
Old 05-05-2009, 09:17 PM Exclamation Last Resort with Apache, PHP5 and MOD_Rewrite
Novice Talker

Posts: 6
Name: Andy
Trades: 0
Hi guys, I come to you with cap in hand as a total last resort, I honestly feel like jumping off a cliff right now!

I have a dedicated linux server running ubuntu from Fasthosts, who tell me there is no restrictions whatsoever on my box.

I have moved over a couple of websites to the server which are already in google using SEO friendly urls (rewritten) and my rankings are gonna go to pot if I cant sort it soon.

I have adjusted my httpd.conf file which I found in "opt/matrixsa/conf/httpd/httpd.conf" - This does appear to be the file in use.

I have attached my httpd.conf file in case anyone can help me. And upon request I can show you my phpinfo().

Many Thanks Guys

Andy
Attached Files
File Type: txt httpd.txt (31.1 KB, 4 views)
k9webdesign is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-06-2009, 06:22 AM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Brian07002's Avatar
Defies a Status

Posts: 2,142
Name: ...
Location: ...
Trades: 0
First...

I noted there were *alot* of modules listed in your httpd file. Did you check with the server to make sure the server admin has enabled all of them? Not say that is the primary problem, but it can definitely lead to problems from one not allowing another to function correctly.

Second...

Make sure you ask the admin if the paths to the http.d conf is right

Third...

How did you create that http.d file? Was it generated by a cPanel feature, or did you modify it? It has quite a bit of info that really isn't needed. But I will leave that aside, as most seems to be written correctly. I haven't swept it clean, just skimmed over it, but it can be alot smaller in size to make it easier to fix.

What is it exactly that you want it to do, regarding MOD_Rewrite...If all you want is a set of rules to re-write your URL's structure, post just that info, and I will try to help fix it from there.

-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 05-06-2009, 06:48 AM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Novice Talker

Posts: 6
Name: Andy
Trades: 0
Hi Brian, thanks for you response, I have attached the .htaccess that the script called PHP Link Directory is using, the main programs I use though is wordpress, so at very worst case - I need to be able to get wordpress working on here will url rewrite.

The 2 files attached are:

1. phpld.htaccess (the one I would like to get working ideally)
2. wp.htaccess (worst case the one I need to get working)

Thanks Brian for your help, it means a lot.

Cheers

Andy
Attached Files
File Type: txt wp.htaccess.txt (182 Bytes, 0 views)
File Type: txt phpld.htaccess.txt (3.6 KB, 1 views)
k9webdesign is offline
Reply With Quote
View Public Profile
 
Old 05-06-2009, 06:50 AM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Novice Talker

Posts: 6
Name: Andy
Trades: 0
Just a note, I have to manually update my httpd.conf using VI through SSH so if you could let me know what you changed or highlight it in red or something, it would really help.
k9webdesign is offline
Reply With Quote
View Public Profile
 
Old 05-06-2009, 09:49 PM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Brian07002's Avatar
Defies a Status

Posts: 2,142
Name: ...
Location: ...
Trades: 0
Did you check step 1 first? Also, in step 2, you are going to need to check with your hosting company. If you are hosting the site, make sure that the path to the http.d conf is correct. Then if you still have problems then, you need to make sure that each module that you have enabled is what you want. Because my suggestion would be to disable all except what you want, and I still don't know *Exactly* what you want done...Do you want to modify the urls to search engine friendly urls? I can't read your mind. Don't be shy, explain please.
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 05-06-2009, 09:58 PM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Brian07002's Avatar
Defies a Status

Posts: 2,142
Name: ...
Location: ...
Trades: 0
In your .htaccess file do this:

Code:
<Files site>
ForceType application/x-httpd-php
</Files>
The above code tells Apache that if someone requests the file 'site' then it should be treated as a PHP file. Of course, you don't have to call it 'site'. If you were running a small online shop you might want to call it 'catalog'.

Next, we need something that will take our new url and extract the information out of it. We do that with this function called processURI()
Code:
// processURI(): 
// Takes the query string and extracts the vars by splitting on the '/'
// Returns an array $url_array containing keys argN for each variable.
function processURI() {
 global $REQUEST_URI;   // Define our global variables
 $array = explode("/",$REQUEST_URI);	// Explode the URI using '/'.
 $num = count($array);	// How many items in the array?
 $url_array = array();	// Init our new array	
	
 for ($i = 1 ; $i < $num ; $i++) {	         
	$url_array["arg".$i] = $array[$i];  
 }
// Insert each element from the
// request URI into $url_array
// with a key of argN. We start $i
// at 1 because exploding the URI
// gives us an empty ref in $array[0] 
// It's a hacky way of getting round it
// *:)
	
return $url_array;  // return our new shiny array
}
Good Luck!
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 05-07-2009, 05:00 AM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Novice Talker

Posts: 6
Name: Andy
Trades: 0
Hi Bryan.

Well what I really want to do is to get my server working normally for .htaccess rules so that when I install a php script it works out of the box, right now any php off the shelf script that uses any kind of rewrite simply wont work.

Regarding the hosting company, the server is my own dedicated box so they wont provide any support at all. Its an ubuntu box but I really dont have a clue, I guess I may just have to pay an engineer £60 every 30 minutes until its resolved.

Problem is those guys drag stuff out and it will end up being a fortune to get it sorted.

Would you consider working on an hourly rate to get it sorted for me?
k9webdesign is offline
Reply With Quote
View Public Profile
 
Old 05-07-2009, 10:57 AM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Brian07002's Avatar
Defies a Status

Posts: 2,142
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by k9webdesign View Post
Hi Bryan.

Well what I really want to do is to get my server working normally for .htaccess rules so that when I install a php script it works out of the box, right now any php off the shelf script that uses any kind of rewrite simply wont work.

Regarding the hosting company, the server is my own dedicated box so they wont provide any support at all. Its an ubuntu box but I really dont have a clue, I guess I may just have to pay an engineer £60 every 30 minutes until its resolved.

Problem is those guys drag stuff out and it will end up being a fortune to get it sorted.

Would you consider working on an hourly rate to get it sorted for me?
I thought you hosted the site, well in that case all I have to say is this...There's no guarantee this will work, but you need to just keep hounding them to fix the problem. Just tell them you have installed the script many times, and you still are having the same problem. If they want to drag it on, (I know how that feels) all you need to do is cancel the service with them, cause if they catch you in this position, they will continue to do it and eventually force money from you to fix it, if you have the money. I would like to try and help you fix it, but I just don't have the time right now, as I am in classes and it taking alot of my time.

Thanks for the offer.
-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 05-07-2009, 11:02 AM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Novice Talker

Posts: 6
Name: Andy
Trades: 0
Ok Brian, they won't help me but thanks anyway for your help.
k9webdesign is offline
Reply With Quote
View Public Profile
 
Old 05-11-2009, 05:06 PM Re: Last Resort with Apache, PHP5 and MOD_Rewrite
Novice Talker

Posts: 6
Name: Andy
Trades: 0
I fixed the problem, my server uses Ubuntu and by default the mod is not loaded so no matter what you do in the httpd.conf or htaccess, it will never work...

I logged in to SSH and entered the following line.

sudo a2enmod rewrite

then restarted apache and it worked right away!

SOURCE: http://ubuntuforums.org/archive/index.php/t-7304.html

and it worked right away
k9webdesign is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Last Resort with Apache, PHP5 and MOD_Rewrite
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.19344 seconds with 13 queries