Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Virtual Host Question

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  First attempt to rewrite - critics please  
Author Message
abuse6

External


Since: Jun 07, 2004
Posts: 18



(Msg. 1) Posted: Wed Jul 07, 2004 11:30 am
Post subject: Virtual Host Question
Archived from groups: alt>apache>configuration, others (more info?)

I am setting up my Mandrake 10 station as a development machine for
web sites. I generally use PHP for these types of sites.

I want to setup my machine to allow virtual directories as websites.
For example under Windows, I have the following directory structure:
d:\projects - with the sites underneath \site1\website,
\site2\website...

So for site1, I'd have c:\projects\site1\website\index.php as my main
file. I'd setup a virtual directory in IIS as http://kai/site1, which
woudl point to that index.php

Under Linux, I think I've almost got it. I have the following
direcotry structure...

\projects\site1\website.

I setup my /etc/httpd/conf/VirtualHost.conf file to have the
following:

<VirtualHost kai>
DocumentRoot /projects/site1/website
ServerName site1
</VirtualHost>

I'm not sure if I need to change the hosts file or not - do I?

Anyway, when I go to the browser, I type in http://kai/site1 and I get
a Permission denied error. It does find the page, but doesn't allow me
to load it. What do I need to do. The directory is set for 777
permissions.

Also, what do I need to use to make this easy? I want to add many more
virtual sites on my machine. Is there a configuration tool under
Mandrake 10? I haven't been able to find one as yet.

TIA
kai
www.perfectreign.com || www.filesite.org
g2004 at g3prod.cotse.net

 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
mykec

External


Since: Sep 25, 2004
Posts: 11



(Msg. 2) Posted: Thu Jul 08, 2004 12:39 am
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

filesiteguy wrote:

 > Anyway, when I go to the browser, I type in <a style='text-decoration: underline;' href="http://kai/site1" target="_blank">http://kai/site1</a> and I get
 > a Permission denied error. It does find the page, but doesn't allow me
 > to load it. What do I need to do. The directory is set for 777
 > permissions.

My guess is that you've got no index.html or index.php file in the
directory.

What username is your Apache configured to use? "nobody"? "httpd"?

What user and/or group owns the DocumentRoot directory and/or the
directories and files contained therein?

Do *not* grant "world write access" to the directories and files in your
DocumentRoot.

 > Also, what do I need to use to make this easy? I want to add many more
 > virtual sites on my machine. Is there a configuration tool under
 > Mandrake 10? I haven't been able to find one as yet.

Use your existing virtual host "stanzas" as templates for all the rest.

Copy and paste.

Use vi.

Don't develop dependencies on graphical applications for configuring
your server. You'll one day find yourself helplessly unable to do
something that needs to be done if you don't know how to do it the
"hard" way.

Myke<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
abuse6

External


Since: Jun 07, 2004
Posts: 18



(Msg. 3) Posted: Thu Jul 08, 2004 12:39 am
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 07 Jul 2004 21:39:14 GMT, Lord Hasenpfeffer
<mykec RemoveThis @spamsucks.ionet.net> wrote:

 >filesiteguy wrote:
 >
  >> Anyway, when I go to the browser, I type in <a style='text-decoration: underline;' href="http://kai/site1" target="_blank">http://kai/site1</a> and I get
  >> a Permission denied error. It does find the page, but doesn't allow me
  >> to load it. What do I need to do. The directory is set for 777
  >> permissions.
 >
 >My guess is that you've got no index.html or index.php file in the
 >directory.
 >
 >What username is your Apache configured to use? "nobody"? "httpd"?

Hmm, interesting. I didn't know there was a username attached. I'll
look into it.

 >
 >What user and/or group owns the DocumentRoot directory and/or the
 >directories and files contained therein?

Um, Barney Rubble? Smile I'll look at that too.

 >
 >Do *not* grant "world write access" to the directories and files in your
 >DocumentRoot.

Yeah, this was just to see why things wern't working. I need to see
how to chmod directories on a system I'm running and using. I'm more
used to directories on a hosted server.

 >
  >> Also, what do I need to use to make this easy? I want to add many more
  >> virtual sites on my machine. Is there a configuration tool under
  >> Mandrake 10? I haven't been able to find one as yet.
 >
 >Use your existing virtual host "stanzas" as templates for all the rest.
 >
 >Copy and paste.

That's been getting me started.

 >
 >Use vi.

HAHAHAHAAHAHAHAHAHAHHA!!!!

um, no. I spent way too long using edlin and vi in the past. :wq


 >
 >Don't develop dependencies on graphical applications for configuring
 >your server. You'll one day find yourself helplessly unable to do
 >something that needs to be done if you don't know how to do it the
 >"hard" way.

Nah, I just find it easier to have something working then take it
apart and analyze, rather than spending frustrating hours figuring it
out with little success.

Thanks! I'll get into it in the morning again.


kai
<a style='text-decoration: underline;' href="http://www.perfectreign.com" target="_blank">www.perfectreign.com</a> || <a style='text-decoration: underline;' href="http://www.filesite.org" target="_blank">www.filesite.org</a>
g2004 at g3prod.cotse.net<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
mykec

External


Since: Sep 25, 2004
Posts: 11



(Msg. 4) Posted: Thu Jul 08, 2004 8:45 pm
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

filesiteguy wrote:
 >
  >> What username is your Apache configured to use? "nobody"? "httpd"?
 >
 > Hmm, interesting. I didn't know there was a username attached. I'll
 > look into it.

All directories and all files on a *nix system are owned by some user
and some group. This is inherent to the way in which the OS works.

This is also a key reason why no *nix viruses are running rampant in the
world. A virus first has to assume a valid identity on the system and
then obtain write permission before it can do *anything* to any file or
directory. System files are generally owned by the root user and the
root group. If a virus can't assume root identity it can do no harm to
the system.

Contrast this to Windows systems where virii assume the identity of
Administrator by default. Then go give some money to the company who
made such an awesome system the most common on planet Earth.

  >> What user and/or group owns the DocumentRoot directory and/or the
  >> directories and files contained therein?
 >
 > Um, Barney Rubble? Smile

No, Rumplestiltskin! Smile

  >> Use your existing virtual host "stanzas" as templates for all the rest.
  >>
  >> Copy and paste.
 >
 > That's been getting me started.

Maintain that course.

  >> Use vi.
 >
 > HAHAHAHAAHAHAHAHAHAHHA!!!!
 >
 > um, no. I spent way too long using edlin and vi in the past. :wq

That was my best advice. Ignore it at your own risk. ZZ

Myke<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
abuse6

External


Since: Jun 07, 2004
Posts: 18



(Msg. 5) Posted: Thu Jul 08, 2004 8:45 pm
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 08 Jul 2004 17:45:47 GMT, Lord Hasenpfeffer
<mykec.DeleteThis@spamsucks.ionet.net> wrote:

  >>snip<<

 >filesiteguy wrote:
  >>
  >> um, no. I spent way too long using edlin and vi in the past. :wq
 >
 >That was my best advice. Ignore it at your own risk. ZZ
 >
 >Myke

LOL!!!! I've probably gotten lazy in my old age. Smile

Thanks for the very good information.



kai
<a style='text-decoration: underline;' href="http://www.perfectreign.com" target="_blank">www.perfectreign.com</a> || <a style='text-decoration: underline;' href="http://www.filesite.org" target="_blank">www.filesite.org</a>
g2004 at g3prod.cotse.net<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
mykec

External


Since: Sep 25, 2004
Posts: 11



(Msg. 6) Posted: Fri Jul 09, 2004 1:40 am
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

filesiteguy wrote:
   >>>> Use vi.
    >>>
   >>> um, no. I spent way too long using edlin and vi in the past. :wq
  >>
  >> That was my best advice. Ignore it at your own risk. ZZ
 >
 > LOL!!!! I've probably gotten lazy in my old age. Smile

Smile I find myself still using vi a lot during ssh sessions.

edlin? Now *that* I wouldn't advise! Smile

 > Thanks for the very good information.

You're welcome. Did it help any?

Myke<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
rsgibson

External


Since: Jul 09, 2004
Posts: 1



(Msg. 7) Posted: Sat Jul 10, 2004 2:33 am
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 08 Jul 2004 22:40:32 +0000, Lord Hasenpfeffer wrote:

 > edlin? Now *that* I wouldn't advise! Smile

Rael men use...

copy con program.exe Smile<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
please9

External


Since: Jul 11, 2004
Posts: 1



(Msg. 8) Posted: Sun Jul 11, 2004 6:36 am
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

filesiteguy wrote:
 > I am setting up my Mandrake 10 station as a development machine for
 > web sites. I generally use PHP for these types of sites.
 >
 > I want to setup my machine to allow virtual directories as websites.
 > For example under Windows, I have the following directory structure:
 > d:\projects - with the sites underneath \site1\website,
 > \site2\website...
 >
 > So for site1, I'd have c:\projects\site1\website\index.php as my main
 > file. I'd setup a virtual directory in IIS as <a style='text-decoration: underline;' href="http://kai/site1," target="_blank">http://kai/site1,</a> which
 > woudl point to that index.php
 >
 > Under Linux, I think I've almost got it. I have the following
 > direcotry structure...
 >
 > \projects\site1\website.
 >
 > I setup my /etc/httpd/conf/VirtualHost.conf file to have the
 > following:
 >
 > <VirtualHost kai>
 > DocumentRoot /projects/site1/website
 > ServerName site1
 > </VirtualHost>
 >
 > I'm not sure if I need to change the hosts file or not - do I?
 >
 > Anyway, when I go to the browser, I type in <a style='text-decoration: underline;' href="http://kai/site1" target="_blank">http://kai/site1</a> and I get
 > a Permission denied error. It does find the page, but doesn't allow me
 > to load it. What do I need to do. The directory is set for 777
 > permissions.
 >
 > Also, what do I need to use to make this easy? I want to add many more
 > virtual sites on my machine. Is there a configuration tool under
 > Mandrake 10? I haven't been able to find one as yet.
 >
 > TIA
 > kai
<font color=purple> > <a style='text-decoration: underline;' href="http://www.perfectreign.com" target="_blank">www.perfectreign.com</a> || <a style='text-decoration: underline;' href="http://www.filesite.org</font" target="_blank">www.filesite.org</font</a>>
 > g2004 at g3prod.cotse.net

I don't know if you are still monitoring this thread, but check this out:

<VirtualHost 63.246.10.216>
UseCanonicalName off
ServerName %1.mydomain.net
ServerAlias *.mydomain.net
VirtualDocumentRoot /usr/local/apache/hosts/mydomain.net/%1
</VirtualHost>

What this does is resolves all of the directories to domains. i.e.
forum.mydomain.net would be in /usr/local/apache/hosts/mydomain.net/forum
and <a style='text-decoration: underline;' href="http://www.mydomain.net" target="_blank">www.mydomain.net</a> would be in
/usr/local/apache/hosts/mydomain.net/www
etc.

I do this myself to host customer sites with free subdomains. All of
these sites are pretty vanilla though, no special configuration
necessary, although I suppose you could use .htaccess if you needed
special directory configurations.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
abuse6

External


Since: Jun 07, 2004
Posts: 18



(Msg. 9) Posted: Tue Jul 13, 2004 12:11 am
Post subject: Re: Virtual Host Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Paranoid about Spam wrote:

 > filesiteguy wrote:
  >> I am setting up my Mandrake 10 station as a development machine for
  >> web sites. I generally use PHP for these types of sites.
  >>
  >> I want to setup my machine to allow virtual directories as websites.
  >> For example under Windows, I have the following directory structure:
  >> d:\projects - with the sites underneath \site1\website,
  >> \site2\website...
  >>
  >> So for site1, I'd have c:\projects\site1\website\index.php as my main
  >> file. I'd setup a virtual directory in IIS as <a style='text-decoration: underline;' href="http://kai/site1," target="_blank">http://kai/site1,</a> which
  >> woudl point to that index.php
  >>
  >> Under Linux, I think I've almost got it. I have the following
  >> direcotry structure...
  >>
  >> \projects\site1\website.
  >>
  >> I setup my /etc/httpd/conf/VirtualHost.conf file to have the
  >> following:
  >>
  >> <VirtualHost kai>
  >> DocumentRoot /projects/site1/website
  >> ServerName site1
  >> </VirtualHost>
  >>
  >> I'm not sure if I need to change the hosts file or not - do I?
  >>
  >> Anyway, when I go to the browser, I type in <a style='text-decoration: underline;' href="http://kai/site1" target="_blank">http://kai/site1</a> and I get
  >> a Permission denied error. It does find the page, but doesn't allow me
  >> to load it. What do I need to do. The directory is set for 777
  >> permissions.
  >>
  >> Also, what do I need to use to make this easy? I want to add many more
  >> virtual sites on my machine. Is there a configuration tool under
  >> Mandrake 10? I haven't been able to find one as yet.
  >>
  >> TIA
  >> kai
<font color=green>  >> <a style='text-decoration: underline;' href="http://www.perfectreign.com" target="_blank">www.perfectreign.com</a> || <a style='text-decoration: underline;' href="http://www.filesite.org</font" target="_blank">www.filesite.org</font</a>>
  >> g2004 at g3prod.cotse.net
 >
 > I don't know if you are still monitoring this thread, but check this out:
 >
 > <VirtualHost 63.246.10.216>
 > UseCanonicalName off
 > ServerName %1.mydomain.net
 > ServerAlias *.mydomain.net
 > VirtualDocumentRoot /usr/local/apache/hosts/mydomain.net/%1
 > </VirtualHost>
 >
 > What this does is resolves all of the directories to domains. i.e.
 > forum.mydomain.net would be in /usr/local/apache/hosts/mydomain.net/forum
 > and <a style='text-decoration: underline;' href="http://www.mydomain.net" target="_blank">www.mydomain.net</a> would be in
 > /usr/local/apache/hosts/mydomain.net/www
 > etc.
 >
 > I do this myself to host customer sites with free subdomains. All of
 > these sites are pretty vanilla though, no special configuration
 > necessary, although I suppose you could use .htaccess if you needed
 > special directory configurations.


Hmm, very cool. I'll try it out.

I just need now to know what permissions to set. Smile
--
kai
<a style='text-decoration: underline;' href="http://www.perfectreign.com" target="_blank">www.perfectreign.com</a> || <a style='text-decoration: underline;' href="http://www.filesite.org" target="_blank">www.filesite.org</a>
g2004 at g3prod dot cotse dot net<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Virtual Host Question 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
A different type of Virtual host question - I have a dynamic IP address with to host names. I have used examples from the VirtualHost doc for the following configuration in httpd.conf. <snip> Listen 82 Listen 83 NameVirtualHost *:82 NameVirtualHost *:83 <VirtualHost *:82> ServerN...

Apache Virtual Host question - I'm having (maybe not) an issue with the virtual hosts section, and a second look would be fine. I have "NameVirtualHost *" set, and I have each virtual host beginning as <VirtualHost xxxdomain.tld>. All other directives and constructs ...

apache2 virtual host question - Hello group, I'm running apache2 under gutsy gibbon (ubuntu 7.10). My question is about setting up a virtual host whose domain is already registered. Say, www.thisdomain.com already exists, and I wish to set up a virtual host of the form..

Virtual host setup question - I have a local webserver called mike The Document root is /www/htdocs So I access it from another machine using http://mike The Problem - what I want to do is if I type http://mike/cms then I want it to access /www/cms not /www/htdocs/cms I can't wor...

virtual host document root question - Apache2 on WinXP home, Its running on my home network so I'm using local paths (d:\web is my main documentroot dir) I've got this code seting up Virtual hosts on different ports of my existing IP... works fine, except it will only point to the main..
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]