logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: problem with vhosts Page Previous  1, 2, 3, 4  Next
Author
rob62



Joined: 22 May 2007
Posts: 54
Location: mi

PostPosted: Fri 06 Apr '12 23:51    Post subject: Reply with quote

<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

PostPosted: Sat 07 Apr '12 0:24    Post subject: Reply with quote

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

PostPosted: Sat 07 Apr '12 1:10    Post subject: Reply with quote

A little progress.Very Happy
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

PostPosted: Sat 07 Apr '12 14:08    Post subject: Reply with quote

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

PostPosted: Sat 07 Apr '12 14:09    Post subject: Reply with quote

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

PostPosted: Sat 07 Apr '12 15:08    Post subject: Reply with quote

Thanks all Very Happy Very Happy Very Happy

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

PostPosted: Sat 07 Apr '12 15:16    Post subject: Reply with quote

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

PostPosted: Sat 07 Apr '12 15:29    Post subject: Reply with quote

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

PostPosted: Sat 07 Apr '12 16:37    Post subject: Reply with quote

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

PostPosted: Sat 07 Apr '12 19:27    Post subject: Reply with quote

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.

Sad
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Sat 07 Apr '12 21:03    Post subject: Reply with quote

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

PostPosted: Sun 08 Apr '12 2:54    Post subject: Reply with quote

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

PostPosted: Sun 08 Apr '12 5:26    Post subject: Reply with quote

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

PostPosted: Sun 08 Apr '12 14:03    Post subject: Reply with quote

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

PostPosted: Sun 08 Apr '12 22:37    Post subject: Reply with quote

These are now reading php
http://localhost
http://melendy
http://skip



http://melendy/gen/php_test.php

The requested URL /gen/php_test.php was not found on this server.
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Tue 10 Apr '12 0:27    Post subject: Reply with quote

Ok, so http://melendy/ works just fine, but http://melendy/gen/php_test.php does not. The file that successfully shows from your http://melendy/ address, is the 'gen' folder in the same folder as this file?
Back to top
rob62



Joined: 22 May 2007
Posts: 54
Location: mi

PostPosted: Tue 10 Apr '12 1:00    Post subject: Reply with quote

I have 2 sites here


http://melendy - html

http://melendy/gen - php doesn't work

There is a php_test.php file in each.




http://melendy-mi.us - html

http://melendy-mi.us/gen - php

There is a php_test.php file in each.

PHP works on the website.
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Tue 10 Apr '12 2:12    Post subject: Reply with quote

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

PostPosted: Tue 10 Apr '12 17:09    Post subject: Reply with quote

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

PostPosted: Tue 10 Apr '12 19:26    Post subject: Reply with quote

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* Razz
Back to top


Reply to topic   Topic: problem with vhosts View previous topic :: View next topic
Post new topic   Forum Index -> Apache Page Previous  1, 2, 3, 4  Next