| | |
Where is the best place to save cakes.php in Apache web server?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2009
Posts: 11
Reputation:
Solved Threads: 0
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.
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.
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.
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:
Append the following to the end of the file:
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:
Append the following to the end of the file:
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.
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:
PHP Syntax (Toggle Plain Text)
# Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost ::1 localhost
Append the following to the end of the file:
PHP Syntax (Toggle Plain Text)
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:
PHP Syntax (Toggle Plain Text)
# # Virtual Hosts # # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.2/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # Use name-based virtual hosting. # ##NameVirtualHost *:80 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # ##<VirtualHost *:80> ## ServerAdmin webmaster@dummy-host.example.com ## DocumentRoot /www/docs/dummy-host.example.com ## ServerName dummy-host.example.com ## ServerAlias www.dummy-host.example.com ## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log ## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common ##</VirtualHost> ##<VirtualHost *:80> ## ServerAdmin webmaster@dummy-host2.example.com ## DocumentRoot /www/docs/dummy-host2.example.com ## ServerName dummy-host2.example.com ## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log ## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common ##</VirtualHost> NameVirtualHost 127.0.0.1
Append the following to the end of the file:
PHP Syntax (Toggle Plain Text)
<VirtualHost 127.0.0.1> DocumentRoot C:\xampp\htdocs\amazing ServerName amazing.local </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 4:26 pm. Reason: insert space to stop example urls from being a link
Happy Humbugging Christmas
![]() |
Similar Threads
- Production Lever web server (Linux Servers and Apache)
- How can I build a web server using IP addresses instead of localhost (Windows Servers and IIS)
- working PHP with Apache is it posssible (PHP)
- "odbc_fetch_array()" compatible with wich version of PHP with apache web server (PHP)
- Starting A New Web Server Need Help (Networking Hardware Configuration)
- How ti detect whether PHP is installed or not? (PHP)
Other Threads in the PHP Forum
- Previous Thread: How to configure Mozilla Firefox in using PHP
- Next Thread: Could someone center these images please? :)
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess 301 access ajax apache api array beginner binary broken cakephp checkbox class cms code compression cron curl database date directory display download dropdown dynamic echo email error file files folder form forms function functions google href htaccess html httppost image include insert integration ip java javascript joomla limit link login loop mail md5 menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search secure select server sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video votedown web xml youtube






