Note that there are some explanatory texts on larger screens.

plurals
  1. POVirtual hosts on apache with URL's like subfolders
    primarykey
    data
    text
    <p>I am interested in, if I can have vhosts on apache with domain names like: <strong>http://something.com/something</strong> or <strong>http://{server-ip-address-here}/something</strong> ?</p> <p>I am using Apache 2.2.20 on Ubuntu Server, thats my home server and I am testing some stuff here, I dont have any DNS server here and what I have is only public IP address and a domain name attached to it from open dns service.</p> <p>So, what did I do:</p> <ol> <li>I have created new file "demo" in <strong>/etc/apache2/sites-available</strong></li> <li><p>I put there this (actually it is copied with modifications from default file): <code></p> <pre><code>&lt;VirtualHost *:80&gt; ServerAdmin webmaster@localhost ServerName {mydomain-here}/demo/ DocumentRoot /vhosts/demo &lt;Directory /&gt; Options FollowSymLinks AllowOverride None &lt;/Directory&gt; &lt;Directory /vhosts/demo/&gt; Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all &lt;/Directory&gt; ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ &lt;Directory "/usr/lib/cgi-bin"&gt; AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all &lt;/Directory&gt; ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" &lt;Directory "/usr/share/doc/"&gt; Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p></code></p></li> <li><p>Created symlink in /etc/apache2/sites-enabled/ which points to /etc/apache2/sites-available/demo</p></li> <li><p>Created <strong>/vhosts/demo/index.html</strong> file.</p></li> </ol> <p>And now what i get is that when I go to {my-domain} I go to vhost which I have created, but problem is that server points me there in ANY case, not only {my-domain}/demo what I want.</p> <p>In conclusion, I want that I can create different virtual hosts and attach them to different URL's which will have same base-url, for example www.mydomain.com/vhost1, www.mydomain.com/vhost2 etc..</p> <p>Is it possible? Thanks :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload