Server not servering random files - apache

I currently run on Ubuntu 14.04.1 LTS. I'm not a server admin by any means, and just really have basic setup/config knowledge. I got a virtual box so I could learn more. Unfortunately, I just took a bit of a leap and screwed everything up.
I'm running Apache2, PHP, MySQL. This morning, I got a prompt saying I could update my server. I wasn't thinking and decided to go through with it. In addition to completely screwing up my server settings, I'm pretty sure I've lost data. But first I need to get my server running properly again (and probably never update without paying someone to do it for me).
I got most things up and running, but now when I go to my site (gamersplane.com), some paths end up 404'ing, and going to the Apache 404 instead of hitting the htaccess. The way I have it setup, the htaccess should get all files (barring things like css, js, images, xml, etc), and direct it all to a file called dispatch.php which processes the url and determines what to do/load. Basically, some stuff goes to the htaccess, other stuff isn't. I'm not sure why.
Mainly, files directly under /javascript won't load, but files in subfolders of /javascript do. In addition, going to /tools (folder exists) works, but /tools/cards (folder doesn't exist) doesn't. Strangely though, /forum (folder exists) and /forum/3 (doesn't exist) both work. I can't figure out when things do or don't work (systematically).
apache.conf: http://pastebin.com/A3J4bXE3
gamersplane.conf: http://pastebin.com/TAD06h59
Update
I found out about package called javascript-common which forces /javascript to search elsewhere. I uninstalled the package, and JavaScript is now loading. I'm told I need the package, but I don't know why.
This still doesn't solve why some other paths don't work.

Related

Apache (wamp) server redirecting to old url

I had a server running WAMP, that served many phpBB forums. The HD went dead in 2010, but recently i was able to recover the whole data.
I put the old installation dir /wamp/ on same path it was before, run wampmanager.exe, server goes up and the website and the forums work fine as they were like in 2010. However, one of them was successful, and that one specifically don't work normally.
The directory structure is:
/AllSites/Foo/
/AllSites/Bar/
/AllSites/GoodSite/
/AllSites/ is an auto-generated apache index, that shows the forum folders (Foo, Bar, GoodSite).
When i navigate to to localhost/AllSites/GoodSite/, i see the browser requesting from http://old.no-ip.url/AllSites/GoodSite, and not from localhost, until it obviously timeouts.
Naturally, i went to GoodSite's phpBB configuration to check if the old.no-ip.url was being set somewhere. Not there, and not via MySQL search for old.no-ip.url string (phpBB actually only asks for /path/, not domain). So i tried to navigate manually to http://localhost/AllSites/GoodSite/index.php and my surprise, entering like that the site works fine and always stay at localhost.
That made me abandon phpBB as the cause of the issue and focus on Apache (i can even remove index.php from /GoodSite/ and it redirects).
Next thing, i went to .htaccess in /AllSites/ and saw Redirect permanent /AllSites/GoodSite http://old.no-ip.url/AllSites/GoodSite. I removed the line, restarted server, refreshed browser cache, but nothing. It always try to go to the old url when navigating to the GoodSite folder.
So i searched for old.no-ip.url in the whole xamp directory (maybe an alias set somewhere) and subdirectories files', for no result (using Notepad++ "Find in Files" option).
So what can be causing this? The only thing that could be redirecting at server level would be apache or maybe php. But there's no such setting, as the Notepad++ search confirmed. Maybe there is something cached? I ran out of solutions. I even tried deleting the .htaccess files.

Cannot Get Index.html File Changes to be Read (Apache 2.4)

So I am at my wits end with this problem of trying to configure a simple Apache Web Server for one of my assignments. For some reason my changes to index.html are no longer being read, even though I got it to change previously.
I had this problem previously, where I would change index.html and it would still show the default "It works!" message. It ended up that, because my file extensions weren't shown, I had accidentally named the file index.html.html, and so obviously it wasn't locating it.
However, now that my file extensions are showing, I am having this problem again (the last fiasco was about a week or two ago). I tried changing the contents of index.html again, just a simple text change, and it is still loading my previous page. I have tried restarting Apache through Administrative Tools > Services since the Apache and httpd commands in the command line won't work for me. I even tried deleting the index.html file and leaving htdocs empty and it's still displaying my old web page!!!
I have no idea why it's doing this and I can't find any other answers. I checked my DirectoryRoot and DirectoryIndex values and they all point to index.html (and plus, I haven't touched httpd.conf since installation anyways). Running Windows 8.1. Any help greatly appreciated.
Modern Windows has a feature that copies some files when non-administrator edit them. You see the changes, but the service doesn't. Try editing your files as Administrator (not just someone with Administrator group privileges)

can't open fossil repo over web

I've been strugling for a couple of days with this problem, but can't seem to fix it, I think I'm almost there.... but... not quite :(
This is where I am at.
I'm on a headless debian server, running virtualmin / webmin for creating my domains / users etc. I don't know if this will mess things up, but I'm happy to modify the config files manually (via webmin or via ssh/vim).
I am attempting to run fossil as a cgi service over apache.
its an internal site, named as homeserver.net I can reach the default pages just fine, and add in and create links etc as I want to.
Please note that the solution to my problem is at the end of the question.
so the files are located on disk at, which tallys up with my apache document root
/home/homeserver/www
I would like to run fossil to have both the internal site, and later on and dev work that I practice on in separate files. So I created a new directory for these repositories.
/home/homeserver/repos/web/site.fossil
/home/homeserver/repos/dev/ [no repository yet!]
reading the instructions on the fossil page I have inserted a short cgi file called 'fos_repo.cgi' that reads as.
#!/usr/bin/fossil
directory: /home/homeserver/repos
notfound: http://www.homeserver.net/site404.htm
when I open the link to
www.homeserver.net/cgi-bin/fos_repo.cgi
I get redirected to the 404 page that I have written. So the script is clearly being read and working.
From reading the fossil pages I understand that I should be able to use the following link to open/access the repo.
www.homeserver.net/cgi-bin/repos/web/site
I'm not sure why this isn't working...
so far I have tried the following.
I opened the repository from the cli, and had the server run in the background
fossil server site.fossil &
I though maybee the file should have been inside the main repo directory, not inside a sub directory, so I moved it... it now lives in
/home/homeserver/repos/site.fossil
I tried creating an alias to the file in apache
Alias /home/homeserver/repos/web/site.fossil /home/homeserver/www/repos
When I browse to
www.homeserver.net/repos/site
I get nothing, but going to
www.homeserver.net/repos/site.fossil
will attempt to downloaded the file (which is a binary)
so I think I'm getting somewhere, but I'm not sure what I'm missing.
I've used fossil before, but I ran it as a local server, and started it up as and when I needed it.
I'm running it like this so as I can eventually push the site out to a live VPS (maybe even finish up hosting the fossil site on the VPS also).
ps I really liked fossil when I used it before, and loved the whole integrated wiki and bug tracker, and the fact I could simply copy the file to my external drive to do a backup. Personally don't really want to change to something else, but if I have to....
thanks in advance.
David
Edit: trying other options.
So I thought I would try the single repository method shown on the fossil page, so adjusted my cgi script accordingly.
Now when I navitage to : www.homeserver.net/cgi-bin/fos_repo.cgi I get the following message returned
SQLITE_CANTOPEN: cannot open file at line 30276 of [f5b5a13f73]
SQLITE_CANTOPEN: os_unix.c:30276: (21) open(/home/homeserver/repos)
however if I ssh to the server an start it manually with
fossil server site.fossil
I can get to the server with www.homeserver.net:8081
So I either have a problem with my SQLite usage in apache or something else wrong. Plesse help
Solution
So for reasons of simplicity I've decided that using a single cgi file for each repo is what I am going to go with.
My initial directory structure was as follows:
/home/homeserver/www
/home/homeserver/www/repos
/home/homeserver/www/repos/web # for web site development
/home/homeserver/www/repos/dev # for other development
I think part of my problem was that I was hoping that having the directory: pont to my repos/ location fossil would find the site.fossil file (located in repos/web) and the dev.fossil file (located in repos/deb).
Obviously this didn't work.
The reason I wanted it too look like this was for separation of the information on my system.
For some reason I had decided that pointing fossil as repos/ would give me a nice fossil style front page and links to my repositories automatically. However After having used the directory: version and getting the following error message
Unable to find or open the project repository
I realised that I was still going to need to write my front page to the repositories, and that my expectation was a little too much.
So I've decided to run with a single cgi file pointing to each repo that i need to make.
Instead of
www.homeserver.net/cgi-bin/repos/web/site
try
www.homeserver.net/cgi-bin/repos.cgi/index
Reading your ( very long ) question again, I suggest trying
www.homeserver.net/cgi-bin/fos_repos.cgi/index

Apache strange behaviour: page loads even when request points to non-existing file

A client has a website running on a dedicated host (either developed, nor managed by myself) in which Apache is generating a very strange behavior.
When the requested url is of the type:
http://obituarieshelp.org/aboutus.html/whatever_here
it actually loads 'aboutus.html' if it exists, even though 'whatever_here' does not exist, and 'aboutus.html' is not a directory.
I took a look at the htaccess file, and everything seems to be fine. I am sure it is apache misconfigured somehow, but for the love of me, I cannot seem to find anything that could point to the problem in httpd.conf
Has anyone experienced the same, or has any suggestions as to why this would be?
This is controlled by the AcceptPathInfo HTTPd directive. The remainder of the path after the file is made available in the PATH_INFO environment/server variable, and scripts can use it to discern additional information about the request.

Updating Files on Apache

I'm having trouble with my Apache Web Server. I have a folder (htdocs\images) where I have a number of images already in place. I can browse them and see them on my web server (and access them via HTML). I added a new image in there today, and went to browse to it, and it can't be found. I double and triple checked the path and everything. I even restarted Apache and that didn't seem to help.
I'm really confused as to what's going on here. Anybody have any suggestions?
Thank you.
Edit I just turned on the ability for the images directory to be listed, browsed to it (http://127.0.0.1/images/) and I was able to see all the previous images that were in the folder, but not the new one.
Turn directory indexes on for htdocs\images, remove (or move out of the way) any index.* files, and point your browser at http://yoursite/images/
That should give you a full listing of files in that directory. If the file you're looking for isn't there, then Apache is looking at a different directory than you think it is. You'll have to search your httpd.conf for clues -- DocumentRoot, Alias, AliasMatch, Redirect, RedirectMatch, RewriteRule -- there are probably dozens of apache directives that could be causing the web server to get its documents from somewhere other than where you think it's looking.
make sure the caSE and spelling are 100% correct.
There is not magic in programming (some may disagree:), so look for silly errors. Wrong server? Case of your letters? Wrong extension?
There's a chance it could be due to the cookies stored on your device. I would delete all cookies to the website you're working on before you refresh again