Author |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
Posted: Fri 06 Apr '12 23:51 Post subject: |
|
|
<html>
<head>
<title>PHP Test File</title>
</head>
<body>
<P> This is HTML</P>
<?php
Echo "\"Hello, World!\" this is PHP from \"wamp/www\" site folder";
?>
</body>
</html> |
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Sat 07 Apr '12 0:24 Post subject: |
|
|
So, if u change:
Echo "\"Hello, World!\" this is PHP from \"wamp/www\" site folder";
into:
echo "This is a test.";
everything works just fine? |
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
Posted: Sat 07 Apr '12 1:10 Post subject: |
|
|
A little progress.
That worked in both vhosts.
There is a index.html and a index.htm in skip directory and neither will load.
In the htpd.conf, there is this:
<IfModule dir_module>
DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>
It's my understanding if any index.* exists it loads automatically load. They don't.
If use http://skip/index.html, I get the error message below.
The requested URL /index.html was not found on this server. |
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Sat 07 Apr '12 14:08 Post subject: |
|
|
With the way you explain it, I feel when u type http://skip/, it does not go to the directory you wish.
If you're up for it, can u provide a link to your httpd and vhost file that is accessible to us, and provide a singly setup you wish to accomplish? i.e. Address you want to go to given directory. I could take a look, and provide you with a link to what I would set up if u would like to try my files.
You can make both your files text files for us to access, or if you do not offer WAN access to your server, you can post the items on http://pastebin.com/ |
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Sat 07 Apr '12 14:09 Post subject: |
|
|
Oh, and another quick question. 'skip' is the name of your server machine, correct? |
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
Posted: Sat 07 Apr '12 15:08 Post subject: |
|
|
Thanks all
Since this is a local server om my computer, I can not able to give a link. ( next step is to access from network and outside.)
WAMP is a single file that installs Apache Mysql and PHP very nicely. The server does not have a "name".
Http://skip gives the configuration screen.
Http://skip/php_test.php reads PHP
Http://skip/index.html - The requested URL /index.html was not found on this server.
With WAMP reading PHP in "skip" and "wamp/www" dir's, I have added another vhost "melendy/gen" which is PHP.
http:/melendy/php_test.php - reads html ok
http://melendy/index.html
error - The requested URL /gen/php_test.php was not found on this server.
http://melendy/gen/php_test.php -
error: The requested URL /gen/php_test.php was not found on this server.
I'm not sure how you find my file on paste.bin
username is rob62. Title is "vhosts.conf" |
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Sat 07 Apr '12 15:16 Post subject: |
|
|
pastebin just offers u the address at top when u post. Here is the httpd and vhost file I set up from scratch, and deleted quite a bit of un-needed items to shorten it. I do suggest you use your www directory for everything. This will make a ton easier. Just because everything will be in the same directory does not mean they have any access to one another. Once everything is set up fine, an index.html file in your root directory SHOULD NOT be accessible.
These files are not from a WAMP install, but from the straight out apachelounge install.
http://www.hellzoneinc.com/httpd.conf.txt
http://www.hellzoneinc.com/httpd-vhosts.conf.txt
I would make 1 folder for each to-be directory and place an index.html file in each. Make that index.html file read to the browser something like "You are currently in the ... directory." to help you visually see where your browser is hitting. |
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
Posted: Sat 07 Apr '12 15:29 Post subject: |
|
|
http://pastebin.com/u/rob62
I looked at the links you sent. It shows all websites below "wamp/www"
putting multiple websites here will not work with Dreamweaver.
I really need:
g:\skip
g:\melendy\gen |
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Sat 07 Apr '12 16:37 Post subject: |
|
|
you can comment out one of your 'NameVirtualHost *:80' lines since you have 2 defined.
Make these your 3 vhosts:
Code: | <VirtualHost *:80>
DocumentRoot g:/wamp/www
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "g:/skip"
ServerName skip.localhost
errorLog "g:/skip/logs/skip-error.log"
CustomLog "g:/skip/logs/skip-access.log"common
</VirtualHost>
<VirtualHost *:80 >
DocumentRoot "g:/melendy/gen"
ServerName melendy.localhost
errorLog "g:/melendy/gen/logs/gen-error.log"
CustomLog "g:/melendy/gen/logs/gen-access.log"common
</VirtualHost> |
Adjust your ServerName melendy/gen.localhost line. The address http://melendy.localhost/ should then point you into your G:/melendy/gen directory. |
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
Posted: Sat 07 Apr '12 19:27 Post subject: |
|
|
Deleted one' NameVirtualHost *:80'
I made all the changes in vhosts. Noticed I didn't capitolize some letters.
http://melendy.localhost/
error
Firefox can't find the server at www.melendy.localhost.
|
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Sat 07 Apr '12 21:03 Post subject: |
|
|
U haven't defined any www.melony.localhost
Code: | <VirtualHost *:80 >
DocumentRoot "g:/melendy/gen"
ServerName melendy.localhost
ServerAlias www.melendy.localhost
errorLog "g:/melendy/gen/logs/gen-error.log"
CustomLog "g:/melendy/gen/logs/gen-access.log"common
</VirtualHost> |
If this doesn't work, you are probably missing a line in your DNS server.
Side note: Here and there you need to capitalize some letters, but try your hardest not to capitalize anything of your own. Everything is best if kept lowercase. |
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
Posted: Sun 08 Apr '12 2:54 Post subject: |
|
|
I checked for caps in lines of code.
Why do you add www in ServerAlias www.melendy.localhost
Adding www does not help.
Firefox can't find the server at www.melendy.localhost.
host file
127.0.0.1 localhost
127.0.0.1 melendy
127.0.0.1 skip
<VirtualHost *:80 >
DocumentRoot "g:/melendy/gen"
ServerName melendy.localhost
ServerAlias www.melendy.localhost
ErrorLog "g:/melendy/gen/logs/gen-error.log"
CustomLog "g:/melendy/gen/logs /gen-access.log"common
</VirtualHost>
I been having problems connecting to apachelounge today. It will ping but not load. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sun 08 Apr '12 5:26 Post subject: |
|
|
No, .. since
Quote: | host file
127.0.0.1 localhost
127.0.0.1 melendy
127.0.0.1 skip |
It will find
http://localhost
http://melendy
http://skip
it can find anything you want as long as it matches what you put in the hosts file |
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Sun 08 Apr '12 14:03 Post subject: |
|
|
Yep. So, in your host file, also added:
127.0.0.1 www.melendy
If you really wish, you can add:
127.0.0.1 www.mysite.com
to your host file, and browsing to this address will direct your browser to your local webserver. Just note that it is not really recommended to use such addresses on a local setup. So, in the end, every address you wish your sites to START with, must be added to this file. Anything after the / does not go in this file. |
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Tue 10 Apr '12 2:12 Post subject: |
|
|
If you put an index.html in your /gen/ folder, does that successfully display? It's sounding your 'gen' folder is not in the same directory as your root http://melendy/ is pointing to. Do you have a vhost record for each of the melendy addresses, or just the root?
Also do 1, if not each of these for testing sake. Place a PHP file in each directory with the following scripting:
Code: | <?php
echo getcwd();
?> |
Then, when the scripting posts, confirm it is the correct directory.
The other item, allow directory browsing, and make sure you have no index file in your melendy folder. Go to http://melendy/ and see if in the directory listing, there is a 'gen' folder. |
|
Back to top |
|
rob62
Joined: 22 May 2007 Posts: 54 Location: mi
|
Posted: Tue 10 Apr '12 17:09 Post subject: |
|
|
127.0.0.1 localhost
127.0.0.1 test
127.0.0.1 skip
127.0.0.1 melendy
127.0.0.1 melendy.localhost
I put php.php file in each folder and this is the results.
No index.* files load automatically.
http://melendy/php.php = G:\Wamp\www
http://melendy/gen/php.php = The requested URL /gen/php.php was not found on this server.
http:/skip/php.php = G:\Wamp\www
http:/test/php.php = G:\Wamp\www
http:/localhost/php.php = G:\Wamp\www
http://melendy/index.php = WAMP configuration screen
"It's sounding your 'gen' folder is not in the same directory as your root http://melendy/ is pointing to."
gen folder is a folder under melendy
Http://melendy/gen is a php genealogy web program. |
|
Back to top |
|
Triple_Nothing
Joined: 01 Apr 2012 Posts: 39 Location: WI, USA
|
Posted: Tue 10 Apr '12 19:26 Post subject: |
|
|
Aight. All your sites are hitting the same directory, so this means vhosts isn't running at all, and each request is being directed at the default directory. This is good, as odd as that sounds. Just provide me the base addresses u want to work, and the directory you wish them to hit. I'll toss a vhosts file together for you to compare, and all should be set. *crosses his finger* |
|
Back to top |
|