Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So we'll try to clean the things :-)</p> <p>Avoid using .htaccess. All the settings in a .htaccess in a directory /foo/bar can be set in apache configuration as a Directory setting (.haccess is usefull if you provide limited access on apache conf, if you own the server don't use it).</p> <pre><code>&lt;Directory /foo/bar&gt;(...)&lt;/Directory&gt; </code></pre> <p>Then you can access your sites with named based virtualhosts. Verify you have this option:</p> <pre><code>NameVirtualHost *:80 </code></pre> <p>When you have it nice things can start. This will be your virtualhost for your 1st app:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName app ServerAlias www.app.somwhere.com ServerAlias app.somwhere.com DocumentRoot /www/app/webroot &lt;Directory /&gt; Options FollowSymLinks AllowOverride None &lt;/Directory&gt; &lt;Directory /www/app/webroot&gt; Options Indexes FollowSymLinks # this prevent.htaccess reading, remove if you want .htaccess AllowOverride None # allow web access Order allow,deny allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>Most apache settings can be define here. Only for your 1st app. Apache will serve this configuration for all requests done for the site name 'app', or 'www.app.somwhere.com', or 'app.somwhere.com'. You can define a lot of alias(<strong>ServerAlias</strong>)., and only one name (<strong>ServerName</strong>).</p> <p>Then if you go in your browser and type <a href="http://app/" rel="noreferrer">http://app/</a> your browser won't find the server, so set it in your /etc/hosts. This is what every people wanting to access your app should have in the hosts file until you get a real DNS (assuming your 1st app is app.somwhere.com and the second foo.somwhere.com and 92.128.52.226is your external IP):</p> <pre><code>127.0.0.1 app.somwhere.com app foo foo.somewhere.com 92.128.52.226 app.somwhere.com app foo foo.somewhere.com </code></pre> <p>And now let's add another virtualhost for your second app:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName foo ServerAlias www.foo.somwhere.com ServerAlias foo.somwhere.com DocumentRoot /www/foo/webroot &lt;Directory /&gt; Options FollowSymLinks AllowOverride None &lt;/Directory&gt; &lt;Directory /www/foo/webroot&gt; Options Indexes FollowSymLinks # this prevent.htaccess reading, remove if you want .htaccess AllowOverride None # allow web access Order allow,deny allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>And etc. Don't forget to restart your apache. No rewrite rule. nice virtualhosts is the 1st step of a nice configuration, you will be able to define rules, directory or location specific things per name used. Even php configuration can be set per virtualhost with php_value instead of a global shared one on php.ini.</p> <p>type </p> <pre><code>apache2 -S </code></pre> <p>to get the list of your virtualhosts, you'll see that the first one is the 'default' one, if apache does'nt understand the name of the requested site it will serve this default one (so you could ad a specific virtualhost on top to handle theses cases).</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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