Link to home
Start Free TrialLog in
Avatar of duerra
duerra

asked on

BAH! It can't be done!!!

Can anybody tell me what's wrong with this?!  I've used, for the most part, the configuration from http://www.devside.net/ , but with a few changes to suit my site.  However, no matter how hard I try, or even with the for-the-most-part-default-apache-configuration, I absolutely cannot get PHP to run as an Apache module using this configuration.  Since I'm not literate enough in Apache scripting to know what everything means, I'm wondering if somebody else can tell me what's going wrong  

Here's what I tried.  Apache will *start* with this configuration, but I get access errors from every page (you do not have permission to access /blah/directory).

I really want to optimize Apache, and I get the feeling that the way I have it now isn't configured very well.  I'm just looking for some lead, I guess.


Listen 80
ServerRoot "F:/apache/Apache2"
DocumentRoot "F:/mostwanted/"

ServerName www.mostwantedgame.com:80
ServerAdmin admin@nospam.mostwantedgame.com

ServerSignature On
ServerTokens Full

DefaultType text/plain
AddDefaultCharset ISO-8859-1

UseCanonicalName Off

HostnameLookups Off

ErrorLog logs/error.log
LogLevel warn

PidFile logs/httpd.pid

Timeout 300

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15


<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild  0
</IfModule>


LoadModule access_module modules/mod_access.so
LoadModule dir_module modules/mod_dir.so
LoadModule headers_module modules/mod_headers.so
LoadModule info_module modules/mod_info.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
<IfDefine SSL>
      LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
LoadModule deflate_module modules/mod_deflate.so
LoadModule php4_module D:/php4/php-4.3.3/php4apache2.dll


<Directory />
    <IfModule mod_deflate.c>
#      AddOutputFilterByType DEFLATE text/html text/plain text/xml
#      The above does not seem to work under win32 right now,
#      we will use this instead...
      SetOutputFilter DEFLATE
        <IfModule mod_headers.c>
            Header append Vary User-Agent
        </IfModule>
    </IfModule>
    Options FollowSymLinks
    AllowOverride None
    order deny,allow
    deny from all
</Directory>


<Directory "F:/apache/Apache2/cgi-bin">
    order allow,deny
    allow from all
</Directory>


<IfModule mod_log_config.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
    CustomLog "|bin/rotatelogs.exe logs/access/logfile 5M" combined
    <IfModule mod_deflate.c>
        DeflateFilterNote Input instream
        DeflateFilterNote Output outstream
        DeflateFilterNote Ratio ratio
        LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
        CustomLog logs/deflate.log deflate
    </IfModule>
</IfModule>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>

<IfModule mod_mime.c>
    TypesConfig conf/mime.types
    AddType application/x-tar .tgz
    AddType application/x-rar-compressed .rar
    <IfModule sapi_apache2.c>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
        AddType application/x-httpd-php .html
        AddType application/x-httpd-php .htm
    </IfModule>
</IfModule>

<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
    BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
    BrowserMatch "^WebDrive" redirect-carefully
    BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
    BrowserMatch "^gnome-vfs" redirect-carefully
    <IfModule mod_deflate.c>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    </IfModule>
</IfModule>

<IfModule mod_status.c>
    ExtendedStatus On
    <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
</IfModule>

<IfModule mod_info.c>
    <Location /server-info>
        SetHandler server-info
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
</IfModule>

<IfModule mod_ssl.c>
    Include conf/ssl.conf
</IfModule>

So yeah... site isn't accessible with this configuration.  I'm just wondering where it's going wrong.
Avatar of FaithRaven
FaithRaven

Did apache start without a warning or error ?

FaithRaven
Avatar of duerra

ASKER

Yes, it did.  I have the proper configuration now, however.  Just as an FYI to anybody interested:


Listen 80
ServerRoot "F:/apache/Apache2"
DocumentRoot "F:/mostwanted"

ServerName www.mostwantedgame.com:80
ServerAdmin admin@nospam.mostwantedgame.com

ServerSignature On
ServerTokens Full

DefaultType text/plain
AddDefaultCharset ISO-8859-1

UseCanonicalName Off

HostnameLookups Off

ErrorLog logs/error.log
LogLevel warn

PidFile logs/httpd.pid

Timeout 300

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15


<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild  0
</IfModule>


LoadModule access_module modules/mod_access.so
LoadModule dir_module modules/mod_dir.so
LoadModule headers_module modules/mod_headers.so
LoadModule info_module modules/mod_info.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
<IfDefine SSL>
      LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
LoadModule deflate_module modules/mod_deflate.so
LoadModule php4_module D:/php4/php-4.3.3/php4apache2.dll


<Directory />
    <IfModule mod_deflate.c>
#      AddOutputFilterByType DEFLATE text/html text/plain text/xml
#      The above does not seem to work under win32 right now,
#      we will use this instead...
      SetOutputFilter DEFLATE
        <IfModule mod_headers.c>
            Header append Vary User-Agent
        </IfModule>
    </IfModule>
    Options FollowSymLinks
    AllowOverride None
    order deny,allow
    deny from all
</Directory>


<Directory "F:/mostwanted">
    order allow,deny
    allow from all
</Directory>


<IfModule mod_log_config.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
    #CustomLog "|bin/rotatelogs.exe logs/access/logfile 5M" combined
    #CustomLog logs/access.log combined    
    TransferLog "|'F:/apache/Apache2/bin/cronolog.exe' 'F:/apache/Apache2/logs/access/%m-%d-%Y-access-log.log'"
    TransferLog "|'F:/apache/Apache2/bin/cronolog.exe' 'F:/apache/Apache2/logs/errors/%m-%d-%Y-error-log.log'"
    <IfModule mod_deflate.c>
        DeflateFilterNote Input instream
        DeflateFilterNote Output outstream
        DeflateFilterNote Ratio ratio
        LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
        CustomLog logs/deflate.log deflate
    </IfModule>
</IfModule>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>

<IfModule mod_mime.c>
    TypesConfig conf/mime.types
    AddType application/x-tar .tgz
    AddType application/x-rar-compressed .rar
    <IfModule sapi_apache2.c>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
        AddType application/x-httpd-php .html
        AddType application/x-httpd-php .htm
    </IfModule>
</IfModule>

<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
    BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
    BrowserMatch "^WebDrive" redirect-carefully
    BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
    BrowserMatch "^gnome-vfs" redirect-carefully
    <IfModule mod_deflate.c>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    </IfModule>
</IfModule>

<IfModule mod_status.c>
    ExtendedStatus On
    <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
</IfModule>

<IfModule mod_info.c>
    <Location /server-info>
        SetHandler server-info
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
</IfModule>

<IfModule mod_ssl.c>
    Include conf/ssl.conf
</IfModule>
Please use this tutorial : http://www.flash-db.com/ApachePHPSQL/ 
If you follow it's steps you will install apache corectly without problems.

FaithRaven
ASKER CERTIFIED SOLUTION
Avatar of duerra
duerra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial