Reconfiguration of httpd.conf from one project to three projects on local serverApache 2.2 localhost...

Who has more? Ireland or Iceland?

Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?

Book where society has been split into 2 with a wall down the middle where one side embraced high tech whereas other side were totally against tech

Is there a logarithm base for which the logarithm becomes an identity function?

An Undercover Army

How can I have x-axis ticks that show ticks scaled in powers of ten?

Are small insurances worth it?

Is the differential, dp, exact or not?

Why aren't there more Gauls like Obelix?

Is "cogitate" used appropriately in "I cogitate that success relies on hard work"?

Professor forcing me to attend a conference, I can't afford even with 50% funding

Can multiple states demand income tax from an LLC?

Should I apply for my boss's promotion?

How to make sure I'm assertive enough in contact with subordinates?

What is the oldest European royal house?

What do you call someone who likes to pick fights?

Is it appropriate to ask a former professor to order a library book for me through ILL?

Why isn't P and P/poly trivially the same?

What exactly is the meaning of "fine wine"?

School performs periodic password audits. Is my password compromised?

Vector-transposing function

How does learning spells work when leveling a multiclass character?

3.5% Interest Student Loan or use all of my savings on Tuition?

How would an energy-based "projectile" blow up a spaceship?



Reconfiguration of httpd.conf from one project to three projects on local server


Apache 2.2 localhost VirtualHosts problemsapache2 configuration for blog.example.com not workingApache Virtual Hosts Not WorkingWAMP different sites on different ports accessible on LANApache AllowOverride Options DirectiveAdding additional host to Apache2NginX reverse proxy with iRedMail Apache2Can't access apache by port 80 from externalApache Webserver Modifying Config or Re-direct has no effectDefault documentroot served from url localhost













-1















Problem



I need to properly reconfiguration of my httpd.conf apache2 server from one project (http://localhost/) to three projects, for instance. Would you be so kind and check the following codes and descriptions and help me to make a correct reconfiguration?



Current one project directory model:



Library
+++ WebServer

+++ +++ Documents
+++ +++ database


Desired three-project directory model:



Library
+++ WebServer

+++ +++ project_1
+++ +++ +++ public_html
+++ +++ +++ database

+++ +++ project_2
+++ +++ +++ public_html
+++ +++ +++ database

+++ +++ project_3
+++ +++ +++ public_html
+++ +++ +++ database


Accessibility



One project:




  • http://localhost


Three projects:




  • http://localhost/project_1


  • http://localhost/project_2


  • http://localhost/project_3



Relevant portion of httpd.conf for one project (currently works for one project):



DocumentRoot "/Library/WebServer/Documents"

<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>


Suggested portion of httpd.conf for multiple projects:



<VirtualHost>
ServerAdmin localhost
DocumentRoot "/Library/WebServer/project_1/public_html"
ServerName localhost
</VirtualHost>

<Directory "/Library/WebServer/project_1/public_html">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>


<VirtualHost>
ServerAdmin localhost
DocumentRoot "/Library/WebServer/project_2/public_html"
ServerName localhost
</VirtualHost>

<Directory "/Library/WebServer/project_2/public_html">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>


<VirtualHost>
ServerAdmin localhost
DocumentRoot "/Library/WebServer/project_3/public_html"
ServerName localhost
</VirtualHost>

<Directory "/Library/WebServer/project_3/public_html">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>


Server version: Apache/2.4.28 (Unix)










share|improve this question









New contributor




Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    -1















    Problem



    I need to properly reconfiguration of my httpd.conf apache2 server from one project (http://localhost/) to three projects, for instance. Would you be so kind and check the following codes and descriptions and help me to make a correct reconfiguration?



    Current one project directory model:



    Library
    +++ WebServer

    +++ +++ Documents
    +++ +++ database


    Desired three-project directory model:



    Library
    +++ WebServer

    +++ +++ project_1
    +++ +++ +++ public_html
    +++ +++ +++ database

    +++ +++ project_2
    +++ +++ +++ public_html
    +++ +++ +++ database

    +++ +++ project_3
    +++ +++ +++ public_html
    +++ +++ +++ database


    Accessibility



    One project:




    • http://localhost


    Three projects:




    • http://localhost/project_1


    • http://localhost/project_2


    • http://localhost/project_3



    Relevant portion of httpd.conf for one project (currently works for one project):



    DocumentRoot "/Library/WebServer/Documents"

    <Directory "/Library/WebServer/Documents">
    Options Indexes FollowSymLinks MultiViews
    MultiviewsMatch Any
    AllowOverride All
    Require all granted
    </Directory>


    Suggested portion of httpd.conf for multiple projects:



    <VirtualHost>
    ServerAdmin localhost
    DocumentRoot "/Library/WebServer/project_1/public_html"
    ServerName localhost
    </VirtualHost>

    <Directory "/Library/WebServer/project_1/public_html">
    Options Indexes FollowSymLinks MultiViews
    MultiviewsMatch Any
    AllowOverride All
    Require all granted
    </Directory>


    <VirtualHost>
    ServerAdmin localhost
    DocumentRoot "/Library/WebServer/project_2/public_html"
    ServerName localhost
    </VirtualHost>

    <Directory "/Library/WebServer/project_2/public_html">
    Options Indexes FollowSymLinks MultiViews
    MultiviewsMatch Any
    AllowOverride All
    Require all granted
    </Directory>


    <VirtualHost>
    ServerAdmin localhost
    DocumentRoot "/Library/WebServer/project_3/public_html"
    ServerName localhost
    </VirtualHost>

    <Directory "/Library/WebServer/project_3/public_html">
    Options Indexes FollowSymLinks MultiViews
    MultiviewsMatch Any
    AllowOverride All
    Require all granted
    </Directory>


    Server version: Apache/2.4.28 (Unix)










    share|improve this question









    New contributor




    Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      -1












      -1








      -1








      Problem



      I need to properly reconfiguration of my httpd.conf apache2 server from one project (http://localhost/) to three projects, for instance. Would you be so kind and check the following codes and descriptions and help me to make a correct reconfiguration?



      Current one project directory model:



      Library
      +++ WebServer

      +++ +++ Documents
      +++ +++ database


      Desired three-project directory model:



      Library
      +++ WebServer

      +++ +++ project_1
      +++ +++ +++ public_html
      +++ +++ +++ database

      +++ +++ project_2
      +++ +++ +++ public_html
      +++ +++ +++ database

      +++ +++ project_3
      +++ +++ +++ public_html
      +++ +++ +++ database


      Accessibility



      One project:




      • http://localhost


      Three projects:




      • http://localhost/project_1


      • http://localhost/project_2


      • http://localhost/project_3



      Relevant portion of httpd.conf for one project (currently works for one project):



      DocumentRoot "/Library/WebServer/Documents"

      <Directory "/Library/WebServer/Documents">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      Suggested portion of httpd.conf for multiple projects:



      <VirtualHost>
      ServerAdmin localhost
      DocumentRoot "/Library/WebServer/project_1/public_html"
      ServerName localhost
      </VirtualHost>

      <Directory "/Library/WebServer/project_1/public_html">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      <VirtualHost>
      ServerAdmin localhost
      DocumentRoot "/Library/WebServer/project_2/public_html"
      ServerName localhost
      </VirtualHost>

      <Directory "/Library/WebServer/project_2/public_html">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      <VirtualHost>
      ServerAdmin localhost
      DocumentRoot "/Library/WebServer/project_3/public_html"
      ServerName localhost
      </VirtualHost>

      <Directory "/Library/WebServer/project_3/public_html">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      Server version: Apache/2.4.28 (Unix)










      share|improve this question









      New contributor




      Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Problem



      I need to properly reconfiguration of my httpd.conf apache2 server from one project (http://localhost/) to three projects, for instance. Would you be so kind and check the following codes and descriptions and help me to make a correct reconfiguration?



      Current one project directory model:



      Library
      +++ WebServer

      +++ +++ Documents
      +++ +++ database


      Desired three-project directory model:



      Library
      +++ WebServer

      +++ +++ project_1
      +++ +++ +++ public_html
      +++ +++ +++ database

      +++ +++ project_2
      +++ +++ +++ public_html
      +++ +++ +++ database

      +++ +++ project_3
      +++ +++ +++ public_html
      +++ +++ +++ database


      Accessibility



      One project:




      • http://localhost


      Three projects:




      • http://localhost/project_1


      • http://localhost/project_2


      • http://localhost/project_3



      Relevant portion of httpd.conf for one project (currently works for one project):



      DocumentRoot "/Library/WebServer/Documents"

      <Directory "/Library/WebServer/Documents">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      Suggested portion of httpd.conf for multiple projects:



      <VirtualHost>
      ServerAdmin localhost
      DocumentRoot "/Library/WebServer/project_1/public_html"
      ServerName localhost
      </VirtualHost>

      <Directory "/Library/WebServer/project_1/public_html">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      <VirtualHost>
      ServerAdmin localhost
      DocumentRoot "/Library/WebServer/project_2/public_html"
      ServerName localhost
      </VirtualHost>

      <Directory "/Library/WebServer/project_2/public_html">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      <VirtualHost>
      ServerAdmin localhost
      DocumentRoot "/Library/WebServer/project_3/public_html"
      ServerName localhost
      </VirtualHost>

      <Directory "/Library/WebServer/project_3/public_html">
      Options Indexes FollowSymLinks MultiViews
      MultiviewsMatch Any
      AllowOverride All
      Require all granted
      </Directory>


      Server version: Apache/2.4.28 (Unix)







      httpd httpd.conf






      share|improve this question









      New contributor




      Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 12 mins ago







      Emma













      New contributor




      Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 6 hours ago









      EmmaEmma

      1015




      1015




      New contributor




      Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Emma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Because the part of the url path does not match the one with the library structure, so you have to trick it.



          Trick 1: Virtualhost and local-only domain per project.



          Trick 2: Use aliases within a virtual host (or don't use VirtualHost)



          Trick 1 example:



          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_1/public_html"
          ServerName project1.emma

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_2/public_html"
          ServerName project2.emma

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_3/public_html"
          ServerName project3.emma

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>


          ServerName is important, so you can access the project in your browser with ServerName: http://project1.emma.
          For this to work, you should add the following line in /etc/hosts file:



          127.0.0.1 project1.emma project2.emma project3.emma


          ServerName can be anything. Tld can be anything. The important thing is to be in the hosts file and when you type in your browser, always use a protocol prefix (http: //)



          Trick 2 example:



          You do not need VirtualHost to do this.



          Alias /project1 /Library/WebServer/project_1/public_html
          Alias /project2 /Library/WebServer/project_2/public_html
          Alias /project3 /Library/WebServer/project_3/public_html

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>


          I like trick 1. It is much cleaner and forces me to organize everything into VirtualHost.






          share|improve this answer
























          • Hi Laszlo, thanks again so much, I tried your trick 1 advice, your descriptions are really great, and it works now!

            – Emma
            17 mins ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Emma is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957439%2freconfiguration-of-httpd-conf-from-one-project-to-three-projects-on-local-server%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Because the part of the url path does not match the one with the library structure, so you have to trick it.



          Trick 1: Virtualhost and local-only domain per project.



          Trick 2: Use aliases within a virtual host (or don't use VirtualHost)



          Trick 1 example:



          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_1/public_html"
          ServerName project1.emma

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_2/public_html"
          ServerName project2.emma

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_3/public_html"
          ServerName project3.emma

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>


          ServerName is important, so you can access the project in your browser with ServerName: http://project1.emma.
          For this to work, you should add the following line in /etc/hosts file:



          127.0.0.1 project1.emma project2.emma project3.emma


          ServerName can be anything. Tld can be anything. The important thing is to be in the hosts file and when you type in your browser, always use a protocol prefix (http: //)



          Trick 2 example:



          You do not need VirtualHost to do this.



          Alias /project1 /Library/WebServer/project_1/public_html
          Alias /project2 /Library/WebServer/project_2/public_html
          Alias /project3 /Library/WebServer/project_3/public_html

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>


          I like trick 1. It is much cleaner and forces me to organize everything into VirtualHost.






          share|improve this answer
























          • Hi Laszlo, thanks again so much, I tried your trick 1 advice, your descriptions are really great, and it works now!

            – Emma
            17 mins ago
















          1














          Because the part of the url path does not match the one with the library structure, so you have to trick it.



          Trick 1: Virtualhost and local-only domain per project.



          Trick 2: Use aliases within a virtual host (or don't use VirtualHost)



          Trick 1 example:



          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_1/public_html"
          ServerName project1.emma

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_2/public_html"
          ServerName project2.emma

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_3/public_html"
          ServerName project3.emma

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>


          ServerName is important, so you can access the project in your browser with ServerName: http://project1.emma.
          For this to work, you should add the following line in /etc/hosts file:



          127.0.0.1 project1.emma project2.emma project3.emma


          ServerName can be anything. Tld can be anything. The important thing is to be in the hosts file and when you type in your browser, always use a protocol prefix (http: //)



          Trick 2 example:



          You do not need VirtualHost to do this.



          Alias /project1 /Library/WebServer/project_1/public_html
          Alias /project2 /Library/WebServer/project_2/public_html
          Alias /project3 /Library/WebServer/project_3/public_html

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>


          I like trick 1. It is much cleaner and forces me to organize everything into VirtualHost.






          share|improve this answer
























          • Hi Laszlo, thanks again so much, I tried your trick 1 advice, your descriptions are really great, and it works now!

            – Emma
            17 mins ago














          1












          1








          1







          Because the part of the url path does not match the one with the library structure, so you have to trick it.



          Trick 1: Virtualhost and local-only domain per project.



          Trick 2: Use aliases within a virtual host (or don't use VirtualHost)



          Trick 1 example:



          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_1/public_html"
          ServerName project1.emma

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_2/public_html"
          ServerName project2.emma

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_3/public_html"
          ServerName project3.emma

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>


          ServerName is important, so you can access the project in your browser with ServerName: http://project1.emma.
          For this to work, you should add the following line in /etc/hosts file:



          127.0.0.1 project1.emma project2.emma project3.emma


          ServerName can be anything. Tld can be anything. The important thing is to be in the hosts file and when you type in your browser, always use a protocol prefix (http: //)



          Trick 2 example:



          You do not need VirtualHost to do this.



          Alias /project1 /Library/WebServer/project_1/public_html
          Alias /project2 /Library/WebServer/project_2/public_html
          Alias /project3 /Library/WebServer/project_3/public_html

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>


          I like trick 1. It is much cleaner and forces me to organize everything into VirtualHost.






          share|improve this answer













          Because the part of the url path does not match the one with the library structure, so you have to trick it.



          Trick 1: Virtualhost and local-only domain per project.



          Trick 2: Use aliases within a virtual host (or don't use VirtualHost)



          Trick 1 example:



          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_1/public_html"
          ServerName project1.emma

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_2/public_html"
          ServerName project2.emma

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>

          <VirtualHost *:80>
          ServerAdmin localhost
          DocumentRoot "/Library/WebServer/project_3/public_html"
          ServerName project3.emma

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>
          </VirtualHost>


          ServerName is important, so you can access the project in your browser with ServerName: http://project1.emma.
          For this to work, you should add the following line in /etc/hosts file:



          127.0.0.1 project1.emma project2.emma project3.emma


          ServerName can be anything. Tld can be anything. The important thing is to be in the hosts file and when you type in your browser, always use a protocol prefix (http: //)



          Trick 2 example:



          You do not need VirtualHost to do this.



          Alias /project1 /Library/WebServer/project_1/public_html
          Alias /project2 /Library/WebServer/project_2/public_html
          Alias /project3 /Library/WebServer/project_3/public_html

          <Directory "/Library/WebServer/project_1/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_2/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>

          <Directory "/Library/WebServer/project_3/public_html">
          Options Indexes FollowSymLinks MultiViews
          MultiviewsMatch Any
          AllowOverride All
          Require all granted
          </Directory>


          I like trick 1. It is much cleaner and forces me to organize everything into VirtualHost.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 5 hours ago









          Laszlo MalinaLaszlo Malina

          786




          786













          • Hi Laszlo, thanks again so much, I tried your trick 1 advice, your descriptions are really great, and it works now!

            – Emma
            17 mins ago



















          • Hi Laszlo, thanks again so much, I tried your trick 1 advice, your descriptions are really great, and it works now!

            – Emma
            17 mins ago

















          Hi Laszlo, thanks again so much, I tried your trick 1 advice, your descriptions are really great, and it works now!

          – Emma
          17 mins ago





          Hi Laszlo, thanks again so much, I tried your trick 1 advice, your descriptions are really great, and it works now!

          – Emma
          17 mins ago










          Emma is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Emma is a new contributor. Be nice, and check out our Code of Conduct.













          Emma is a new contributor. Be nice, and check out our Code of Conduct.












          Emma is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957439%2freconfiguration-of-httpd-conf-from-one-project-to-three-projects-on-local-server%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...