How to detect the incoming httpd Connection Counts of each VHOSTS?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















With RHEL and Apache (httpd), is there a way to:



  • Detect which v.host (domain) is gaining how many incoming connections?

Because in this few days, I got a lot of incoming connections on the server being acknowledged by using:




  • ps aux | grep httpd -c



    734



That means I have 734 incoming connections currently being handled by Apache but the problem is I have (lets say) 10 Vhosts (domains).



  • So which domain is getting the high loads?









share|improve this question




























    0















    With RHEL and Apache (httpd), is there a way to:



    • Detect which v.host (domain) is gaining how many incoming connections?

    Because in this few days, I got a lot of incoming connections on the server being acknowledged by using:




    • ps aux | grep httpd -c



      734



    That means I have 734 incoming connections currently being handled by Apache but the problem is I have (lets say) 10 Vhosts (domains).



    • So which domain is getting the high loads?









    share|improve this question


























      0












      0








      0


      1






      With RHEL and Apache (httpd), is there a way to:



      • Detect which v.host (domain) is gaining how many incoming connections?

      Because in this few days, I got a lot of incoming connections on the server being acknowledged by using:




      • ps aux | grep httpd -c



        734



      That means I have 734 incoming connections currently being handled by Apache but the problem is I have (lets say) 10 Vhosts (domains).



      • So which domain is getting the high loads?









      share|improve this question
















      With RHEL and Apache (httpd), is there a way to:



      • Detect which v.host (domain) is gaining how many incoming connections?

      Because in this few days, I got a lot of incoming connections on the server being acknowledged by using:




      • ps aux | grep httpd -c



        734



      That means I have 734 incoming connections currently being handled by Apache but the problem is I have (lets say) 10 Vhosts (domains).



      • So which domain is getting the high loads?






      apache-httpd vhost






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 16 '16 at 10:52









      Jeff Schaller

      41.5k1056131




      41.5k1056131










      asked Apr 22 '14 at 3:03









      夏期劇場夏期劇場

      58471331




      58471331




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I would modify the access log format to include the host string in the log. Then it is a simple matter to sort and count by vhost. These are the apache configuration lies I use.



          # Modified log format with virtual host, execution time, and query params
          LogFormat "%v:%p %a %T %u %t "%r" %>s %O "%Refereri" "%User-Agenti"" local

          # Define an access log for VirtualHosts that don't define their own logfile
          CustomLog /var/log/apache2/access.log local


          This can be counted using a command like:



          cut -dt -f1 access.log | sort | uniq -c


          Or you can use awk (which allows selection by time of day and/or other data):



          awk 'print $1' access.log | sort | uniq -c


          Alternatively use separate access logs for each vhost. A simple word count on the active access logs would answer your question.



          To check the current activity enable the mod-status plugiyn and fetching the status using the URL http://127.0.0.1/server-status. The output will include the last URL processed by each slot as well as its current state. This information can be used to determine the current state. Using the output of the URL http://127.0.0.1/server-status?notable may be easier to parse.



          The command w3m -dump http://127.0.0.1/server-status?notable povides a nice text dump. However, the comamands wget or curl are commonly used for this kind of query.






          share|improve this answer

























          • Hi @BillThor will it show the current (live) number of connections (for each VHosts), please?

            – 夏期劇場
            Apr 22 '14 at 5:33












          • @夏期劇場 Using the server-status modules output will give the current state when run. I have updated my response accordingly.

            – BillThor
            Apr 23 '14 at 1:16











          • does it give connection counts per Virtualhost?

            – mustafa
            Mar 14 '16 at 9:03










          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%2f125904%2fhow-to-detect-the-incoming-httpd-connection-counts-of-each-vhosts%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









          0














          I would modify the access log format to include the host string in the log. Then it is a simple matter to sort and count by vhost. These are the apache configuration lies I use.



          # Modified log format with virtual host, execution time, and query params
          LogFormat "%v:%p %a %T %u %t "%r" %>s %O "%Refereri" "%User-Agenti"" local

          # Define an access log for VirtualHosts that don't define their own logfile
          CustomLog /var/log/apache2/access.log local


          This can be counted using a command like:



          cut -dt -f1 access.log | sort | uniq -c


          Or you can use awk (which allows selection by time of day and/or other data):



          awk 'print $1' access.log | sort | uniq -c


          Alternatively use separate access logs for each vhost. A simple word count on the active access logs would answer your question.



          To check the current activity enable the mod-status plugiyn and fetching the status using the URL http://127.0.0.1/server-status. The output will include the last URL processed by each slot as well as its current state. This information can be used to determine the current state. Using the output of the URL http://127.0.0.1/server-status?notable may be easier to parse.



          The command w3m -dump http://127.0.0.1/server-status?notable povides a nice text dump. However, the comamands wget or curl are commonly used for this kind of query.






          share|improve this answer

























          • Hi @BillThor will it show the current (live) number of connections (for each VHosts), please?

            – 夏期劇場
            Apr 22 '14 at 5:33












          • @夏期劇場 Using the server-status modules output will give the current state when run. I have updated my response accordingly.

            – BillThor
            Apr 23 '14 at 1:16











          • does it give connection counts per Virtualhost?

            – mustafa
            Mar 14 '16 at 9:03















          0














          I would modify the access log format to include the host string in the log. Then it is a simple matter to sort and count by vhost. These are the apache configuration lies I use.



          # Modified log format with virtual host, execution time, and query params
          LogFormat "%v:%p %a %T %u %t "%r" %>s %O "%Refereri" "%User-Agenti"" local

          # Define an access log for VirtualHosts that don't define their own logfile
          CustomLog /var/log/apache2/access.log local


          This can be counted using a command like:



          cut -dt -f1 access.log | sort | uniq -c


          Or you can use awk (which allows selection by time of day and/or other data):



          awk 'print $1' access.log | sort | uniq -c


          Alternatively use separate access logs for each vhost. A simple word count on the active access logs would answer your question.



          To check the current activity enable the mod-status plugiyn and fetching the status using the URL http://127.0.0.1/server-status. The output will include the last URL processed by each slot as well as its current state. This information can be used to determine the current state. Using the output of the URL http://127.0.0.1/server-status?notable may be easier to parse.



          The command w3m -dump http://127.0.0.1/server-status?notable povides a nice text dump. However, the comamands wget or curl are commonly used for this kind of query.






          share|improve this answer

























          • Hi @BillThor will it show the current (live) number of connections (for each VHosts), please?

            – 夏期劇場
            Apr 22 '14 at 5:33












          • @夏期劇場 Using the server-status modules output will give the current state when run. I have updated my response accordingly.

            – BillThor
            Apr 23 '14 at 1:16











          • does it give connection counts per Virtualhost?

            – mustafa
            Mar 14 '16 at 9:03













          0












          0








          0







          I would modify the access log format to include the host string in the log. Then it is a simple matter to sort and count by vhost. These are the apache configuration lies I use.



          # Modified log format with virtual host, execution time, and query params
          LogFormat "%v:%p %a %T %u %t "%r" %>s %O "%Refereri" "%User-Agenti"" local

          # Define an access log for VirtualHosts that don't define their own logfile
          CustomLog /var/log/apache2/access.log local


          This can be counted using a command like:



          cut -dt -f1 access.log | sort | uniq -c


          Or you can use awk (which allows selection by time of day and/or other data):



          awk 'print $1' access.log | sort | uniq -c


          Alternatively use separate access logs for each vhost. A simple word count on the active access logs would answer your question.



          To check the current activity enable the mod-status plugiyn and fetching the status using the URL http://127.0.0.1/server-status. The output will include the last URL processed by each slot as well as its current state. This information can be used to determine the current state. Using the output of the URL http://127.0.0.1/server-status?notable may be easier to parse.



          The command w3m -dump http://127.0.0.1/server-status?notable povides a nice text dump. However, the comamands wget or curl are commonly used for this kind of query.






          share|improve this answer















          I would modify the access log format to include the host string in the log. Then it is a simple matter to sort and count by vhost. These are the apache configuration lies I use.



          # Modified log format with virtual host, execution time, and query params
          LogFormat "%v:%p %a %T %u %t "%r" %>s %O "%Refereri" "%User-Agenti"" local

          # Define an access log for VirtualHosts that don't define their own logfile
          CustomLog /var/log/apache2/access.log local


          This can be counted using a command like:



          cut -dt -f1 access.log | sort | uniq -c


          Or you can use awk (which allows selection by time of day and/or other data):



          awk 'print $1' access.log | sort | uniq -c


          Alternatively use separate access logs for each vhost. A simple word count on the active access logs would answer your question.



          To check the current activity enable the mod-status plugiyn and fetching the status using the URL http://127.0.0.1/server-status. The output will include the last URL processed by each slot as well as its current state. This information can be used to determine the current state. Using the output of the URL http://127.0.0.1/server-status?notable may be easier to parse.



          The command w3m -dump http://127.0.0.1/server-status?notable povides a nice text dump. However, the comamands wget or curl are commonly used for this kind of query.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 23 '14 at 1:15

























          answered Apr 22 '14 at 3:35









          BillThorBillThor

          7,6931425




          7,6931425












          • Hi @BillThor will it show the current (live) number of connections (for each VHosts), please?

            – 夏期劇場
            Apr 22 '14 at 5:33












          • @夏期劇場 Using the server-status modules output will give the current state when run. I have updated my response accordingly.

            – BillThor
            Apr 23 '14 at 1:16











          • does it give connection counts per Virtualhost?

            – mustafa
            Mar 14 '16 at 9:03

















          • Hi @BillThor will it show the current (live) number of connections (for each VHosts), please?

            – 夏期劇場
            Apr 22 '14 at 5:33












          • @夏期劇場 Using the server-status modules output will give the current state when run. I have updated my response accordingly.

            – BillThor
            Apr 23 '14 at 1:16











          • does it give connection counts per Virtualhost?

            – mustafa
            Mar 14 '16 at 9:03
















          Hi @BillThor will it show the current (live) number of connections (for each VHosts), please?

          – 夏期劇場
          Apr 22 '14 at 5:33






          Hi @BillThor will it show the current (live) number of connections (for each VHosts), please?

          – 夏期劇場
          Apr 22 '14 at 5:33














          @夏期劇場 Using the server-status modules output will give the current state when run. I have updated my response accordingly.

          – BillThor
          Apr 23 '14 at 1:16





          @夏期劇場 Using the server-status modules output will give the current state when run. I have updated my response accordingly.

          – BillThor
          Apr 23 '14 at 1:16













          does it give connection counts per Virtualhost?

          – mustafa
          Mar 14 '16 at 9:03





          does it give connection counts per Virtualhost?

          – mustafa
          Mar 14 '16 at 9:03

















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f125904%2fhow-to-detect-the-incoming-httpd-connection-counts-of-each-vhosts%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

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)