Forum Moderators: phranque

Message Too Old, No Replies

Apache Setup for Network Access

         

ddavidian

12:12 am on Dec 6, 2011 (gmt 0)

10+ Year Member



Folks,

A quick question...trivial to most I am sure: I am running Centos6, stock Apache, mysql. I have a static database, accessed via a web front end (PHP + mysql interface) that works just fine on the server, but externally the test script works until it's time to serve up the individual file the database points to. The files I want to display are in /var/www/html and are owned by apache.

I have not touched /etc/httpd/conf/httpd.conf.

What have I overlooked? Thanks

phranque

2:29 am on Dec 6, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, ddavidian!

the first thing you have overlooked is your problem statement.
when you state that something "doesn't work" you need to provide a clue about how that failure manifests itself.
for example:
error messages displayed in the browser or nothing at all?
server access or error log file entries?

ddavidian

3:58 am on Dec 6, 2011 (gmt 0)

10+ Year Member



Hi phranque,

Yes, I was very remiss in my description!

I have an mysql database that will return a list of files and other items associated with each file such as Date: and Subject: These items are pushed via a PHP script into the user display and looks like something akin to a simplified google search result. There may be as little as 1 or as many as 5000+ entries. On the server console when the file's Subject: line (a highlighted html link) is clicked, the server prints the contents of that file. That is what I refer to as working correctly. What doesn't appear to function is when the process is repeated over the internet. An error comes up when the link is clicked. Initially, my server sends a page where a simple text query is made. Over the internet, when the same search information is entered (as I would on my server console) and a list of links are displayed, upon clicking on a link which would display a text file, the file will not display -- but rather -- an error message is displayed whose content depends on the browser in use. Since I posted my initial inquirey, I tried my Droid phone and it reported that file: [localhost...] .../filename.txt can't be found.

Also, since I posted my first question, a friend reported that when he tried accessing the site he got an error leading him conclude that a request was being made for the file on his machine as "localhost" rather than the file on my machine. I have my router perform a port translation 8080 -> 80, so I can do all this at my at my home office (my ISP shuts off port 80). This is all an attempt to elicit feedback from typical users and refine the html/PHP code to eventually host it at normal web hosting site.

Thanks

phranque

4:23 am on Dec 6, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you are using the wrong hostname in the href attribute for those links.
"localhost" is a reserved name and should work when you are accessing a server on the "local host".
it's essentially the same as requesting the reserved IP address 127.0.0.1.
you need to provide an actual correct IP address for your server or a hostname that can be resolved using a DNS.

ddavidian

12:38 pm on Dec 6, 2011 (gmt 0)

10+ Year Member



phranque,

Thanks!