Jump to content

virtual host for apache2


scoopy
 Share

Recommended Posts

Just set up Apache2 on a fresh install of 10 OE. I am trying to setup a virtual server that will allow myself easier access to my files (test sites). Everything works fine from the /var/www/html directory and works using my IP. I just need this to work for me, outside (of my network) access is not neccessary.

 

This is my Vhosts.conf :

################# Named VirtualHosts
NameVirtualHost scoopy.localhost
<VirtualHost 127.0.0.1>
ServerName scoopy.net
ServerPath /etc/httpd
DocumentRoot /www/html
</VirtualHost>

 

This is what I am getting in my browser:

Forbidden

You don't have permission to access / on this server.

Apache-AdvancedExtranetServer/2.0.48 (Mandrake Linux/6.2.100mdk) PHP/4.3.4 Server at scoopy.net Port 80

 

So, I am sure I missed something or did something wrong. Maybe some sort of redirect would work too ???

 

thanks,

Link to comment
Share on other sites

for each one of my hosts i define the host and set directory permissions:

<VirtualHost *:80>
DocumentRoot /var/www/stats/wwwroot
ServerName stats.domain.net
ServerAlias stats2.domain.net
</VirtualHost>

<Directory /var/www/stats/wwwroot>
order allow,deny
allow from all
</Directory>

 

edit: basically i think you have too many options in your <VirtualHost>, but just adding the directory section may help you.

Edited by fissy
Link to comment
Share on other sites

Guest anon

Not sure i understand, why can't you just type 127.0.0.1/my_file to access your stuff? why do you want the virtual server entry to access files from your own box?

Link to comment
Share on other sites

why can't you just type 127.0.0.1/my_file to access your stuff?

That would work... IF I filed the stuff in /var/www/html/my_file... BUT I would like to file it in a totally different partition which is mounted as /www.

 

damn, maybe thats where I messed up... document root should be /mnt/www/html. :oops:

 

Will try that after work... along with fissy's idea if needed.

 

thanks,

Link to comment
Share on other sites

Got it working now. Fissy's directory options fixed up the permission thing. Don't know why they did not include that in the sample config?

 

Now if I can just figure out the redirect options... I can probably access everything from outside the network too.

 

thanks again,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...