 |
|
 |
|
Next: Url Rewriting + "GET" error
|
| Author |
Message |
External

Since: Nov 30, 2006 Posts: 4
|
(Msg. 1) Posted: Thu Nov 30, 2006 12:17 pm
Post subject: Apache trying to DL .php files instead of executing them Archived from groups: alt>apache>configuration (more info?)
|
|
|
Hi everyone. Ive been running a linux Gentoo box for awhile, but im a
total newbie.
My problem: Everything was working fine. I have a static html page with
a bunch of links on it. I had a picture gallery running, and it was
running fine.
I went and updated portage, then it said I had x number of config files
that need updateing. I ran some command that like merged all my config
files. But it didnt really merge them, it blew out all my settings it
seems:(.
Now when I go to my picture gallery link, the browser tries to download
the PHP files. Ive read quite a bit on how to configure httpd.conf.
Heres a snippet from my httpd.conf
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a
DSO you
# have to place corresponding `LoadModule' lines at this location so
the
# directives contained in it are actually available _before_ they are
used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# The following modules are considered as the default configuration.
# If you wish to disable one of them, you may have to alter other
# configuration directives.
#
# You should always leave these three, as they are needed for normal
use.
# mod_access (Order, Allow, etc..)
# mod_log_config (Transferlog, etc..)
# mod_mime (AddType, etc...)
#
# Example:
# LoadModule foo_module modules/mod_foo.so
LoadModule php5_module modules/libphp5.so
# Authentication Modules
#
# These modules provide authentication and authorization for
# clients. They should not normally be disabled.
#
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
....
....
DocumentRoot /var/www/localhost/htdocs/
<Directory /var/www/localhost/htdocs/>
AllowOverride None
Options all
# Allow from all
# Order allow,deny
# Allow from all
</Directory>
#
# Each directory to which Apache has access can be configured with
respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
#<Directory />
# Options Indexes
# Options FollowSymLinks
# AllowOverride None
#</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# UserDir: The name of the directory that is appended onto a user's
home
# directory if a ~user request is received.
# enable by adding -D USERDIR to /etc/conf.d/apache2
#
#<IfModule mod_userdir.c>
# UserDir public_html
#</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.htm index.html index.php
</IfModule>
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
....
....
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
#
I thought I had everything I needed in there. No errors appear in the
error log,I guess because the server is doing exactly what its being
told to do...just not what I WANT it to do!
Anyone know of a quick fix for this? Im fairly sure its the httpd.conf
that messed everything up.
Any help would be appreciated. >> Stay informed about: Apache trying to DL .php files instead of executing them |
|
| Back to top |
|
 |  |
External

Since: Nov 30, 2006 Posts: 4
|
(Msg. 2) Posted: Thu Nov 30, 2006 12:43 pm
Post subject: Re: Apache trying to DL .php files instead of executing them [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
another bit of info....
heres a link to my server, and the info.php is working
http://zeppelin.yi.org/php/info.php
The picture gallery is in http://zeppelin.yi.org/gallery
mekmiotek.TakeThisOut@gmail.com wrote:
> Hi everyone. Ive been running a linux Gentoo box for awhile, but im a
> total newbie.
>
> My problem: Everything was working fine. I have a static html page with
> a bunch of links on it. I had a picture gallery running, and it was
> running fine.
>
> I went and updated portage, then it said I had x number of config files
> that need updateing. I ran some command that like merged all my config
> files. But it didnt really merge them, it blew out all my settings it
> seems:(.
>
> Now when I go to my picture gallery link, the browser tries to download
> the PHP files. Ive read quite a bit on how to configure httpd.conf.
>
> Heres a snippet from my httpd.conf
>
> # Dynamic Shared Object (DSO) Support
> #
> # To be able to use the functionality of a module which was built as a
> DSO you
> # have to place corresponding `LoadModule' lines at this location so
> the
> # directives contained in it are actually available _before_ they are
> used.
> # Statically compiled modules (those listed by `httpd -l') do not need
> # to be loaded here.
> #
> # The following modules are considered as the default configuration.
> # If you wish to disable one of them, you may have to alter other
> # configuration directives.
> #
> # You should always leave these three, as they are needed for normal
> use.
> # mod_access (Order, Allow, etc..)
> # mod_log_config (Transferlog, etc..)
> # mod_mime (AddType, etc...)
> #
> # Example:
> # LoadModule foo_module modules/mod_foo.so
>
> LoadModule php5_module modules/libphp5.so
>
> # Authentication Modules
> #
> # These modules provide authentication and authorization for
> # clients. They should not normally be disabled.
> #
> LoadModule access_module modules/mod_access.so
> LoadModule auth_module modules/mod_auth.so
> LoadModule auth_anon_module modules/mod_auth_anon.so
> LoadModule auth_dbm_module modules/mod_auth_dbm.so
> LoadModule auth_digest_module modules/mod_auth_digest.so
> ...
> ...
> DocumentRoot /var/www/localhost/htdocs/
> <Directory /var/www/localhost/htdocs/>
> AllowOverride None
> Options all
> # Allow from all
> # Order allow,deny
> # Allow from all
> </Directory>
> #
> # Each directory to which Apache has access can be configured with
> respect
> # to which services and features are allowed and/or disabled in that
> # directory (and its subdirectories).
> #
> # First, we configure the "default" to be a very restrictive set of
> # features.
> #
> #<Directory />
> # Options Indexes
> # Options FollowSymLinks
> # AllowOverride None
> #</Directory>
>
> #
> # Note that from this point forward you must specifically allow
> # particular features to be enabled - so if something's not working as
> # you might expect, make sure that you have specifically enabled it
> # below.
> #
>
> #
> # UserDir: The name of the directory that is appended onto a user's
> home
> # directory if a ~user request is received.
> # enable by adding -D USERDIR to /etc/conf.d/apache2
> #
> #<IfModule mod_userdir.c>
> # UserDir public_html
> #</IfModule>
>
> <IfModule mod_dir.c>
> DirectoryIndex index.htm index.html index.php
> </IfModule>
>
>
> #
> # Control access to UserDir directories. The following is an example
> # for a site where these directories are restricted to read-only.
> #
> <Directory /home/*/public_html>
> AllowOverride FileInfo AuthConfig Limit Indexes
> Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
> <Limit GET POST OPTIONS PROPFIND>
> Order allow,deny
> Allow from all
> </Limit>
> <LimitExcept GET POST OPTIONS PROPFIND>
> Order deny,allow
> Deny from all
> </LimitExcept>
> </Directory>
> ...
> ...
>
>
> #
> AddType application/x-compress .Z
> AddType application/x-gzip .gz .tgz
> AddType application/x-httpd-php .php
> #
>
>
> I thought I had everything I needed in there. No errors appear in the
> error log,I guess because the server is doing exactly what its being
> told to do...just not what I WANT it to do!
>
> Anyone know of a quick fix for this? Im fairly sure its the httpd.conf
> that messed everything up.
>
> Any help would be appreciated. >> Stay informed about: Apache trying to DL .php files instead of executing them |
|
| Back to top |
|
 |  |
External

Since: Nov 30, 2006 Posts: 4
|
(Msg. 3) Posted: Thu Nov 30, 2006 12:57 pm
Post subject: Re: Apache trying to DL .php files instead of executing them [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
OK, so I dont think the problem is as bad as I thought.
php is in fact working fine. When I used to put in
http://zeppelin.yi.org/gallery
bam it would loada the picture gallery.
Now if I just put that in, it wants to download the php file. I have to
enter the exact path to get it to load now like this:
http://zeppelin.yi.org/gallery/index.php
How do I get it to load without requiring the full path?
mekmiotek.DeleteThis@gmail.com wrote:
> another bit of info....
>
> heres a link to my server, and the info.php is working
> http://zeppelin.yi.org/php/info.php
>
> The picture gallery is in http://zeppelin.yi.org/gallery
>
> mekmiotek.DeleteThis@gmail.com wrote:
> > Hi everyone. Ive been running a linux Gentoo box for awhile, but im a
> > total newbie.
> >
> > My problem: Everything was working fine. I have a static html page with
> > a bunch of links on it. I had a picture gallery running, and it was
> > running fine.
> >
> > I went and updated portage, then it said I had x number of config files
> > that need updateing. I ran some command that like merged all my config
> > files. But it didnt really merge them, it blew out all my settings it
> > seems:(.
> >
> > Now when I go to my picture gallery link, the browser tries to download
> > the PHP files. Ive read quite a bit on how to configure httpd.conf.
> >
> > Heres a snippet from my httpd.conf
> >
> > # Dynamic Shared Object (DSO) Support
> > #
> > # To be able to use the functionality of a module which was built as a
> > DSO you
> > # have to place corresponding `LoadModule' lines at this location so
> > the
> > # directives contained in it are actually available _before_ they are
> > used.
> > # Statically compiled modules (those listed by `httpd -l') do not need
> > # to be loaded here.
> > #
> > # The following modules are considered as the default configuration.
> > # If you wish to disable one of them, you may have to alter other
> > # configuration directives.
> > #
> > # You should always leave these three, as they are needed for normal
> > use.
> > # mod_access (Order, Allow, etc..)
> > # mod_log_config (Transferlog, etc..)
> > # mod_mime (AddType, etc...)
> > #
> > # Example:
> > # LoadModule foo_module modules/mod_foo.so
> >
> > LoadModule php5_module modules/libphp5.so
> >
> > # Authentication Modules
> > #
> > # These modules provide authentication and authorization for
> > # clients. They should not normally be disabled.
> > #
> > LoadModule access_module modules/mod_access.so
> > LoadModule auth_module modules/mod_auth.so
> > LoadModule auth_anon_module modules/mod_auth_anon.so
> > LoadModule auth_dbm_module modules/mod_auth_dbm.so
> > LoadModule auth_digest_module modules/mod_auth_digest.so
> > ...
> > ...
> > DocumentRoot /var/www/localhost/htdocs/
> > <Directory /var/www/localhost/htdocs/>
> > AllowOverride None
> > Options all
> > # Allow from all
> > # Order allow,deny
> > # Allow from all
> > </Directory>
> > #
> > # Each directory to which Apache has access can be configured with
> > respect
> > # to which services and features are allowed and/or disabled in that
> > # directory (and its subdirectories).
> > #
> > # First, we configure the "default" to be a very restrictive set of
> > # features.
> > #
> > #<Directory />
> > # Options Indexes
> > # Options FollowSymLinks
> > # AllowOverride None
> > #</Directory>
> >
> > #
> > # Note that from this point forward you must specifically allow
> > # particular features to be enabled - so if something's not working as
> > # you might expect, make sure that you have specifically enabled it
> > # below.
> > #
> >
> > #
> > # UserDir: The name of the directory that is appended onto a user's
> > home
> > # directory if a ~user request is received.
> > # enable by adding -D USERDIR to /etc/conf.d/apache2
> > #
> > #<IfModule mod_userdir.c>
> > # UserDir public_html
> > #</IfModule>
> >
> > <IfModule mod_dir.c>
> > DirectoryIndex index.htm index.html index.php
> > </IfModule>
> >
> >
> > #
> > # Control access to UserDir directories. The following is an example
> > # for a site where these directories are restricted to read-only.
> > #
> > <Directory /home/*/public_html>
> > AllowOverride FileInfo AuthConfig Limit Indexes
> > Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
> > <Limit GET POST OPTIONS PROPFIND>
> > Order allow,deny
> > Allow from all
> > </Limit>
> > <LimitExcept GET POST OPTIONS PROPFIND>
> > Order deny,allow
> > Deny from all
> > </LimitExcept>
> > </Directory>
> > ...
> > ...
> >
> >
> > #
> > AddType application/x-compress .Z
> > AddType application/x-gzip .gz .tgz
> > AddType application/x-httpd-php .php
> > #
> >
> >
> > I thought I had everything I needed in there. No errors appear in the
> > error log,I guess because the server is doing exactly what its being
> > told to do...just not what I WANT it to do!
> >
> > Anyone know of a quick fix for this? Im fairly sure its the httpd.conf
> > that messed everything up.
> >
> > Any help would be appreciated. >> Stay informed about: Apache trying to DL .php files instead of executing them |
|
| Back to top |
|
 |  |
External

Since: Apr 06, 2006 Posts: 40
|
(Msg. 4) Posted: Thu Nov 30, 2006 8:20 pm
Post subject: Re: Apache trying to DL .php files instead of executing them [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
External

Since: Nov 30, 2006 Posts: 4
|
(Msg. 5) Posted: Fri Dec 01, 2006 9:03 am
Post subject: Re: Apache trying to DL .php files instead of executing them [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Thanks David....but that seems very strange indeed. When I click that
link it still tries to download the php file.
I edited my main index.html so all the links include the index.php in
the path. It works, but not how it used to work.
David wrote:
> mekmiotek.TakeThisOut@gmail.com wrote:
> > OK, so I dont think the problem is as bad as I thought.
> >
> > php is in fact working fine. When I used to put in
> > http://zeppelin.yi.org/gallery
>
> the above URL works just fine here (Lebanon,OR)
>
> >
> > bam it would loada the picture gallery.
> >
> > Now if I just put that in, it wants to download the php file. I have to
> > enter the exact path to get it to load now like this:
> > http://zeppelin.yi.org/gallery/index.php
> > How do I get it to load without requiring the full path?
> >
> <snip> >> Stay informed about: Apache trying to DL .php files instead of executing them |
|
| Back to top |
|
 |  |
| Related Topics: | Executing perl code in apache - I have tried the AddType cgi-bin .pl and also added the directory and a name to the cgi-bin directive under the apache config but the perl code doesn't get executed, instead I get to see raw perl code in the browser. What do I need to do so apache..
Apache2 CGI scripts nor executing - Hello, How do I switch on CGI script execution? I have: Options ExecCGI -MultiViews +SymLinksIfOwnerMatch for the VirtualHost but it still does not execute the scripts. Is mod_perl necessary? Thanks, Guru
Index.php not executing (Apache2 & websvn on debian.) - I want to use websvn to view my repository on a laptop and so only need a minimal config. Hoped it would work out of the box like Debian normally does but... "/websvn/" and "/websvn/index.php" both present a download option, ins...
Apache log files - Hi all, How do I configure Apache so that it doesn't overwrite old access_log files. At the moment it has up to 4 access_log files (access_log, access_log.1 etc). I want to set it so that it just keeps adding more log files as needed. Thanks in advance...
Apache and PHP files - I hope their is an easy fix for this. If I type: www.domain.com/test.php the file loads as expected If I type: www.domain.com/test/ the file loads a broken test.php I'd like for a default error page to load. The dir test does not exist. Why is.. |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|