• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

config

AWS SDK Load Config

February 14, 2022

Occasionally I was getting this random error when running Terraform.

╷
│ Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
│ 
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│ 
│ Error: RequestError: send request failed
│ caused by: Post "https://sts.amazonaws.com/": read tcp xx.xx.xx.xx:59422->xx.xx.xx.xx:443: read: connection reset by peer
│ 
│ 
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on main.tf line 10, in provider "aws":
│   10: provider "aws" {

╷ │ Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found. │ │ Please see https://registry.terraform.io/providers/hashicorp/aws │ for more information about providing credentials. │ │ Error: RequestError: send request failed │ caused by: Post "https://sts.amazonaws.com/": read tcp xx.xx.xx.xx:59422->xx.xx.xx.xx:443: read: connection reset by peer │ │ │ with provider["registry.terraform.io/hashicorp/aws"], │ on main.tf line 10, in provider "aws": │ 10: provider "aws" {

Here’s the fix. Place this in your ~/.bash_profile.

export AWS_SDK_LOAD_CONFIG=1

export AWS_SDK_LOAD_CONFIG=1

This forces Terraform to use both config and credentials file.

Filed Under: Linux Tagged With: aws, awscli, bash_profile, cli, config, credentials, sdk, terraform

Where’s php.ini?

October 5, 2021

How to find where php.ini is being from the command line.

$ php -i | grep 'grep 'Configuration File'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

$ php -i | grep 'grep 'Configuration File' Configuration File (php.ini) Path => /etc Loaded Configuration File => /etc/php.ini

Filed Under: Linux Tagged With: config, location, php.ini, where

Change WordPress URL

June 6, 2021

There are multiple ways to change URL in WordPress.

Here’s one via wp-config.php.

define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );

define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' );

If you have a redirect in Apache, comment it out.

#Redirect permanent / https://yourdomain.com/

#Redirect permanent / https://yourdomain.com/

This is by far the easiest way to change URL in WordPress.

Filed Under: Linux, WP Tagged With: change, config, url, wordpress, wp-config.php

Standard SSL Policy

February 9, 2020

Here’s a standard template for SSL Apache found in /etc/apache2/sites-available/default-ssl.conf.

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
   ServerAdmin your-email@your-domain.com
   ServerName www.yourdomain.com
   ServerName yourdomain.com
   DocumentRoot /var/www/your-domain.com
   ErrorLog /var/www/your-domain.com/log/error.log
   CustomLog /var/www/your-domain.com/log/access.log combined
   <Directory /var/www/your-domain.com>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Require all granted
   </Directory>
   SSLCertificateFile /etc/letsencrypt/live/your-domain.com/fullchain.pem
   SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem
   Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

<IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin your-email@your-domain.com ServerName www.yourdomain.com ServerName yourdomain.com DocumentRoot /var/www/your-domain.com ErrorLog /var/www/your-domain.com/log/error.log CustomLog /var/www/your-domain.com/log/access.log combined <Directory /var/www/your-domain.com> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> SSLCertificateFile /etc/letsencrypt/live/your-domain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule>

Enable SSL.

# Enable SSL Module
a2enmod ssl
systemctl restart apache2.service
# Enable SSL Apache Config
a2ensite default-ssl
systemctl restart apache2.service
# Alternate way to restart.
service apache2 restart

# Enable SSL Module a2enmod ssl systemctl restart apache2.service # Enable SSL Apache Config a2ensite default-ssl systemctl restart apache2.service # Alternate way to restart. service apache2 restart

Filed Under: Linux Tagged With: 443, apache, config, ssl

WordPress Asking for FTP Details

December 26, 2019

If WordPress is asking for FTP details when you’re trying to update a theme, plugin, or WordPress itself, you will need to edit your wp-config.php file to add the following line to your configuration.

define('FS_METHOD','direct');

define('FS_METHOD','direct');

Save the file and try updating again. It shouldn’t ask you for FTP details.

Filed Under: WP Tagged With: config, details, fix, ftp, plugin, theme, update, wordpress

Outbound DNS

August 23, 2019

Here’s a typical setup for an Outbound DNS server.

What are unbound servers? Unbound servers are a validating, recursive and caching DNS server

Install Unbound DNS

yum install unbound

yum install unbound

Configuration: /etc/outbound/outbound.conf

server:
        interface: 0.0.0.0
        access-control: 0.0.0.0/0 allow
        local-zone: "10.in-addr.arpa." nodefault
forward-zone:
        name: "10.in-addr.arpa."
        forward-addr: 169.254.169.253
forward-zone:
        name: "ec2.internal"
        forward-addr: 169.254.169.253
forward-zone:
        name: '.'
        forward-addr: 10.10.10.1
        forward-addr: 10.10.11.2

server: interface: 0.0.0.0 access-control: 0.0.0.0/0 allow local-zone: "10.in-addr.arpa." nodefault forward-zone: name: "10.in-addr.arpa." forward-addr: 169.254.169.253 forward-zone: name: "ec2.internal" forward-addr: 169.254.169.253 forward-zone: name: '.' forward-addr: 10.10.10.1 forward-addr: 10.10.11.2

Unbound Start, Stop, Restart and Status

service outbound start | stop | restart | status

service outbound start | stop | restart | status

Filed Under: Cloud, Linux Tagged With: caching, config, dns, outbound, resolver

HTTPS in CodeIgniter

July 17, 2019

If you switched to HTTPS in Apache, make sure to update CodeIgniter’s config file.

vim /var/www/applications/config/config.php

vim /var/www/applications/config/config.php

Change the base URL to https.

$config['base_url']	= 'https://yourdomain.com/ci/';

$config['base_url'] = 'https://yourdomain.com/ci/';

Filed Under: PHP Tagged With: apache, base url, codeigniter, config, https, php

  • Home
  • About
  • Archives

Copyright © 2023