Apache: Virtual hosts
I just installed apache on my machine and tryed to set up a virtual host but i cant get it to work. When i go with my browser to the virtual host i get:
---------- Forbidden You don't have permission to access / on this server. Apache/1.3.23 Server at dummy-host.example.com Port 80 --- I dont know what i am doing wrong. Here is the virtual host part of my httpd.conf: ---------- NameVirtualHost 192.168.0.5 <VirtualHost 192.168.0.5:80> User peter Group peter ServerAdmin peter@test.nl DocumentRoot /home/peter/www/html ServerName dummy-host.example.com ErrorLog /home/peter/error_log CustomLog /home/peter/access_log common <Directory /home/peter/www/html> AllowOverride All </Directory> DirectoryIndex index.phtml index.fhtml index.php index.php4 index.html </VirtualHost> --- I made a file called index.html in /home/peter/www/html (-rwxrwxrwx 1 peter peter 6 Oct 6 18:19 index.html) There are no messages in my error_log. What am i doing wrong??? |
One thing I noticed is your directory names..... Are they links to a sub dir off of the /var/www/html directory? Most Apache configs are based on either /etc/httpd/html or /var/www/html as their main root directory. I am also curious because I am attermpting to do the same and getting the same error here as well and mine ARE pointing to sub-directories off of my /var/www/html dir
Rich |
Thanks for replying!
i made a link in /var/www/html to /home/peter/www/html and adjusted my httpd.conf but it still doesn't work. |
It works!!!
i made a dir /var/www/html/peter and made a softlink /home/peter/html and now it works!
Thanks for the help! :D |
Glad I could help. One question I had for you though. Was the 192 IP addy you used an actual internal IP or was that just plugged in? Also, remember with virtual host configurations that what YOU see isn't always what the web server sees, especially when it comes to using CGI scripts.
Good luck! Rich P.S. If you still need more help go to Apache's web site at http://www.apache.org They have a pretty extensive tutorial on seting up virtual hosts both by name and IP. |
The 192 address is the real address i am using. I am just experimenting with apache for my work. Thanks again for the help!
|
With the link /home/peter/www/html to /var/www/html/peter i cant set a chroot environment for ftp. If i do the user cant get in his /home/peter/www/html dir!
Anyone has a solution for this? (I am using vsftp) |
Easy fixis to have the user ftp to his home dir and then cp the files over no?????
|
nop, thats not an option. There has to be a better way.
|
To answer the original question, the error message is generated when their is no default index page in the directory. You can rememdy this by:
A) creating an index.html (or whatever you happen to set as default) B) add "Indexes" to the Options line in the Directory paragraph that matches your DocumentRoot. Doing B will use the output of "ls" for the index if there is none. You can create a separate DocumentRoot for each virtual host without any problems or having to symlink all over the place. |
I already have an index.html
I still have the error and i have the index.html and all the dirs set to chmod 777 |
Never mind. It works right now.
|
what did you do differently?
|
I just cut my vhost config and pasted it at the end of the virtual host section and it suddently worked. Don't know what was wrong, but im glad it works!
|
The question was asked above about chrooting a user in ftp, I just did that with a server I just set up, I used pure-ftp for the server, real easy to set up and an option for it is to chroot the users in ftp, they have it documented in there site, you can type in pure-ftp in google to find it.
|
All times are GMT -5. The time now is 02:59 PM. |