help finding "localhost"

no file folder or file

Page 1 of 1

10 Replies - 2639 Views - Last Post: 16 October 2009 - 10:05 AM

#1 Mariko1222   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 19-June 09

help finding "localhost"

Post icon  Posted 10 October 2009 - 08:15 PM

First, I appologize for being dumb as a stick. I am having much difficulties in getting this right.

examples tell me to set the document root (the ini file) to C:/Program Files/Apache Software Foundation/Apache2.2/htdocs", another example tells me to look in the public_html or www file. I don't have either one of those on my computer. I've got a public folder, but there is no html file in there. I know this has got to be simple, I just can't seem to see the forrest through the trees!

Please remember, I am a student, I am just starting this, not an expert like you all.

Thanks,
Mary

Is This A Good Question/Topic? 0
  • +

Replies To: help finding "localhost"

#2 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6821
  • View blog
  • Posts: 31,440
  • Joined: 10-May 07

Re: help finding "localhost"

Posted 10 October 2009 - 08:20 PM

Look for httpd.conf & see what you have configured as your root directory.

Chances are, there is an "it works!" example html file sitting in it.
Was This Post Helpful? 0
  • +
  • -

#3 Mariko1222   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 19-June 09

Re: help finding "localhost"

Posted 11 October 2009 - 09:18 AM

View Postno2pencil, on 10 Oct, 2009 - 07:20 PM, said:

Look for httpd.conf & see what you have configured as your root directory.

Chances are, there is an "it works!" example html file sitting in it.


Thanks no2pencil. This is where the phpinfo.php file was placed. However, when I get on my browser and type in localhost/phpinfo.php, I get the web page error. Any other suggestions that might work?

Mary
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6821
  • View blog
  • Posts: 31,440
  • Joined: 10-May 07

Re: help finding "localhost"

Posted 11 October 2009 - 10:47 AM

View PostMariko1222, on 11 Oct, 2009 - 10:18 AM, said:

when I get on my browser and type in localhost/phpinfo.php, I get the web page error.

As I suggested in this topic, if there is no phpinfo.php file, then you'll be sure to get the error.

Can you verify that the file exists?
Was This Post Helpful? 0
  • +
  • -

#5 Mariko1222   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 19-June 09

Re: help finding "localhost"

Posted 11 October 2009 - 11:37 AM

View Postno2pencil, on 11 Oct, 2009 - 09:47 AM, said:

View PostMariko1222, on 11 Oct, 2009 - 10:18 AM, said:

when I get on my browser and type in localhost/phpinfo.php, I get the web page error.

As I suggested in this topic, if there is no phpinfo.php file, then you'll be sure to get the error.

Can you verify that the file exists?


This is what my httpd.conf says...
#
ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_alias_module modules/mod_authn_alias.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule disk_cache_module modules/mod_disk_cache.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php .html
PHPIniDir "C:/php"



this is what the htdocs file folder contains:
phpinfo.php.html file, index.html file, and a phpinfo.php.txt file.

When I enter http://localhost into my web browser (IE) I get It works!. Then, when I enter http://localhost/phpinfo.php, I get the 404 error code.
I made the phpinfo.php file by opening notepad, entering <?php phpinfo ?> saving as phpinfo.php in the c:/Program Files/Apache Software Foundation/Apache2.2/htdocs with the index file....that comes up as "It works" when I type in localhost into IExplorer.

What other information can I provide for you so you can try to help me?
THanks,
Mary
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6821
  • View blog
  • Posts: 31,440
  • Joined: 10-May 07

Re: help finding "localhost"

Posted 11 October 2009 - 07:55 PM

View PostMariko1222, on 11 Oct, 2009 - 12:37 PM, said:

I made the phpinfo.php file by opening notepad, entering <?php phpinfo ?> saving as phpinfo.php in the c:/Program Files/Apache Software Foundation/Apache2.2/htdocs with the index file....that comes up as "It works" when I type in localhost into IExplorer.

What you are doing is saving the file with the wrong file name (phpinfo.php.html file, index.html file, and a phpinfo.php.txt) & you are requesting phpinfo.php, do you see why this doesn't work? phpinfo.php.html is not the same as phpinfo.php. Plus, in order for the php engine to properly parse (read) a php file, it must have a php extension, & nothing else. It's file type, & file type association. It must be this way.

You need to type the following:
<?php phpinfo(); ?>
& save it (in the same directory) as phpinfo.php, you are getting the 404 because the file simple doesn't exist. You need to create it.
Was This Post Helpful? 0
  • +
  • -

#7 Mariko1222   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 19-June 09

Re: help finding "localhost"

Posted 12 October 2009 - 04:37 AM

View Postno2pencil, on 11 Oct, 2009 - 06:55 PM, said:

What you are doing is saving the file with the wrong file name (phpinfo.php.html file, index.html file, and a phpinfo.php.txt) & you are requesting phpinfo.php, do you see why this doesn't work? phpinfo.php.html is not the same as phpinfo.php. Plus, in order for the php engine to properly parse (read) a php file, it must have a php extension, & nothing else. It's file type, & file type association. It must be this way.

You need to type the following:
<?php phpinfo(); ?>
& save it (in the same directory) as phpinfo.php, you are getting the 404 because the file simple doesn't exist. You need to create it.


Okay, I typed that into notepad. Clicked save as... and gave it the name phpinfo.php and click enter. The computer is adding the .txt to the end. Why is that? And how can I stop it so I can get this course done with?
Mary
Was This Post Helpful? 0
  • +
  • -

#8 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6821
  • View blog
  • Posts: 31,440
  • Joined: 10-May 07

Re: help finding "localhost"

Posted 12 October 2009 - 05:41 AM

It's a default by Windows.

You can do 1 of two things.

1.) Under Notepad, click file->save-as, & change the file type from (*.txt) to (all files).

2.) Use a different text editor, like Crimson Editor.
Was This Post Helpful? 0
  • +
  • -

#9 Mariko1222   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 19-June 09

Re: help finding "localhost"

Posted 12 October 2009 - 05:50 PM

View Postno2pencil, on 12 Oct, 2009 - 04:41 AM, said:

It's a default by Windows.

You can do 1 of two things.

1.) Under Notepad, click file->save-as, & change the file type from (*.txt) to (all files).

2.) Use a different text editor, like Crimson Editor.


Thanks no2pencil, again. I tried with Notepad again, but it still didn't load. So, I downloaded Crimson Editor like you suggested. I made a script, I saved it as a PHP file and when I opened IE, clicked on localhost/test.php, it came up the way it should. A whole page of info! Only one little problem popped up now. When installing Crimson, it told me to turn off all applications running. Now, when I restart Apache, I get the following error...

Only one usage of each socket address (protocol/network address/port) is normally permitted.: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down. Unable to open logs.

Now, what do I do now? Damn, it's always something!
Was This Post Helpful? 0
  • +
  • -

#10 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6821
  • View blog
  • Posts: 31,440
  • Joined: 10-May 07

Re: help finding "localhost"

Posted 12 October 2009 - 06:34 PM

Wow, that sounds like an error with Apache. It should only open a socket when it starts, & it should keep that socket running, so I am at a loss as to what it's doing.

I'll look into this, when I can, but please be patient. Time isn't something that I have a lot of right now.
Was This Post Helpful? 0
  • +
  • -

#12 theprofessor102   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 5
  • Joined: 17-September 09

Re: help finding "localhost"

Posted 16 October 2009 - 10:05 AM

View PostMariko1222, on 10 Oct, 2009 - 07:15 PM, said:

First, I appologize for being dumb as a stick. I am having much difficulties in getting this right.

examples tell me to set the document root (the ini file) to C:/Program Files/Apache Software Foundation/Apache2.2/htdocs", another example tells me to look in the public_html or www file. I don't have either one of those on my computer. I've got a public folder, but there is no html file in there. I know this has got to be simple, I just can't seem to see the forrest through the trees!

Please remember, I am a student, I am just starting this, not an expert like you all.

Thanks,
Mary


Attached Image

VISTA:
c:\windows\system32\drivers\etc

There a file called hosts and its in all computers and all servers.
Servers /etc
windows c:\windows\system32\drivers\etc

Above is a picture of my host file.
Hosts defines what localhost ip address is or other ip addresses
127.0.0.1 localhost
192.168.1.1 router
192.168.1.10 mybox
etc. etc.etc.

localhost points to the host computer.
If I ping localhost it will goto address 127.0.0.1 which is your computer.

or If your running apache on that computer and its setup correctly.

start, run and type in http://localhost and your website should come up.

hope this helps.

This post has been edited by theprofessor102: 16 October 2009 - 10:10 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1