apache2 – How to debug strange server behavior (truncated text in some files)

It's a strange one. I administer a FreePBX server using its standard distribution based on CentOS 7 running on a virtual machine.

From time to time (usually a few months between occurrences), the dashboard or the User Control Panel (UCP) will stop working. If you check the browser console, you will see strange JS errors. If you click on the file that generates the error, you will find that the operation goes well until half the time, then a completely scrambled section of text (example below).

The strange part is that when I check the file on the server, it's quite normal (no truncated text). Thus, during transmission, the file is disrupted between the server disk and the client browser. I can even loop the file locally from the server and it is properly served.

I've tried restarting httpd (apache2) and the UCP service with no effect. I have tried several browsers and completely disabled caching, so this is not a client-side cache problem. The only solution I found was a full restart of the FreePBX server.

Unfortunately, I can not predict when this will happen again so I can not test theories in real time. But if you have suggestions, I will record a link to this question and check it next time.

What does the problem look like:

...
if (isCanvasSupported) {
this._eventManager.ghostCtx.beginPath ();
this._eventManager.ghostCtx.rect (plotArea.x1, plotArea.y1, plotArea.width, plotArea.height);
this._eventManager.ghostCtx.clip ();
}

for (var j = 0; j <plotUnit.dataSeriesIndexesR¡Ñàà ~ àxñÀ ... à † † U0FüÏs € Ĺ {1 £ R £ Ñàà ~ ñÀf
üv Ýð²Ïÿå?
mx ³³Á¸íQ € Ï Ï p 0pOü / (N p
& N ÷ îuñÀ
/ û Û (wFïÿHuvï% † Ahpðå|Y & -J $ @ Ép¯ü
¹- <¸ · pí & †
@ ||-ñ ñ ñ ñ ñ ñ ñ!!!!!!!!!!!
ü s s x x a a a • • • • • • • • • ð ð ð ð ð ð ð ð ð
ðRhUzÇr € t³ "A" ã: bA¤íà ~ ñÀ6 / ü¸rw (u
# ((((((((((((((((((((10 ((10 10 10 10 10 10 10 10 10
ý q ((ÿ ÿ ÿ ÿ ÿ ÿ ÿ & 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 € € € € € € € €<0ôAü&" é‘�Ïp��60ÝOüÏs �� ƒ!!�
S�;ƒážààÏÑÀà~ñÀáÅÏq€�ø­Au‚Ð���€�¢–Ïÿº¯ü©pe�üñÀæÏûáÀÏv€�ø­¡†w"…Š Ã/qÊ B
"�Ê!Â��J
 �épÂ
 ��Àú¯ü‹pƒè©peðÏp �� €�ÙñpÊ!o�€áÊ Á ¦Ïp€�œ�€€à��Á@&�¶
 ©r…q�f��!…$xqÊ ‚��N0Bü> ... Œ z0ð Aü¸Cp ... nÿ Ù & ...! YAy # ¥ & # 39; ... ¥ & # 39; & # 39; É † "" "V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V V `@ @ ¢ ¢" "" 3 3 à à à à à à à à à à à à à à à à à à à à à à
Ø
JÿÀÀÀÀÀ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ÀÀÀÀÀj - - --G €
† B † H € ê! to €? † J
qÿÞ¾
there
Øïÿ
p € €! Aïr [‚€–"�z€âÊ%)    Ïp€�Ĺ
€äèïû©pñÀ¶
Ïû
%�(vÊ ��A0DüÏp€�ø­€è�€èÏp��C0-ü…è
Ïü�Ø¥¥…è
ïüÉq�Ø¥ÿØÕïû¥Ïr€�ø­è"€&¢�€ðÿØ¢�Ø¢Ïp �� €¢à ¢àxñÀáÅÏq€�ø­£€åÊ ��:0Èü�…¡©pªïýÙ•€¸µ�Ø�¥}ïû©pàxñÀèÏr€�ø­d‚ë ƒéÏp��80ü�£¢ð ¹'°¢�€
è'÷    €Ïp��J0müÑÀà~ñÀ¾ÏûÿÞ�ÝÉwðå¯}9
ž �©pð©v @�uè/*�N"„)Ïr€�)0"Bã
P‡âÊ'AîññvÊ ‚��ÿ�Ì&Ì'ò0Ù¾Ô~Ïp€�̹f ¦XÙ¿ôø`  ±ÏûàxñÀ¦    ü¢ÿÑÀà~àx¸Çp€�Ì' �Ù% à& àx C�R�
”�ð@*ƒya0púÏÿà(pàxñÀy"‚�+
Q�c€ëB€
»zb–"�"z?ºR"€Ê ��'0xü" $ðˆE
’�b€    ðE€
º[cb ðù“!Â�
R�÷„ð���byA)ÀR �€ò  „���Ïp��$0-üÑÀà~ñÀ~Ïû�ÝÏp€�Ĺ-€©w
ð‘¸x� Ž€�ȳ
ïü©p †é)€�wÀ}Ê'$€�Ò�‘žíæñ€åÊ%A(vìñ‘ÏûñÀ&ÏûÏq �� Û�Ù B�Y ?”]    $ € Ĺð $ € & ¥ ... $ í3 • ƒf ... @ € ... € d ... B € zbD ¥ "! c • å €
¿H ...
"[câ{Â{ R�âzD¥OÁ
ƒ¬¹3µÞñ €(¹/y áÊ †��f0Hü”žª¸´Ïr€�œ�‚a¸�¢Ïp€�ø¹Ž
ÏüåÏûñÀÏq€�Ĺmð`ƒ7ë3“ý ƒ#“     Dƒ �   R�Ïq€�'IR"�ºYaDê�Ù
ðÏp��k0ÙüC‚"Eƒ„ƒ
ºdHƒ
ºšbYaÇq���q ÏÿÏp��c0­üÑÀà~àxñÀò ïûÙªÁ:pJ � ~    ïý‹p…Àv ïýÙ
rð5jÇq€�ÌQ�ejq|ôƒp` &% âß
Ïp€�Ĺ̀
u"ð–?^–ìŽÞ«¸¶ Ð#op ƒé€è5oÇq€�ÌeF@&�zb’¯ü*q%ÍÀ†àî
  @#ð/(AN ‚Hp"
ïÿÙ%öíïûªÀñÀ: Ïû�Ý
 €/€�ij©sð@+!���ÿTkTz� € # ,B0â@ !Ya! )k$°ãÙˆ„/��ÿÿÏp€�Ä»uXƒÏw€�Ĺ�Þ   ð2n4yo8`nïýÙæó‘­§®§@ �!§B'�ïû§àxñÀ�ÙÏt€�ø­„(rð`€qhpè'âõ    €Ïp��x09ü„qPÜÌ"ƒÊ ‚��y0 üÑÀà~ñÀrÏûtÏu€�Ì@%ð/*N"ƒo{Ukºbæ‚$Ì?gæ¢ôì/(�N ¹ fxŒ €È÷º��€àÐ
aÿÊ ¡‰�ÏûÏq€�à¸xà�aàxñÀ„àÊ †��‚0¨üÏq€�ܸx�aÑÀà~ñÀî¯ûJ%��¨uðJ%@�åU
ž    �©p˜pÿØøpï�Š }Ïv€�)Øp0&@Š ×ámÏU‘n     �épÀ/¾0&A @Ì ×õçðñÆ   ¨péûàxÏp€�´€‚àØà �àx2h4y�!€€�Øà~àxñÀq�Ø…áÊ †��0ì�üsðÏt€�ÜRkTzDd�Ú"B�„z€âÊ ãpèÑÀà~àxáÅ�ÜÏq€�´@!  @!ðŠ ÿ!
�¥äõT‘�ÜðŠ ÿ#
�¥äõ‘�Û ðŠ$ÿkxX`€ ãõØ¡ÚH¡R¡Ø¡T¡àÁÅàxz
5�ÙºTzÏs€�ØBc   €�(pðØà~ñÀx…àÊ †��0,�ü‚ýÑÀà~àxñÀqŠ ÿ…áÊ †��0�ü�ÜðRlTzÇr€�´j‚   N�‚ä
Œ ÿóóÑÀà~ñÀ…àÊ †��a�ÔæûÀ(æ&ýxÑÀà~àxñÀx„àÊ †�� 0´ÆûÞÏýÑÀà~àxñÀ„àÊ †��0˜ÆûÂÏýxÑÀà~àxáÅ�ÚÏs€�´U£Hqðá?   ixx`‰€Œ$ÿŸøó
€vè/,N$„-Ït€�)0$L
âU£�Ø @íñàÁÅàxñÀáÅÏu€�|­ìH³Ïp€�¤­AÀÏp€�lBÀÏp€�tCÀØDÀ�ØÙÚÛ
$€€�|
%€€�PJ&€Ž øpÏq��À¶à©p�Øroýq¥¯û¥Ààxà~àxà~àxà~àxÙÏp ��= à~Ïp��­Þà~Ïq€�Dsà¡+ÈÇp€�g ˆá ¨�ˆR�Š �Ï°ŠØ¸ðŠ �Ï°Bؘ¸à~ñÀØ
    à�ÙØÏq �€¡ €�øÿÿ¡Ïp€�0iˆÏq ��(‚àØÀx¸ƒ¸¸… ’�¡   ïûØÑÀà~àxñÀ~û„(�!€€��)(��!€��*@!@!@!    Q&À€Š"�Ê"!�B„��ÝðÏw€�”¯gÉ€ëcd~tÄ{/+Á�N#ŽËdpªåW
é€Ïs€�ŒªcÏt€�$’D/*ÁN"ŽÎd�$BÀªÕä~/.N&îdȪ«Þ€h€†åÓ#¦�/+Á�N#ŒÏs€�À‹cÕñ�Ýði€ém€åÊ'AîfÄ{ÔÄ{/+Á�N#ŽËdpªå]
• I do not want to have any dollars / + N # ëd Odudz / * N "ƒkd @ $ ºbfª§Þ € h åÓ # ¡/ + Á N # Œïs € <À <cÓ óð (€ € ¼ b b y y y y!!! Uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu € @ € € € € € @ Ú a a • • • • ¹,,,,,, x x x x x x x x x[
‰à
©   ûñÀ’
û
 €/€�eturn animationInfo;
    }

    Chart.prototype.renderArea = function (plotUnit) {
        var ctx = plotUnit.targetCanvasCtx || this.plotArea.ctx;

        var totalDataSeries = plotUnit.dataSeriesIndexes.length;

        if (totalDataSeries <= 0)
            return;

        var ghostCtx = this._eventManager.ghostCtx;

        var axisXProps = plotUnit.axisX.lineCoordinates;
        var axisYProps = plotUnit.axisY.lineCoordinates;
        var markers = [];
var markerPropsColor = null;

var plotArea = this.plotArea;
var previousNotNullDataPoint, currentDataPoint;
ctx.save ();
...

apache2 – command line problem cgi ok but 403 on the site

I'm running on Debian 9 strech, hello.cgi

command line

perl -cTw hello.cgi 

All is well

When I try to navigate the subdirectory, I receive a 403 error.

I'm adding a few lines to apache2.conf to run CGI in a special directory.


    
    
    
    Options + ExecCGI
AddHandler cgi-script .cgi

I put the permission to hello.cgi

chmod 755 hello.cgi

I do not know why?

ubuntu – The default page of Apache2 says without http: //, https: // or www. prefix

I'm running a Django web application on an Ubuntu 19.04 server with Apache2. I have installed an SSL certificate with certbot and I am having trouble directing traffic from domainname.com to https://www.domainname.com. Whenever I browse on domainname.com, the default Apache page is displayed. If I browse on www.domainname.com, the website displays as expected. I have not found a solution that works for me, which bothers me, is that I have an SSL certificate and two configuration files.

By running certbot, an additional configuration file has been created. I now have domainname.conf and domainname-the-ssl.conf. Now, in my domain name.conf, I've added a rewrite so that all the traffic on my port 80 is redirected to https:


        
        
        
        # The ServerName directive defines the query schema, hostname, and port that
# the server uses to identify itself. This is used during creation
# Redirect URL. In the context of virtual hosts, the ServerName
# specifies the host name that should appear in the Host header: of the request
# corresponds to this virtual host. For the default virtual host (this file), this
The # value is not critical because it is used at all times as a last resort host.
# However, you must explicitly set it for any other virtual host.

ServerName www.domainname.com
ServerAdmin *******
DocumentRoot / var / www / html

# Available connection levels: trace8, ..., trace1, debug, info, notification, warn,
# error, crit, alert, emergent.
# It is also possible to configure the logging level for
# modules, for example
#LogLevel info ssl: warn

ErrorLog $ {APACHE_LOG_DIR} /error.log
CustomLog $ {APACHE_LOG_DIR} /access.log combined

# For most conf-available / configuration files, which are
# enabled or disabled globally, it is possible to
# include a line for a single virtual host. For example,
The following line enables CGI configuration for this host only
# after being globally disabled with "a2disconf".
#Include conf-available / serve-cgi-bin.conf


RewriteEngine on
RewriteCond% {SERVER_NAME} = www.domainname.com
RewriteRule ^ https: //% {SERVER_NAME}% {REQUEST_URI} [END,NE,R=permanent]









# vim: syntax = apache ts = 4 sw = 4 sts = 4 sr noet

My domain-name-the-ssl.conf was generated automatically by certbot and has no rewrite. Now I have tried some rewrites, but no one seems to understand that all traffic should go through https and on www.domainname.com. Is this something that I should correct in this file or at the service where I registered my domain?

apache – failed redirection of http to https apache2 in Ubuntu 16.04 in Amazon EC2

Hi, I'm telling you that I'm trying to redirect my site from http: // to https: //
I would like to redirect it by Apache but I can not get redirection to work.
I tell you a bit about what I did to see if it helps.

The virtual host is an Amazon EC2. Ubuntu 16.04 with apache2 + php + mysql + phpmyadmin.

On the next route, I understand that there are Apache settings for sites. / etc / apache2 / sites-available

In this folder I find two files
the 000-default.conf and default-ssl.conf
I understand that one is the normal configuration file and the other is the ssl file. the ssl was activated via the command sudo a2enmod ssl and after sudo a2ensite default-ssl.conf

The domain certificate is configured from the amazon certificate and I have created a load balancer accessible from http and https ports.

At this point, I went to the record /etc/apache2/sites-available/000-default.conf where I suppose it is in the main port configuration * 80.

That's what I first did without touching it.


       
        
       
        
       
        
       
        Webmaster ServerAdmin @ localhost
DocumentRoot / var / www / html / public

ErrorLog $ {APACHE_LOG_DIR} /error.log
CustomLog $ {APACHE_LOG_DIR} /access.log combined


and then I created I added the following code before the default configuration.


  
  
  
  ServerName yourdomain.com
Alias ​​www.yourdomain.com
Redirect permanent / https://www.yourdomain.com/





        

        

        

        Webmaster ServerAdmin @ localhost
DocumentRoot / var / www / html / public


ErrorLog $ {APACHE_LOG_DIR} /error.log
CustomLog $ {APACHE_LOG_DIR} /access.log combined

  

PS: I've also tried removing the initial configuration and leaving only the redirection code but doing nothing either.

I leave the code pro default-ssl.conf if it works for you
have so someone can help me thank you in advance.


        
                
                
                
                Webmaster ServerAdmin @ localhost

DocumentRoot / var / www / html / public

ErrorLog $ {APACHE_LOG_DIR} /error.log
CustomLog $ {APACHE_LOG_DIR} /access.log combined

SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

                
                                SSLOptions + StdEnvVars
                
                
                                
                                
                                
                                SSLOptions + StdEnvVars
                

	








# vim: syntax = apache ts = 4 sw = 4 sts = 4 sr noet

Apache 2.2 – Apache2 Reverse Proxy with Caching Responses

I'm using Apache as a reverse proxy for an application running on a local port. I want to cache the responses of this application. So, frequently asking the same URL should give me Apache's cached answers, not new answers from the application itself. Note: these are dynamic responses to GET requests, do not static files. I read the documentation and decided to go with Memcached.

Here is my configuration:

CacheEnable socache /
CacheSocache memcache: localhost: 11211
CacheHeader on
CacheDefaultExpire 86400
CacheMaxExpire 604800

ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
ProxyPass / http: // localhost: 2322 / nocanon
ProxyPassReverse / http: // localhost: 2322 /
ProxyPassReverse / http://my.domain.com/
RequestHeader sets X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

In one way or another, absolutely nothing is stored in Memcached when I check the stats. What am I doing wrong?

apache2 – How to improve the performance of the local host on Ubuntu 18 on the Windows for Linux subsystem

Ubuntu 18 is installed on a Windows laptop. In general, I'm happy, but recently, the performance really took a hit. The configuration of my local host is a pretty Apache / Mysql vanilla and a handful of useful programming languages. For now, I can not access my locally hosted sites or it takes a long time for things to start working. The only errors I see in the Apache log are [core:notice] [pid 49] AH00051: child pid output signal 62 Segmentation failure (11), coredump possible in / etc / apache2. I do not receive any error in the browser and things finally work. So, I do not know how to proceed to diagnose and solve the problem from now on. Any advice appreciated.

Migration of a Magento installation from Apache2 to NGINX under Ubuntu 18.04 LTS




Magento is one of the world's leading CMS solutions for e-commerce and is used by more than 200,000 websites. What makes Magento such an attractive eCommerce CMS is that Magento offers a free, community-based edition of its platform. Anyone with knowledge of Linux and access to a modest virtual machine can start their online store in no time. Magento runs on a Linux stack, offering great flexibility to the open source components used to power the store. The first typical choice of a Linux web server is usually Apache, making it a stable and reliable choice. However, other options may offer better performance with reduced use of system resources. One such popular alternative is NGINX.

In this guide, we will explain the migration process of an existing Magento installation from Apache to NGINX on Ubuntu 18.04 LTS.

Preconditions

To follow this guide, you will need the following:

  • An 18.04 Ubuntu server.
  • A Magento installation.
  • A non-root sudo user account on the Magento server.

In order to start this guide, you must connect to your server as a user compatible with sudo.

Put Magento in maintenance mode

During this guide, we will stop and start the web servers, which will make appear and disappear your Magento shop for any user accessing it. This is not a great experience for your customers. We will avoid this problem by placing Magento in maintenance mode. When Magento is in maintenance mode, any visitor will see a page on hold and will not be able to interact with your store.

You put Magento in maintenance mode by running the following command:

sudo php / path / to / magento2 / bin / magento maintenance: enable --ip =

the --ip = This option will allow you to access your store from your IP address, while all other IP addresses will see the service page. This will allow you to see and verify that the store is working while maintaining maintenance mode for visitors.

Now that Magento is in maintenance mode, we can install NGINX.

Step 2 – Installation

In this step, we will install NGINX and PHP-FPM packages. NGINX uses PHP-FPM, a new and powerful implementation of the PHP standard. If you already use PHP-FPM with Apache, you can remove it from the apt-get install order but leaving it in place will not pose a problem.

We should stop Apache here, otherwise the installation will encounter an error when APT tries to start NGINX while Apache is running. The following commands will stop the Apache runtime and will prevent it from indicating at startup:

sudo systemctl stop apache2.service
sudo systemctl disable apache2.service

Run the following command to install NGINX and PHP-FPM:

sudo apt-get install php nginx-fpm

NGINX is now installed and ready for configuration.

Installing NGINX and PHP-FPM

In this step, we will configure NGINX to serve only one Magento HTTP instance. If your Magento instance uses HTTPS, proceed to the next section, which discusses the migration of an HTTPS Magento instance.

NGINX works like Apache in that it has two directories / etc / nginx / sites-available and / etc / nginx / sites-enabled that contain the web server configuration to service your store. We will first place the configuration file in / etc / nginx / sites-available then create a symbolic link to this file / etc / nginx / sites-enabled which will allow NGINX to start serving your site.

We will create and edit the site configuration file using a text editor. I will use nano throughout this guide, but you can use the one you are most comfortable with:

sudo nano /etc/nginx/sites-available/magento.conf

The contents of this file should look like the following basic example (do not forget that you have to edit exmaple.com and / var / www / magento2 to match your configuration):

server {
listen to 80;
Server name ;
set $ MAGE_ROOT / path / to / magento2;
include /path/to/magento2/nginx.conf.sample;
}

upstream fastcgi_backend {
unix server: /var/run/php/php7.1-fpm.sock;
}

The above configuration assumes that you are using PHP 7.1 (the default) on your server. If you use a different version, you will have to modify the line. unix server: /var/run/php/php7.1-fpm.sock; to match the version of PHP and PHP-FPM you are using. If you run:

ls / var / run / php /

You will see the name of the PHP-FPM socket you need to use.

The following line:

include /path/to/magento2/nginx.conf.sample;

forces NGINX to load an additional configuration contained in the file /path/to/magento2/nginx.conf.sample. This file is provided by Magento and contains a very important additional configuration, such as blocking access to confidential files, adjusting compression, and so on. If you do not have a copy of this file, you can download one from these locations:

You will need to include this file for this NGINX configuration file to serve your store.

Now that the configuration file is in place, we need to activate it by creating a symbolic link from enabled for sites with the following command:

sudo ln -s /etc/nginx/sites-available/magento.conf / etc / nginx / sites-enabled /

Then reload NGINX:

sudo systemctl reload nginx.service

NGINX should now serve your store. You should visit your store in a browser to check that it is operating normally. If your site does not display properly after migration, it is likely that the cache and indexed data are out of date. Clearing the cache and reindexing the site with these two commands will solve this problem:

sudo php / path / to / magento2 / bin / magento cache: flush
sudo php / path / to / magento2 / bin / magento indexer: reindex

The site should now work normally. You must visit both the home page and the administration pages to make sure that they work as intended. The following command disables maintenance mode and resumes normal operation of the site:

sudo php / path / to / magento2 / bin / magento maintenance: disable

Your Magento instance is now migrated to NGINX as a web server.

Migrating an HTTPS Magento Instance

In this step, we will configure NGINX to service an HTTPS-compatible Magento instance. NGINX works like Apache in that it has two directories / etc / nginx / sites-available and / etc / nginx / sites-enabled which contain the configuration of the site. We will first place the configuration file in / etc / nginx / sites-available then create a symbolic link to this file / etc / nginx / sites-enabled which will allow NGINX to start serving your store.

We will create and edit the site configuration file using a text editor. I will use nano throughout this guide, but you can use the one you are most comfortable with:

sudo nano /etc/nginx/sites-available/magento.conf

The following file will serve an HTTPS site. The first server block automatically redirects all visitors arriving on HTTP to the HTTPS site:

server {
listen to 80;
Server name ;
return 301 https: // $ servername $ request_uri;
}

server {
listen to 443 ssl;
Server name ;

ssl on;
ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;

set $ MAGE_ROOT / path / to / magento2;
include /path/to/magento2/nginx.conf.sample;
}

upstream fastcgi_backend {
unix server: /run/php/php7.1-fpm.sock;
}

The above configuration assumes that you are using PHP 7.1 (the default) on your server. If you use a different version, you will have to modify the line. unix server: /var/run/php/php7.1-fpm.sock; to match the version of PHP and PHP-FPM you are using. If you run:

ls / var / run / php /

You will see the name of the PHP-FPM socket you need to use.

The following line:

include /path/to/magento2/nginx.conf.sample;

forces NGINX to load an additional configuration contained in the file /path/to/magento2/nginx.conf.sample. This file is provided by Magento and contains a very important additional configuration, such as blocking access to confidential files, adjusting compression, and so on. If you do not have a copy of this file, you can download one from these locations:

You will need to include this file for this NGINX configuration file to serve your store.

Now that the configuration file is in place, we need to activate it by creating a symbolic link from enabled for sites with the following command:

sudo ln -s /etc/nginx/sites-available/magento.conf / etc / nginx / sites-enabled /

Then reload NGINX:

sudo systemctl reload nginx.service

NGINX should now serve your store. You should visit your store in a browser to check that it is operating normally. If your site does not display properly after migration, it is likely that the cache and indexed data are out of date. Clearing the cache and reindexing the site with these two commands will solve this problem:

sudo php / path / to / magento2 / bin / magento cache: flush
sudo php / path / to / magento2 / bin / magento indexer: reindex

The site should now work normally. You must visit both the home page and the administration pages to make sure that they work as intended. The following command disables maintenance mode and resumes normal operation of the site:

sudo php / path / to / magento2 / bin / magento maintenance: disable

Conclusion

Your site should now operate normally and take advantage of NGINX's increased performance and reduced resource requirements. If you need more information about setting up and tuning NGINX, you can find their documentation on their website here.




ulimit – Using the full Apache2 processor after exit with error (it's impossible to create a worker thread)

I have my outgoing Apache2.4 (mpm_worker) instance with the following log:

[Mon May 27 11:27:33.196177 2019] [core:warn] [pid 567365:tid 139765793668032]    AH00045: The child process 567368 has still not been closed, sending a SIGTERM
[Mon May 27 11:27:35.198179 2019] [core:warn] [pid 567365:tid 139765793668032]    AH00045: The child process 567368 has still not been closed, sending a SIGTERM
[Mon May 27 11:27:37.200177 2019] [core:error] [pid 567365:tid 139765793668032]    AH00046: child process 567368 still has not stopped, sending a SIGKILL
[Mon May 27 11:27:38.297736 2019] [core:warn] [pid 569972:tid 140126180117440]    AH00098: pid file /var/run/apache2/apache2.pid overwritten - Uncleaned shutdown of the last Apache runtime?
[Mon May 27 11:27:38.300264 2019] [mpm_worker:notice] [pid 569972:tid 140126180117440]    AH00292: Apache / 2.4.29 (Ubuntu) OpenSSL / 1.1.0g configured - resume normal operations
[Mon May 27 11:27:38.300296 2019] [core:notice] [pid 569972:tid 140126180117440]    AH00094: Command line: / usr / sbin / apache2 & # 39;
[Mon May 27 11:27:38.303713 2019] [mpm_worker:alert] [pid 569975:tid 140126052628224]    (11) Resource temporarily unavailable: AH03142: apr_thread_create: unable to create a worker thread
[Mon May 27 11:27:38.359830 2019] [mpm_worker:alert] [pid 569973:tid 140126180117440]    (11) Resource temporarily unavailable: AH00282: apr_thread_create: Can not create a worker thread.
[Mon May 27 11:27:38.371350 2019] [mpm_worker:alert] [pid 569974:tid 140126060156672]    (11) Resource temporarily unavailable: AH03142: apr_thread_create: unable to create a worker thread
[Mon May 27 11:27:40.302219 2019] [mpm_worker:alert] [pid 569972:tid 140126180117440]    AH02325: A shortage of resources or some other irremediable failure has been encountered before successful initialization of a child process ... httpd closes!

When reading the last line of the journal, I assumed that apache would be dead now.
Instead of top gives me a 320% CPU usage for Apache. It lasts forever (at least several days).
By reading the front lines of the journal, it is clear that after apache pretends to leave, it is impossible to shut down or kill a child process for any reason.

Googlerunable to create a worker thread& # 39; Direct me to the limits of the server resources and adjustment of the correct settings of apache2. Here is the Ulimit for www-data:

Ulimit for Apache

root @ xxx: ~ # sudo -u www-data bash -c-ulimit -a & # 39;
size of the base file (blocks, -c) 0
data segment size (kilobytes, -d) unlimited
planning priority (-e) 0
unlimited file size (blocks, -f)
pending signals (-i) 1546431
max memory locked (kilobytes, -l) 16384
maximum memory size (kilobytes, -m) unlimited
open files (-n) 105000
pipe size (512 bytes, -p) 8
POSIX message wait queues (bytes, -q) 819200
priority in real time (-r) 0
stack size (kilobytes, -s) 8192
CPU time (seconds, -t) unlimited
Maximum number of user processes (-u) 10000
virtual memory (kilobytes, -v) unlimited
Unlimited file locks (-x)

mpm_worker.conf


    
    
    
    StartServers 2
MinSpareThreads 5
MaxSpareThreads 10
ThreadLimit 64
ThreadsPerChild 5
MaxRequestWorkers 100
MaxConnectionsPerChild 50

Server information:

VPS: 6core 2Ghz
RAM: 8 GB
Usage: One instance of domain / apache for Nextcloud.

# 1

How can I debug what's going on with Apache after saying that it was abandoned, but that it was causing high CPU usage? (repair would be even better)

# 2

How can I adjust the worker settings to the case of use? (I guess that's the root cause)

Any help would be appreciated!
Thank you

xubuntu – I'm trying to install apache2 on my server (old computer) but I get an error

I'm trying to install Apache2 on my server but I have not managed to start the Apache HTTP Server.

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
Acheapache2-systemd.conf
Active: failed (result: exit code) since Mon 2019-05-27 09:42:27 GMT; 11min ago

May 27 09:42:27 Vizteck apachectl[18426]: AH00558: apache2: Unable to reliably determine server & # 39;
May 27 09:42:27 Vizteck apachectl[18426]: (98) Address already used: AH00072: make_sock: impossible
May 27 09:42:27 Vizteck apachectl[18426]: (98) Address already used: AH00072: make_sock: impossible
May 27 09:42:27 Vizteck apachectl[18426]: no soundings available, closing
May 27 09:42:27 Vizteck apachectl[18426]: AH00015: Can not Open Logs
May 27 09:42:27 Vizteck apachectl[18426]: The action 'start & # 39; has failed.
May 27 09:42:27 Vizteck apachectl[18426]: The Apache error log may contain more information.
May 27 09:42:27 Vizteck systemd[1]: apache2.service: closed control process, code = abandoned status = 1
May 27 09:42:27 Vizteck systemd[1]: apache2.service: Failed output "exit code".
May 27 09:42:27 Vizteck systemd[1]: Unable to start the Apache HTTP Server.
lines 1-16 / 16 (END)

server – The Apache2 service failed

I tried to start apache2 but this message failed

- The process "exit code is" left "and its exit status is 1.

May 23 21:35:57 kali systemd[1]:[0; 1; 39m[0; 1; 31m[0; 1; 39mapache2.service: Result failed "exit code".[0m
– Object: unit failed
– Defined by: systemd

– The unit apache2.service has entered the state "failure" with the result "exit code".
May 23 21:35:57 kali systemd[1]:[0; 1; 31m[0; 1; 39m[0; 1; 31Mailed to start the Apache HTTP Server.[0m
– Subject: Failure of a startup job for the unit apache2.service
– Defined by: systemd

– A startup job for the apache2.service unit is completed with a failure.

– The job ID is 1058 and the result of the job failed.