Forum

How can I use options of virtualhost in directories?

Xan
25 October 2009, 16:27
Hi,

Just a question: how can I do virtualhost options in directories. I want to serve 172.26.0.2/ and 172.26.0.2/wiki as a virtualservers.

Thanks,
Xan
Hugo Leisink
25 October 2009, 19:25
Just create one virtual host and move the wiki directory inside the webroot directory of that virtual host.
Xan
26 October 2009, 16:55
How can do that?

This is a example of virtual hosts: can you modify it only for wiki contain the .../wiki directory?

# DEFAULT WEBSITE
# It is wise to use your IP address as the hostname of the default website
# and give it a blank webpage. By doing so, automated webscanners won't find
# your possible vulnerable website.
#
Hostname = 127.0.0.1
WebsiteRoot = /var/www
#StartFile = index.html
ShowIndex = yes
ExecuteCGI = yes
TriggerOnCGIstatus = no
EnablePathInfo = yes
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
#ErrorHandler = 404:/error.cgi


# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
Hostname = 127.0.0.1/wiki
WebsiteRoot = /var/www/wiki
#StartFile = index.php
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
TimeForCGI = 5
#UseFastCGI = PHP5
#UseToolkit = banshee
}

Note that hostname of virtualhost is malformed: hiawatha does not allow /wiki in hostname.

Xan.
Hugo Leisink
26 October 2009, 21:14
Just create a single host configuration (the default host in your config will do). Create the directory /var/www/wiki and place all your wiki files in that directory. If a browser requests http://127.0.0.1/wiki, Hiawatha will search for a wiki directory in the host named 127.0.0.1. Easy.
Xan
27 October 2009, 18:57
Yes, but I want:
- that user in / only see / contents (not the subdirectory /wiki) and that in /wiki the user could not up the directory
- and use virtual hosts options in /wiki different to / (for example AccessLogFile)

For these reason, I wanted to do 2 vs
Xan.
Hugo Leisink
27 October 2009, 19:49
That's not possible, because that's not how subdirectories work. Not with any webserver.
bil
25 December 2009, 17:45
this sucks:

The hostname '127.0.0.1/test' contains a path
Hugo Leisink
25 December 2009, 19:13
No, it doesn't...
This topic has been closed.