Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-23-2012, 10:46 PM   PM User | #1
esolve
New Coder

 
Join Date: Oct 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
esolve is an unknown quantity at this point
access local html page through "file:///"

I installed LAMP
and I want to use ajax to write some client information into mysql server on the server side.
I want to test a anonymous browser.
however, with this browser, pages like "http://localhost/test.html" can't be accessed because the browser can't establish a connection to the server at localhost.
but it can access the page through: file:///var/www/html/test.html

however, my intention is to use ajax to write some client information into mysql server on the server side, so through file:/// can't achieve this goal,
are there any potential solutions for this?
thanks!
esolve is offline   Reply With Quote
Old 10-24-2012, 06:16 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Sounds to me that your apache isn't running. You can also try simply attaching to http://127.0.0.1 in case localhost isn't redirected to loopback for whatever reason. If that still doesn't work, check your lamp console (assuming they have one), or check your services to make sure that the apache is running.
file:// is pretty much useless. It works for .html since the browser knows how to interpret .html files. You need to go through http in order to interact at a server level.
Fou-Lu is offline   Reply With Quote
Old 10-24-2012, 11:36 AM   PM User | #3
esolve
New Coder

 
Join Date: Oct 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
esolve is an unknown quantity at this point
it is running, but the browser has some settings that disallow it to access localhost
I'm just wondering whether it is possible to log client information to the server sql database if I use "file:///"

Quote:
Originally Posted by Fou-Lu View Post
Sounds to me that your apache isn't running. You can also try simply attaching to http://127.0.0.1 in case localhost isn't redirected to loopback for whatever reason. If that still doesn't work, check your lamp console (assuming they have one), or check your services to make sure that the apache is running.
file:// is pretty much useless. It works for .html since the browser knows how to interpret .html files. You need to go through http in order to interact at a server level.
esolve is offline   Reply With Quote
Old 10-24-2012, 02:24 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
No, you can't execute any server commands when accessing via file. Enable your browser access to localhost if you want to use a server side language.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:50 AM.


Advertisement
Log in to turn off these ads.