PDA

View Full Version : [ubuntu] 11.10 Web Server help



coyote39
February 8th, 2012, 11:39 PM
I am having some issues while trying to set up apache web server. I was able to set up and configure the server so that I could access index.html under the /var/www/ on my local network and get the correct "It Works!" message. I then set up a folder under /var/www/ for mediawiki, and installed that. I can also access that from local network. However, I can't access /var/www/index.html or mediawiki from external, either using IP or domain name (which is registered and pointing correctly to the server). My router is configured correctly, and allows access to the required incoming ports for the server, so I know that this is not a DNS/router issue. This is part 1 of my problem.

While trying to troubleshoot, I have now found that, even using the local network, when I try to browse to /var/www/index.html, browser is asking to download the index.html and not display it. However, I can still get to mediawiki with no problems using 192.168.1.xxx/mediawiki.

I have looked into the access logs at both the external access attempts and internal access attempts, and the only thing there on local attempts is:

"GET /favicon.ico HTTP/1.1" 404 504 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7"

on remote attempts, I get the same, except the two three-number codes (which I think are the error codes) are 200 and 488 instead.

There is nothing in the apache error log except for the favicon.ico error and the notices for when I restarted apache or the server.

I created a info.php file under /var/www/ and browsed internally, and it displays my php info fine. I deleted the index.html and recreated it, and am getting the same issue.

To be honest, I am pretty much a complete noob to ubuntu and server admin in general. If someone could please help me out, I would be much appreciative of the time and effort to help and teach me. Thanks in advance for your time and effort.

EDIT: Found that I could browse externally to the /var/www/info.php file as well, and is looking fine for that.

Doug S
February 9th, 2012, 12:35 AM
"GET /favicon.ico HTTP/1.1" 404 504 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7"
The first number, 404, is the HTML return code. 404 means file not found, so I assume you do not have a favicon.ico file, which many sites do not.

on remote attempts, I get the same, except the two three-number codes (which I think are the error codes) are 200 and 488 insteadIn this case the first number, the HTML return code, means O.K.
The second number is the number of bytes that was retuned. More on HTML return code. (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)

I hope this helps, and welcome to Ubuntu forums.

coyote39
February 9th, 2012, 02:53 AM
It does help to know what the codes mean.

So, judging by the access/error logs, everything seems to be ok, at least on the connection part (forgive me, I'm pretty new to this). However, I have no idea why when someone connects externally or internally, it wants to download the index.html instead of displaying it in the browser. Is something wrong with the permissions (just guessing here), or is there something deeper with the file type itself not being set up? Because I can hit the info.php file located in the same folder fine, both internally and externally.

Also - maybe this will help someone figure out the issue - if I try to connect externally to the wiki that I have set up, it doesn't work. It does work internally though. I am truly lost here, and cannot figure this out at all. I don't know why it would be able to connect to some files (php) externally and internally, not display others in the browser, and not connect to other folders/files externally, but can internally...

If anyone can offer advice on where to start looking for the issue, I would greatly appreciate the help.

Thanks for the welcome!

Doug S
February 9th, 2012, 07:18 AM
have no idea why when someone connects externally or internally, it wants to download the index.html instead of displaying it in the browser. Is something wrong with the permissions (just guessing here), or is there something deeper with the file type itself not being set up?Yes, that seems very odd. I do not think it is a permissions issue, as that would, or at least should, give a forbidden (or similar) type HTML return code. It does sound as though, somehow, apache does not know that a .html file is a web page. On my server I tried to create your situation but was unable to (I did not try very hard). It is as though the .html does not map to the MIME-type text/html. Perhaps check your /etc/mime.types file.

This should all work "right out of the box" so perhaps tell us more about any changes you made from the default configuration. Perhaps some AddHandler directive or a FilesMatch and embedded SetHandler directive that overrides the normal mapping (and now I am guessing).

I am not familar with mediawiki or what it might have done during it's installation.

coyote39
February 9th, 2012, 07:31 PM
Checked my mime.types - seems like all the types containing html are good. Here is what I have, just in case something is not right:

application/xhtml+xml xhtml xht
application/vnd.pwg-xhtml-print+xml
application/x-httpd-eruby rhtml
application/x-httpd-php phtml pht php
text/html html htm shtml
text/x-server-parsed-html

There are no entries for application/vnd.pwg-xhtml-print+xml or text/x-server-parsed-html. I don't know if there is an issue with these or not. I'm almost ready to give up and wipe the server and start over.

Thanks for the time and effort you have given so far.