mime_module
section of httpd.conf? Have you added the MultiViews
option to the Options
section for the hostname/domain in question, in the httpd.conf?OK. Assuming a nearly bone stock httpd.conf, and NO includes (separate virtual-host.conf files). I assume you havehac3ru said:As far as I can see, the httpd.conf is correct... I added MultiViews option with no success...
#***************************************************************
# PHP -- include index.php as part of your DirectoryIndex.
# add the following to your Apache configuration file:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .inc
AddType application/x-httpd-php-source .phps
<IfModule mime_module>
section. Yes?Options MultiViews
MultiViews
Options +MultiViews
AllowOverride
stanza doesn't prevent you from using Options MultiViews
. Either from within the Main-Server section, nor within the Virtual-Host itself. <domain-name>/main.php
exists. What do the logs reveal, when you attempt to put http://<domain-name>/main
in the URL bar of your web client (browser)?AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .inc
[08/Apr/2014:00:56:46 +0300] "GET /index HTTP/1.1" 404 202
application/x-httpd-php phtml pht php
application/x-httpd-php-source phps
application/x-httpd-php3 php3
application/x-httpd-php3-preprocessed php3p
application/x-httpd-php4 php4
application/x-httpd-php5 php5
THIS is the problem.hac3ru said:I have in all my virtual hosts the
Code:Options -Indexes +FollowSymLinks +MultiViews
[08/Apr/2014:00:56:46 +0300] "GET /index HTTP/1.1" 404 202
-Indexes
[08/Apr/2014:00:56:46 +0300] "GET /index HTTP/1.1" 404 202
-Indexes
+Indexes
Yes, in part. But given you specifically asked for index, as the log indicated. You will have to at least have a file called index. Or why bother to ask for index?hac3ru said:I'll try it tomorrow but indexes is used to list the files inside a directory that doesn't have an index.php file. Don't think it will solve it. Will try it tomorrow
Indexes
, on a per-directory basis. For example:/usr/local/www/somefolder
<IfModule dir_module>
DirectoryIndex rubbish RUBBISH trash.php garbage.html nopage.xhtml poo.garbage
</IfModule>
http://<my-domain>/someplace
Apache will look for all the files listed within DirectoryIndex
, and serve up the first one it finds, as the Index, if no other file was requested.Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
service apache24 restart
http://localhost/admin
<IfModule mime_module>
?TypesConfig etc/apache22/mime.types
<Directory "/usr/local/www/working-path">
Options -Indexes +Includes +FollowSymLinks +SymLinksifOwnerMatch +ExecCGI +MultiViews
MultiviewsMatch Handlers Filters
Chris_H said:OK. Perhaps I've made too many assumptions here.
Does the following line exist under<IfModule mime_module>
?
UnderCode:TypesConfig etc/apache22/mime.types
<Directory "/usr/local/www/working-path">
Do you also have the following, under it?Code:Options -Indexes +Includes +FollowSymLinks +SymLinksifOwnerMatch +ExecCGI +MultiViews
If not. Try and see if that get's you where you want to be. In an effort to keep this simple. I created an additional virtual-host, with only those stanzas, and get exactly what you're looking for.Code:MultiviewsMatch Handlers Filters
--Chris
TypesConfig etc/apache24/mime.types
/usr/local/etc/apache24/mime.types
Options -Indexes +Includes +FollowSymLinks +SymLinksifOwnerMatch +ExecCGI +$
MultiViewsMatch Handlers Filters
Well, if you're working from a "stock" build/install. Directories can usually be managed relative to the ServerRoot;hac3ru said:Chris_H said:OK. Perhaps I've made too many assumptions here.
---8<---[snip]
I havebut shouldn't it beCode:TypesConfig etc/apache24/mime.types
Code:/usr/local/etc/apache24/mime.types
ServerRoot "/usr/local"
Odd. You are restarting (not reloading) the server, after making these changes. Right?hac3ru said:I also now have:Still not working......?Code:Options -Indexes +Includes +FollowSymLinks +SymLinksifOwnerMatch +ExecCGI +$ MultiViewsMatch Handlers Filters
OK. Unless you've done something out of the ordinary with the rest of your server config. We'll have to look a different direction. But a last note before we do; Assuming you have index.html, and footer.html in the root of your server. If you puthac3ru said:Yeah, you're right. I am usingCode:ServerRoot "/usr/local"
Yes, I am restarting the apache24 server usingservice apache24 restart
If I remember it correctly, I have installed it via the ports tree.
http://yourserver/index
, or http://yourserver/footer
, in the URL bar of your browser. Do you still get a 404? Something also worth noting; you should keep your logs within your editor, so that you can monitor the request(s) being made, as they're being made. This will help you better determine what the/any cause is for experiences you expect, but aren't getting. It'll also help you determine whether your browser is caching the responses -- something you should check. In other words; it's quite possible you're not getting current answers, to current questions. Catch my drift? Please note; that when I speak of the requests to index, or footer, above. I talking html, not PHP. That's important. I also assume, you're using a reasonably smart editor, that checks the files status it has open, on a reasonably frequent basis, and alerts you to those changes. tail -f /var/log/http-access_log
and I can see the request and the 404 returned to the browser.OK. Here's a "last ditch effort". Add the following lines just above the AllowOverride stanzahac3ru said:It doesn't work with test.html. I created a test.html file and I accessed http://localhost/test and it returned: 404 Not found.
In the logs, I have the time of the entry and it is current time. It's not caching, it's the current request.
I also didtail -f /var/log/http-access_log
and I can see the request and the 404 returned to the browser.
# DO NOT ADD THE NEXT LINE UNTIL YOU HAVE TRIED THE FOLLOWING ONE FIRST
AddOutputFilter Includes html xhtml
# TRY THE FOLLOWING ONE ALONE, BEFORE ADDING THE LINE ABOVE
AddHandler type-map var
# In other words, add the one line above. But comment (#) the other
At this point. Given all the messing around with it. I think that's probably a wise move.hac3ru said:Still not working
If I uninstall apache and make a clean install you think I'll have some more luck?
make deinstall
, and make config
, make install clean
. For example; move www to www_old. You can also simply delete all the etc/apache24/* stuff. That way, you can be sure that you actually ARE getting a nice new fresh install. Forgot about PHP. You'll probably need to deinstall the PHP module before you deinstall www/apache2*. But, as long as you don't also deinstall PHP (no point, really), the mysql, and mysql lib for PHP, should not be an issue (don't worry about them).hac3ru said:Okay so I deinstalled apache24, deleted /usr/local/etc/apache24 folder and I have moved /usr/local/www/ to my home folder. Installing apache now. I need the php module loaded and mysqli + hiding extension for php. What should I modify?
Sure. Understood. Good thinking.hac3ru said:I did backed up those files because I had to use the server the night that just passed. I backed up the configs and I have edited the settings so that people will be able to use the server this 12hours+.
Probably not an issue. Have you tested php(1), to see if it works with Apache, as expected? Maybe something like creating the file phpinfo.php in the root of your server, containing:hac3ru said:I did not deinstall php module. Do you think that it will be a problem?
<?php
phpinfo();
?>
http://yourserver/phpinfo.php
, or better; http://yourserver/phpinfo
-- assuming there is no longer a need to provide the extension.