PDA

View Full Version : Can't find the httpd.conf file


Lightro
06-23-2008, 02:07 AM
Hi.

I am trying to set up clean urls on my website with:

<Files article>
SetHandler application/x-httpd-php
</Files>

But it just wasn't working. The file was been read as a text file.

So anyway I did some research and found this page:
http://www.usenet-forums.com/linux-web-servers/6415-sethandler-wont-work-htaccess.html

And read:
Is Apache's php support compiled as a module ? If so, do you have
a line along the lines of :

LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

in your httpd.conf ?

You'd also need to use :

ForceType application/x-httpd-php

in your .htaccess instead of SetHandler.

So I figured I should do that. The problem is, I can't seem to find the httpd.conf file :\

I read that it was located in the directory: /etc/httpd/conf/httpd.conf

But inside the /etc folder there didn't seem to be any /httpd folder.

I'm not quite sure why it isn't there.

If anyone knew where it was, or why it wasn't there.
Or perhaps even if someone knew a different way of doing clean urls without needing that file...

Thanks, Elan.

oesxyl
06-23-2008, 02:12 AM
what linux distro do you have?

regards

Lightro
06-23-2008, 02:28 AM
2.6.24.3-grsec #7 SMP 2008 i686 i686 i386 GNU/Linux

oesxyl
06-23-2008, 02:38 AM
2.6.24.3-grsec #7 SMP 2008 i686 i686 i386 GNU/Linux
I guess is Debian but was more easy to say so, :)

look in /etc/apache/ directory or if you have apache 2 in /etc/apache2/

if you don't find it there, try one of this commands from terminal:


locate "httpd.conf"



find /etc/ -name "httpd.conf"


regards

Lightro
06-26-2008, 01:04 AM
look in /etc/apache/ directory or if you have apache 2 in /etc/apache2/

Actually in my /etc directory there is only one folder and it has the same name as my domain name.

As for searching with the terminal, I'm using a mac and connecting to the server via Transmit, so I don't have terminal access to the server. What I did try, however was connecting to it with Apple's built in feature for ftp, and had no luck finding it when I did a search.

I did find a file called awstats.(MyDomainHere).conf though, which has a lot of commented lines (beginning with #), could this be an equivalent of some sort?

Thanks.

oesxyl
06-26-2008, 01:18 AM
Actually in my /etc directory there is only one folder and it has the same name as my domain name.
I'm sorry but you didn't said that is a remote connection.
that change the problem because I don't think you have access to httpd.conf if you don't have a dedicated server. That means that only your hosting provider have access.

As for searching with the terminal, I'm using a mac and connecting to the server via Transmit, so I don't have terminal access to the server. What I did try, however was connecting to it with Apple's built in feature for ftp, and had no luck finding it when I did a search.
this can be solved, I guess, if are looking for a application for mac which use ssh or something like this.

I did find a file called awstats.(MyDomainHere).conf though, which has a lot of commented lines (beginning with #), could this be an equivalent of some sort?
no, this is the configuration file for a application named awstat, which provide you statistcs about visitors.

regards

Lightro
06-26-2008, 01:23 AM
Oh ok, well thanks for the help. So there is no other way to implement clean urls without using the httpd.conf file?

oesxyl
06-26-2008, 01:24 AM
back to your problem:
- check if your hosting provider offer you php, ask him
- use .htaccess to deal with url, that depend of server configuration

usualy this information are available in cpanel/plesk or whatever your hosting provider give you for management or if not by asking him.

regards

Lightro
06-26-2008, 01:30 AM
- check if your hosting provider offer you php, ask him
Oh my server does support php, I'm using it on a lot of pages.

- use .htaccess to deal with url, that depend of server configuration
Yes well I have tried a few methods but none of them seem to work.

I have tried this method: http://www.brainhandles.com/2007/03/29/how-do-i-feed-data-to-a-script-without-question-marks-in-the-url/

Which uses
<Files article>
SetHandler application/x-httpd-php
</Files>

And I have tried mod_rewrite, described here: http://www.tutorio.com/tutorial/enable-mod-rewrite-on-apache

oesxyl
06-26-2008, 01:37 AM
Oh my server does support php, I'm using it on a lot of pages.


Yes well I have tried a few methods but none of them seem to work.

I have tried this method: http://www.brainhandles.com/2007/03/29/how-do-i-feed-data-to-a-script-without-question-marks-in-the-url/

Which uses
<Files article>
SetHandler application/x-httpd-php
</Files>

And I have tried mod_rewrite, described here: http://www.tutorio.com/tutorial/enable-mod-rewrite-on-apache

did you check if mod_rewrite is enabled for you?
please, give me an example of url, how it is and how you want to be

regards

Lightro
06-26-2008, 02:05 AM
I don't know if mod_rewrite is enabled. Don't you need the httpd.conf file to enable it?

I want my url to go from

mydomain.com?listings.php?category=testcategory

to

mydomain.com/listings/testcategory

oesxyl
06-26-2008, 02:24 AM
I don't know if mod_rewrite is enabled. Don't you need the httpd.conf file to enable it?

I want my url to go from

mydomain.com?listings.php?category=testcategory

to

mydomain.com/listings/testcategory

I guess this could help you:

http://www.somacon.com/p145.php

regards

Lightro
06-26-2008, 03:02 AM
I don't think that is quite what I'm looking for.

What I originally tried was changing "listings.php" into "listings" and then using SetHandler to make that file be read as php.

In the method
<Files listings>
SetHandler application/x-httpd-php
</Files>

I know that it is locating the script properly, because I have tried putting other stuff between the <Files listings> and </Files>. It is just the SetHandler application/x-httpd-php that doesn't seem to be working.

I have also tried ForceType application/x-httpd-php, as mentioned here http://www.usenet-forums.com/linux-web-servers/6415-sethandler-wont-work-htaccess.html

But that didn't seem to do anything ether.

The "listings" file is still just be read as a text file.

Thanks.

oesxyl
06-26-2008, 03:39 AM
I don't think that is quite what I'm looking for.

What I originally tried was changing "listings.php" into "listings" and then using SetHandler to make that file be read as php.

In the method
<Files listings>
SetHandler application/x-httpd-php
</Files>

I know that it is locating the script properly, because I have tried putting other stuff between the <Files listings> and </Files>. It is just the SetHandler application/x-httpd-php that doesn't seem to be working.

I have also tried ForceType application/x-httpd-php, as mentioned here http://www.usenet-forums.com/linux-web-servers/6415-sethandler-wont-work-htaccess.html

But that didn't seem to do anything ether.

The "listings" file is still just be read as a text file.

Thanks.
I don't think is possible what you try to do, in this way. seting handler to nothing I guess don't work, first of all, second if you find some solution will overload the server parsing anything to see if is or not php. As you can see from the link you posted, the op don't succed.
If you don't want to use 301 redirection, I can't help you, I'm sorry.

regards

Lightro
06-27-2008, 02:02 AM
Ok well thanks.

I was only trying to do what seemed so easy described here: http://www.evolt.org/article/Making_clean_URLs_with_Apache_and_PHP/18/22880/

How exactly can a permanent 301 redirect help me? It still requires a "." extension of some sort doesn't it?

oesxyl
06-27-2008, 02:08 AM
Ok well thanks.

I was only trying to do what seemed so easy described here: http://www.evolt.org/article/Making_clean_URLs_with_Apache_and_PHP/18/22880/

How exactly can a permanent 301 redirect help me? It still requires a "." extension of some sort doesn't it?
this is the way to do this and, no, you don't need a extension or '.'

a request from visitor like:

mydomain.com/testcategory


will become:

mydomain.com?listings.php?category=testcategory


on the server.

or as you want:

mydomain.com/listings/testcategory

regards