Problem with Apache VirtualHost to run Laravel












0














I am trying to work with my Laravel installation by using a VirtualHost on my computer which is using apache2 web server under debian jessie 8.5.

To do this, I first created a virtual host file named default.conf in /etc/apache2/sites-available and put the below text in it:



<VirtualHost /var/www/html/:80>
ServerName localhost
ServerAlias localhost
DocumentRoot /var/www/html/
</VirtualHost>

<VirtualHost /var/www/html/laravel40:8000>
ServerName lara
ServerAlias lara
DocumentRoot /var/www/html/laravel40/
</VirtualHost>


Now, after restarting the apache2 service, I can view the localhost easily by typing it in the browser's address bar. But with typing lara in the address bar, the browser shows me (chrome in my case) the results of search about the word lara. Laravel needs port 8000 to be run but I want it to run on port 80 so that the return results of my gateway system could work correctly.










share|improve this question





























    0














    I am trying to work with my Laravel installation by using a VirtualHost on my computer which is using apache2 web server under debian jessie 8.5.

    To do this, I first created a virtual host file named default.conf in /etc/apache2/sites-available and put the below text in it:



    <VirtualHost /var/www/html/:80>
    ServerName localhost
    ServerAlias localhost
    DocumentRoot /var/www/html/
    </VirtualHost>

    <VirtualHost /var/www/html/laravel40:8000>
    ServerName lara
    ServerAlias lara
    DocumentRoot /var/www/html/laravel40/
    </VirtualHost>


    Now, after restarting the apache2 service, I can view the localhost easily by typing it in the browser's address bar. But with typing lara in the address bar, the browser shows me (chrome in my case) the results of search about the word lara. Laravel needs port 8000 to be run but I want it to run on port 80 so that the return results of my gateway system could work correctly.










    share|improve this question



























      0












      0








      0







      I am trying to work with my Laravel installation by using a VirtualHost on my computer which is using apache2 web server under debian jessie 8.5.

      To do this, I first created a virtual host file named default.conf in /etc/apache2/sites-available and put the below text in it:



      <VirtualHost /var/www/html/:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot /var/www/html/
      </VirtualHost>

      <VirtualHost /var/www/html/laravel40:8000>
      ServerName lara
      ServerAlias lara
      DocumentRoot /var/www/html/laravel40/
      </VirtualHost>


      Now, after restarting the apache2 service, I can view the localhost easily by typing it in the browser's address bar. But with typing lara in the address bar, the browser shows me (chrome in my case) the results of search about the word lara. Laravel needs port 8000 to be run but I want it to run on port 80 so that the return results of my gateway system could work correctly.










      share|improve this question















      I am trying to work with my Laravel installation by using a VirtualHost on my computer which is using apache2 web server under debian jessie 8.5.

      To do this, I first created a virtual host file named default.conf in /etc/apache2/sites-available and put the below text in it:



      <VirtualHost /var/www/html/:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot /var/www/html/
      </VirtualHost>

      <VirtualHost /var/www/html/laravel40:8000>
      ServerName lara
      ServerAlias lara
      DocumentRoot /var/www/html/laravel40/
      </VirtualHost>


      Now, after restarting the apache2 service, I can view the localhost easily by typing it in the browser's address bar. But with typing lara in the address bar, the browser shows me (chrome in my case) the results of search about the word lara. Laravel needs port 8000 to be run but I want it to run on port 80 so that the return results of my gateway system could work correctly.







      debian apache-virtualhost






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      Rui F Ribeiro

      39.3k1479131




      39.3k1479131










      asked Dec 7 '16 at 3:09









      TowerTower

      1491215




      1491215






















          1 Answer
          1






          active

          oldest

          votes


















          1














          First: you need to make sure your DNS server would resolve lara to your webserver. Alternatively, editing your hosts file could do.



          then, defining a virtualhost



          <VirtualHost /var/www/html/laravel40:8000>


          Should probably be replaced with



          <VirtualHost 1.2.3.4:8000>
          <VirtualHost fqdn:8000>
          or <VirtualHost *:8000>


          Also: just adding a virtualhost won't configure apache to listen on a new port. Look for /etc/apache2/ports.conf of your main apache configuration file, there should be some Listen 80 already present, make sure to add Listen 8000 somewhere in there.



          Finally: if your browser starts searching when you type a short name that your DNS should resolve, you could try adding the protocol prefix (http:// or https://). If you need to connect to port 8000, then make sure to type it in as well.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f328563%2fproblem-with-apache-virtualhost-to-run-laravel%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














            First: you need to make sure your DNS server would resolve lara to your webserver. Alternatively, editing your hosts file could do.



            then, defining a virtualhost



            <VirtualHost /var/www/html/laravel40:8000>


            Should probably be replaced with



            <VirtualHost 1.2.3.4:8000>
            <VirtualHost fqdn:8000>
            or <VirtualHost *:8000>


            Also: just adding a virtualhost won't configure apache to listen on a new port. Look for /etc/apache2/ports.conf of your main apache configuration file, there should be some Listen 80 already present, make sure to add Listen 8000 somewhere in there.



            Finally: if your browser starts searching when you type a short name that your DNS should resolve, you could try adding the protocol prefix (http:// or https://). If you need to connect to port 8000, then make sure to type it in as well.






            share|improve this answer


























              1














              First: you need to make sure your DNS server would resolve lara to your webserver. Alternatively, editing your hosts file could do.



              then, defining a virtualhost



              <VirtualHost /var/www/html/laravel40:8000>


              Should probably be replaced with



              <VirtualHost 1.2.3.4:8000>
              <VirtualHost fqdn:8000>
              or <VirtualHost *:8000>


              Also: just adding a virtualhost won't configure apache to listen on a new port. Look for /etc/apache2/ports.conf of your main apache configuration file, there should be some Listen 80 already present, make sure to add Listen 8000 somewhere in there.



              Finally: if your browser starts searching when you type a short name that your DNS should resolve, you could try adding the protocol prefix (http:// or https://). If you need to connect to port 8000, then make sure to type it in as well.






              share|improve this answer
























                1












                1








                1






                First: you need to make sure your DNS server would resolve lara to your webserver. Alternatively, editing your hosts file could do.



                then, defining a virtualhost



                <VirtualHost /var/www/html/laravel40:8000>


                Should probably be replaced with



                <VirtualHost 1.2.3.4:8000>
                <VirtualHost fqdn:8000>
                or <VirtualHost *:8000>


                Also: just adding a virtualhost won't configure apache to listen on a new port. Look for /etc/apache2/ports.conf of your main apache configuration file, there should be some Listen 80 already present, make sure to add Listen 8000 somewhere in there.



                Finally: if your browser starts searching when you type a short name that your DNS should resolve, you could try adding the protocol prefix (http:// or https://). If you need to connect to port 8000, then make sure to type it in as well.






                share|improve this answer












                First: you need to make sure your DNS server would resolve lara to your webserver. Alternatively, editing your hosts file could do.



                then, defining a virtualhost



                <VirtualHost /var/www/html/laravel40:8000>


                Should probably be replaced with



                <VirtualHost 1.2.3.4:8000>
                <VirtualHost fqdn:8000>
                or <VirtualHost *:8000>


                Also: just adding a virtualhost won't configure apache to listen on a new port. Look for /etc/apache2/ports.conf of your main apache configuration file, there should be some Listen 80 already present, make sure to add Listen 8000 somewhere in there.



                Finally: if your browser starts searching when you type a short name that your DNS should resolve, you could try adding the protocol prefix (http:// or https://). If you need to connect to port 8000, then make sure to type it in as well.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 7 '16 at 3:18









                SYNSYN

                1,864415




                1,864415






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2funix.stackexchange.com%2fquestions%2f328563%2fproblem-with-apache-virtualhost-to-run-laravel%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

                    How to make a Squid Proxy server?

                    Is this a new Fibonacci Identity?

                    19世紀