Where is the best place to save cakes.php in Apache web server?

Reply

Join Date: Sep 2009
Posts: 11
Reputation: whiteberry is an unknown quantity at this point 
Solved Threads: 0
whiteberry whiteberry is offline Offline
Newbie Poster

Where is the best place to save cakes.php in Apache web server?

 
0
  #1
Sep 2nd, 2009
Where is the best place to save cakes.php in Apache web server?

I was trying to develop a web page in Dreamweaver, and then save it so that the Apache server runs it in standard browser without fail.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 552
Reputation: khess is on a distinguished road 
Solved Threads: 8
Staff Writer
khess's Avatar
khess khess is offline Offline
Staff Writer

Re: Where is the best place to save cakes.php in Apache web server?

 
0
  #2
Sep 8th, 2009
At first, try it in the document root directory. Later, you can set up a virtual directory for it but for testing try the root directory of apache. The directory is named htdocs.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 1,543
Reputation: ardav will become famous soon enough ardav will become famous soon enough 
Solved Threads: 203
Sponsor
ardav's Avatar
ardav ardav is offline Offline
Anthrax Poster

Re: Where is the best place to save cakes.php in Apache web server?

 
-1
  #3
Sep 8th, 2009
If you're interested in creating a few different webpages, you'll need to set up virtual directories. This isn't as scary as it sounds - you just need to make small changes to two Windows files (I assume you're using Windows).

Your default locahost directory will be (something)/htdocs.

Say you want to set up a new website called "amazing":

In Dreamweaver (in 2004 MX anyway):

1. Create New Dreamweaver Site
2. In the popup, press the Advanced tab.
3. Give the site a name (e.g. amazing).
4. Local root folder -> locate htdocs, then create a subfolder called
amazing. Select this.
5. HTTP address -> http:// localhost/amazing/ (no spaces)
6. Select Test server under the categories list on the left panel.
7. Server model -> PHP MySQL
8. Access -> Local/Network
9. Testing server folder -> C:\xampp\htdocs\amazing\
10. URL prefix -> http:// amazing.local/ (no spaces; or anything you want)

[You could fill the remote info at this point as well if you have a live website]

Be aware, this will not work yet.

Open C:\Windows\System32\drivers\etc\hosts and you should see something like:

  1. # Copyright (c) 1993-2006 Microsoft Corp.
  2. #
  3. # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
  4. #
  5. # This file contains the mappings of IP addresses to host names. Each
  6. # entry should be kept on an individual line. The IP address should
  7. # be placed in the first column followed by the corresponding host name.
  8. # The IP address and the host name should be separated by at least one
  9. # space.
  10. #
  11. # Additionally, comments (such as these) may be inserted on individual
  12. # lines or following the machine name denoted by a '#' symbol.
  13. #
  14. # For example:
  15. #
  16. # 102.54.94.97 rhino.acme.com # source server
  17. # 38.25.63.10 x.acme.com # x client host
  18.  
  19. 127.0.0.1 localhost
  20. ::1 localhost

Append the following to the end of the file:

  1. 127.0.0.1 amazing.local

This must be the same as the name you chose in part 10.

Then open the file: C:\xampp\apache\conf\extra\httpd-vhosts.conf. The location of this file may be slightly different (I'm use XAMPP). You should see something like:

  1. #
  2. # Virtual Hosts
  3. #
  4. # If you want to maintain multiple domains/hostnames on your
  5. # machine you can setup VirtualHost containers for them. Most configurations
  6. # use only name-based virtual hosts so the server doesn't need to worry about
  7. # IP addresses. This is indicated by the asterisks in the directives below.
  8. #
  9. # Please see the documentation at
  10. # <URL:http://httpd.apache.org/docs/2.2/vhosts/>
  11. # for further details before you try to setup virtual hosts.
  12. #
  13. # You may use the command line option '-S' to verify your virtual host
  14. # configuration.
  15.  
  16. #
  17. # Use name-based virtual hosting.
  18. #
  19. ##NameVirtualHost *:80
  20.  
  21. #
  22. # VirtualHost example:
  23. # Almost any Apache directive may go into a VirtualHost container.
  24. # The first VirtualHost section is used for all requests that do not
  25. # match a ServerName or ServerAlias in any <VirtualHost> block.
  26. #
  27. ##<VirtualHost *:80>
  28. ## ServerAdmin webmaster@dummy-host.example.com
  29. ## DocumentRoot /www/docs/dummy-host.example.com
  30. ## ServerName dummy-host.example.com
  31. ## ServerAlias www.dummy-host.example.com
  32. ## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
  33. ## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
  34. ##</VirtualHost>
  35.  
  36. ##<VirtualHost *:80>
  37. ## ServerAdmin webmaster@dummy-host2.example.com
  38. ## DocumentRoot /www/docs/dummy-host2.example.com
  39. ## ServerName dummy-host2.example.com
  40. ## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
  41. ## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
  42. ##</VirtualHost>
  43.  
  44. NameVirtualHost 127.0.0.1

Append the following to the end of the file:

  1. <VirtualHost 127.0.0.1>
  2. DocumentRoot C:\xampp\htdocs\amazing
  3. ServerName amazing.local
  4. </VirtualHost>

OK, that's it for the setup and file edits. You now need to stop the Apache server and then restart it. You may find that you need to do this more than once before the page displays in the browser.

The url will be http: // amazing.local/cakes.php (no spaces)

One problem I've hit with this is that I need a live internet connection even with a local site. haven't got round to working that out yet.

Hope it helps.
Last edited by ardav; Sep 8th, 2009 at 3:26 pm. Reason: insert space to stop example urls from being a link
Twpsyn cythraul. Cawr y dom tarw. Gwybod dim, gofyn dim.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 296 | Replies: 2
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC