Mysql configuration having Cloudlinux

Greetings .. I have a question when you install and configure mysql governor is it necessary to adjust the mysql my.cnf file?

We have not… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1835479&goto=newpost

redirection – URL Redirects and Configuration Management

Yes indeed. If you wish to carry the redirects around you should probably export

Or manually create the file if they are not too many.

I would recommend a csv file.
You can check this for reference How do I export the list of URL alias into an excel or csv?

Then I would write a simple drupal migrate process to re import them in any environment. If you use csv file it should be quite simple for the redirects.

configuration – Deploying appconfigs to different environments

I have a project on Azure DevOps that uses an appconfig.

The appconfig holds sensetive data like usernames and passwords and is committed empty to the repo.

I have to deploy the project on two different environments that need two different appconfigs to run.

What would be the best practice in this case?

I’m conflicted between saving the appconfigs for the different environments and selecting the appropriate one to deploy vs them holding sensitive data and not wanting to save it anywhere.

apache 2.4 – SSL configuration – Lightsail

Having trouble getting SSL working on Amazon Lightsail using let’s encrypt (certbot --apache)

  • Lightsail image Centos7
  • Added Apache2

note: (example.com, subdomain.example.com are not my domains, I’m anonymizing them)

These are the troubleshooting steps I’ve taken.

  • I’m able to confirm 443 is open using netcat,

  • apache is listening using lsof -i -P -n | grep LISTEN

  • running this command from another system echo | openssl s_client -showcerts -servername example.com -connect gnupg.org:443 2>/dev/null | openssl x509 -inform pem -noout -text shows a let’s encrypt certificate (I don’t know how to validate it)

  • chrome shows ‘This site can’t provide a secure connection. example.com sent an invalid response. ERR_SSL_PROTOCOL_ERROR

  • this testing tool https://www.ssllabs.com/ssltest/analyze.html gives the result ‘Assessment failed: No secure protocols supported’

  • these are the instructions I’ve followed to install certbot
    https://certbot.eff.org/lets-encrypt/centosrhel7-apache

My SSL configuration:

<IfModule mod_ssl.c>
    SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
    SSLSessionCacheTimeout  300
    SSLRandomSeed startup file:/dev/urandom  256
    SSLRandomSeed connect builtin
    SSLCryptoDevice builtin

    <VirtualHost example.com:443>
        # This first-listed virtual host is also the default for *:80
        SSLEngine on
        SSLProtocol all -SSLv2 -SSLv3
        SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA

        ServerName example.com
        ServerAlias example.com
        DocumentRoot "/var/www/html/com.example"
        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
    </VirtualHost>
    </IfModule>
    <IfModule mod_ssl.c>
    <VirtualHost subdomain.example.com:443>
        SSLEngine on
        SSLProtocol all -SSLv2 -SSLv3
        SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA

        ServerName subdomain.example.com
        ServerAlias subdomain.example.com
        DocumentRoot "/var/www/html/com.example.subdomain/"
        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
    </VirtualHost>
</IfModule>

#certbot certificates

Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: example.com
    Serial Number:XXXXXXXXXXXXXXXXXXXXXXXX
    Key Type: RSA
    Domains: example.com subdomain.example.com
    Expiry Date: 2021-04-16 18:02:53+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Loaded apache Modules:

core mod_so http_core mod_access_compat mod_actions mod_alias mod_allowmethods mod_auth_basic mod_auth_digest mod_authn_anon mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authn_socache mod_authz_core mod_authz_dbd mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_owner mod_authz_user mod_autoindex mod_cache mod_cache_disk mod_data mod_dbd mod_deflate mod_dir mod_dumpio mod_echo mod_env mod_expires mod_ext_filter mod_filter mod_headers mod_include mod_info mod_log_config mod_logio mod_mime_magic mod_mime mod_negotiation mod_remoteip mod_reqtimeout mod_rewrite mod_setenvif mod_slotmem_plain mod_slotmem_shm mod_socache_dbm mod_socache_memcache mod_socache_shmcb mod_status mod_substitute mod_suexec mod_unique_id mod_unixd mod_userdir mod_version mod_vhost_alias mod_dav mod_dav_fs mod_dav_lock mod_lua prefork mod_proxy mod_lbmethod_bybusyness mod_lbmethod_byrequests mod_lbmethod_bytraffic mod_lbmethod_heartbeat mod_proxy_ajp mod_proxy_balancer mod_proxy_connect mod_proxy_express mod_proxy_fcgi mod_proxy_fdpass mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_proxy_wstunnel mod_ssl mod_systemd mod_cgi mod_php5

settings – Any way to preserve portable hotspot configuration (SSID, key)?

How can I preserve my initial portable hotspot configuration (mainly current SSID, encryption) settings on my device. I noticed when I use 3rd-party applications (such as WiFi transfer, Mi Drop etc) my hotspot configuration gets messed up and worse deletes the previous encryption, sometimes I only find out later that situation.

So in case of unattended session, I would love to preserve my initial config, to prevent unauthorised access to portable hotspot, which could incur significant data charges. Is there a way to achieve that (Running Android 7.0, Miui 11)

I had automation in mind to restore back to original setting, (but can’t figure out full workaround) where the trigger type is WIFi tethering state → Enabling(but the limitation here I can’t put the desired config rather its just an on switch AFAIK but I may be wrong)

enter image description here

configuration – How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib instead or /usr/local/lib?

How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib instead or /usr/local/lib?

I have tried setting LD_LIBRARY_PATH to each of the program names like LD_LIBRARY_PATH="/usr/local/programname1/lib:/usr/local/programname2/lib:/usr/local/programname3/lib".

And, I logged out. Even ran source /etc/environment (I have put the LD_LIBRARY_PATH variable in /etc/environment), even rebooted the system.

But still, when I run ./configure --with-openssl --with-curl, it tells me that libssl does not exist.

I do not want to use the libssl-dev and libcurl-dev package provided by apt, because I need the newest versions, for testing.

And, I noted that: If I install the program’s lib directory in /usr/local/lib instead of /usr/local/programname/lib, it works without setting any environment variables.

But, in my opinion, /usr/local/programname/lib is more clear, so I want to use this type of path.

How can I make it so that PHP uses the libraries inside /usr/local/programname/lib instead of /usr/local/lib?

programname refers to the name of each of the programs that is installed inside of /usr/local.

wordpress mu – OpenSSL Configuration for Ubuntu 20.04 LAMP& WP Multisites

Question: How do I apply 1 OpenSSL certificate to all websites located in html directory?
Problem: When visiting https://localhost.site1.com or https://localhost.site2.com only index.html located at /var/www/html/index.html is displayed because default-ssl.conf document root is /var/www/html/

I have 2 wordpress multisites (and other sites) located in /var/www/html/:

/var/www/html/site1.com

and

/var/www/html/site2.com

In my default-ssl.conf I have:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin info@dummy.com
    ServerName localhost
    ServerAlias localhost

    DocumentRoot /var/www/html/
    
    ErrorLog ${APACHE_LOG_DIR}/localhost.error.log
    CustomLog ${APACHE_LOG_DIR}/localhost.access.log combined

            SSLEngine on
    SSLCertificateFile  /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    
    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    <FilesMatch ".(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
            SSLOptions +StdEnvVars
            DirectoryIndex index.php
            AllowOverride All
            Order allow,deny
            Allow from all
            Require all granted
    </Directory>

    #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
    #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
    #   "force-response-1.0" for this.
      BrowserMatch "MSIE (2-6)" 
            nokeepalive ssl-unclean-shutdown 
            downgrade-1.0 force-response-1.0

</VirtualHost>
</IfModule>

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

In my /etc/hosts file I have:

127.0.1.1   excalibur
127.0.0.1   localhost 
127.0.0.1   localhost.site1.com *.localhost.site1.com   # mainsite url
127.0.0.1   subsite-a.localhost.site1.com   
127.0.0.1   subsite-b.localhost.site1.com
127.0.0.1   subsite-c.localhost.site1.com

127.0.0.1   localhost.site2.com *.localhost.site2.com   # mainsite url

The vhost for site1.com contains:

    <VirtualHost *:80>

    ServerName localhost.site1.com 
    ServerAlias www.localhost.site1.com
    
    # If this is the default configuration file we can use: 'ServerName localhost' or also 'ServerAlias localhost'.

    ServerAdmin info@dummy.com

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

    DocumentRoot /var/www/html/site1.com
    
    <Directory /var/www/html/site1.com>
        Options None FollowSymLinks
        # Enable .htaccess Overrides:
        AllowOverride All
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

    <Directory /var/www/html/site1.com/wp-content>
        Options FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
    
    
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
   SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

</VirtualHost>

And the vhost for site2.com contains:

    <VirtualHost *:80>

    ServerName localhost.site2.com
    ServerAlias www.localhost.site2.com
    
    # If this is the default configuration file we can use: 'ServerName localhost' or also 'ServerAlias localhost'.

    ServerAdmin info@dummy.com

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

    DocumentRoot /var/www/html/site2.com
    
    <Directory /var/www/html/site2.com>
        Options None FollowSymLinks
        # Enable .htaccess Overrides:
        AllowOverride All
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

    <Directory /var/www/html/site2.com/wp-content>
        Options FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
    
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
   SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
   
</VirtualHost>

Any tips?

8 – How to update the layout builder’s section component configuration?

How to update a component in the node’s layout builder? I have used the following code.

$node = DrupalnodeEntityNode::load($nid);
$layout = $node->get('layout_builder__layout');
$sections = $layout->getSections();
foreach ($sections as $key => $section) {
      $components = $section->getComponents();
      foreach ($components as $component) {
        if ($component instanceof SectionComponent && $component->getPluginId() === 'myplugin_id') {
          $configurations = $component->get('configuration');
          $configurations('label_display') = "0";
          $component->setConfiguration($configurations);
        }
      }
}

But now I don’t know how to update the section and layout of the node.

Because $section->setComponent($component) is a protected method.

magento2 – Catalog Page Crashes On Backend in Configuration

After logging into backend and navigating to Stores > Configuration > Catalog, Site crashes and shows this error, also the search on the site shows same error.Same error on catalog and catalog search

Please note that Catalog Search on the index management shows “Reindex Required”, which I have tried to resolve through multiple ways but the case remains same.

PS: magento version 2.4.1

directx – XNA configuration on legacy code

Background:
Our biomechanics and Advanced Surgical Technologies Lab wrote a surgery navigation system desktop application in C# around ten years ago. One of its major functions uses XNA Game Studio 4.0 to aid in the interactive interface for rendering in 2D and 3D cloud data originating from CT (medical scan data in DICOM format), and then segmenting that data and reconstructing it to generate surface models (stl format).

Summary of problem:
The whole application worked fine and still does on the old hardware, but, while compilation succeeds, execution fails in one aspect related to XNA processes destined for the GPU processor rather than the main PC CPU.

The import of data from DICOM and various filtering and scaling all works, and basic rendering also works on previously compiled source code and executable code on Windows 7 machine (details later below). Also, compilation and execution work fully on an old Win PC with the Visual Studio 2013 environment. ‎

Our attempts to compile the same source code and execute on newer hardware and environment with Win 10 and Visual Studio 2019 have partly failed. The compilation works, and most of the execution works, except for some rendering of XNA processes destined for the GPU processor.

More details:
The user interface successfully renders bitmaps through the Texture2D class (Microsoft.Xna.Framework.Graphics) initialized with the grayscale data from previous number crunching operations in our code.
In another part of the interface, where we think and say above may rely on the (onboard GPU) processing, using the same Texture2D object, but when the code involves setting parameters of Effect (Microsoft.Xna.Framework.Graphics.Effect) using Texture2D, drawings which use the spriteBatch.draw function is not rendering on the modern PC platform we set up.
We guess the relevant code which fails to do the job is the following. Pls note that it simply fails to render parts of the image which require image processing (filters, thresholding, boundary detection, etc.), AND without any errors/exceptions reported.

            GraphicsDevice device = SosGraphicsDeviceService.Instance;
            SpriteBatch spriteBatch = SosGraphicsDeviceService.ServiceInstance.SpriteBatch;

            string technique = SosRenderModeName.GetTechniqueName(renderMode_, false);

            BlendState blend = device.BlendState;
            DepthStencilState depth = device.DepthStencilState;
            RasterizerState raster = device.RasterizerState;

            Effect.CurrentTechnique = Effect.Techniques(technique);

            Effect.Parameters(“useModelBuilderTextureInclude”).SetValue(includeTexture != null);
            Effect.Parameters(“modelBuilderTextureInclude”).SetValue(includeTexture);
            Effect.Parameters(“modelBuilderTextureExclude”).SetValue(excludeTexture);
            Effect.Parameters(“modelBuilderTextureCorrection”).SetValue(correctionTexture);

            Effect.Parameters(“minThreshold”).SetValue(minThreshold);
            Effect.Parameters(“maxThreshold”).SetValue(maxThreshold);

            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointWrap,DepthStencilState.Default, RasterizerState.CullNone, effect_);

            foreach (EffectPass pass in Effect.CurrentTechnique.Passes)
            {
                pass.Apply();

                spriteBatch.Draw(texture, new Rectangle(0, 0, 512, 512), Color.White);
            }

            spriteBatch.End();

The following are some of the functions we use in our effect file if that helps to identify the Shader Model Version.

•   float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{

       return float4(1, 0, 0, 1);
}
•   technique Technique1
{
       pass Pass1
       {
        VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader  = compile ps_2_0 PixelShaderFunction();
       }
}

To try to see which settings or aspects of the environment are causing the problem, we tried to recompile the same code in a variety of configurations and execute on both the old and new machines which having different hardware, drivers, libraries, and different installation configurations.

For example, we tried:
• Changed Compatibility mode to match Win7
• Reduced color mode to 8bit
• Changed Screen Resolution
• Ran in administrator mode
• Changed Game profile to Reach

The modern PC platform just would not render with the interface that utilizes Effect.

To recap, below is a summary comparison of the two setups, the one that works on the left, and the one that does not on the right, in terms of hardware, system, and environment setup. We tabulate here the hardware and system environment of each case. If needed, I can upload the whole System information file.

Desktop_Old (Works) Desktop_New (does not work)
System OS Microsoft Windows 7 Enterprise Microsoft Windows 7 Professional
OS version 6.1.7601 Service Pack 1 Build 7601 6.1.7601 Service Pack 1 Build 7601
System Type X64-based PC X64-based PC
Total Physical Memory 7.88GB 15.9GB
Display NVIDIA Quadro 1000M Intel HD graphics 4600
Resolution 1920 X 1200 X 59 hertz 1280 X 1024 X 60 hertz
I/O port Just one three
Driver nvlddmkm.sys Igdkmd64.sys
Installed DirectX DirectX11 DirectX11
IDE Visual Studio 2013 Visual Studio 2019
Game Profile HiDef HiDef
Unsafe Code Allowed Allowed

Also, this is the previous post for the same problem and thanks for responding.