Questions tagged with Amazon Linux

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Hey Team, I am unable to deploy Deploy Microsoft Defender for Endpoint on Amazon linux 2 EC2 instance. I follow the steps mentioned in the document https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/linux-install-manually?view=o365-worldwide. Can someone please help me on this? **OS Release version:** NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" **Shell Installation output:** [root@ip-172-31-76-111 ec2-user]# sudo yum install yum-utils -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00:00 Package yum-utils-1.1.31-46.amzn2.0.1.noarch already installed and latest version Nothing to do [root@ip-172-31-76-111 ec2-user]# sudo yum-config-manager --add-repo=https://packages.microsoft.com/config/rhel/7.2/prod.repo Loaded plugins: extras_suggestions, langpacks, priorities, update-motd adding repo from: https://packages.microsoft.com/config/rhel/7.2/prod.repo grabbing file https://packages.microsoft.com/config/rhel/7.2/prod.repo to /etc/yum.repos.d/prod.repo repo saved to /etc/yum.repos.d/prod.repo [root@ip-172-31-76-111 ec2-user]# sudo rpm --import http://packages.microsoft.com/keys/microsoft.asc [root@ip-172-31-76-111 ec2-user]# sudo yum install mdatp -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd No package mdatp available. Error: Nothing to do [root@ip-172-31-76-111 ec2-user]# sudo yum --enablerepo=packages-microsoft-com-prod install mdatp Loaded plugins: extras_suggestions, langpacks, priorities, update-motd No package mdatp available. Error: Nothing to do
3
answers
0
votes
48
views
asked 3 days ago
I'm working to deploy a laravel application on an Amazon Linux 2 instance. I'm getting this error: Class "Redis" not found and the last error in the stack trace: vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:81 While looking around, it seems that the solution on CentOS and other "yum" distro's is to install php-redis. I haven't been able to find any such package for the Amazon Linux AMI. How can I install php-redis?
1
answers
0
votes
17
views
asked 6 days ago
I'm running a Amazon EC2 instance - Amazon Linux release 2 (Karoo). The apache server sets files it creates with the permissions 644. I want them to be 664. I've tried changing the umask setting to 002 (from 022) in every single line that has 'umask' in the /etc folder and sub-folders. This didn't seem to work. I also tried various solutions on the Internet about having the specific service set the umask to no avail. Thanks.
0
answers
0
votes
4
views
asked 6 days ago
1) I have created a Ec2 Amazon linux 2 instance and have attached 4 extra EBS volumes ( gp2=3gb, gp3=3gb,io1=4gb, io2=4gb formatted and mounted it and I have installed postgres db (v 8.4.18) on it. ( dev/xvdf /data/db1... etc) 2) I have created number of sample tables in the database and made my ebs root volume full to 100%. Now I am creating more table i get the error that your disk is full. 3) I want to know how can I set the root limit or even if the root volume is 100% the further data I am creating should automatically get stored in the other EBS volumes without increasing the size of root volume. The further data should be store in any of the attached root volumes or I want to see if the data divides in all the 4 EBS volumes. 4)In the Postgres database configuration, Do I need to map the default data directory (ie, /var/lib/postgresql/) to any of the attached EBS volumes? or how can I mount those ebs volumes to one another.
1
answers
0
votes
11
views
Suraj
asked 13 days ago
Hi, in my instances running AL2 i am using the EPEL repo to have access to especially on package (libmaxminddb). This package was now removed from EPEL because it was included in RHEL7.7. Are there any chances this package can find its way into the Amazon Linux 2 core repo as it did for CentOS7? Or do i have to install the package manually via rpm or self built? Thx.
1
answers
0
votes
21
views
asked 22 days ago
Hi, I am running `yum --security update-minimal` daily on an EC2 instance powered by Amazon Linux 2. That keeps returning `No package matched to upgrade: python2-rsa-0:3.4.2-3.el7` for a few days now. Based on [Amazon Linux 2 FAQ](https://aws.amazon.com/amazon-linux-2/faqs/) "There are no plans to change the default Python interpreter. It is our intention to retain Python 2.7 as the default for the lifetime of Amazon Linux 2. We will backport security fixes to our Python 2.7 packages as needed." I assume that the security fixes from `python2-rsa-0:3.4.2-3` have been backported to the newest available package (also included in the [latest AMI release](https://docs.aws.amazon.com/AL2/latest/relnotes/relnotes-20221216.html) = python2-rsa-3.4.1-1.amzn2.0.3.noarch). However yum does not seem to be happy about it. I could disable `yum priority plugin` (in `/etc/yum/pluginconf.d/priorities.conf`) and install `python2-rsa-0:3.4.2-3.el7` from `EPEL` but I would like to know whether there is another solution. Thanks!
1
answers
0
votes
38
views
asked 23 days ago
I am having issues getting my Node.js project to run on AWS Elastic Beanstalk. It was running fine for months, but after the Christmas break, it is now failing. Here is the output from the eb-engine.log file: ``` [INFO] Executing instruction: Use NPM to install dependencies [INFO] use npm to install dependencies [INFO] Running command /bin/sh -c npm config set jobs 1 [INFO] Running command /bin/sh -c npm --production install npm ERR! code 1 npm ERR! path /var/app/staging/node_modules/node npm ERR! command failed npm ERR! command sh -c node installArchSpecificPackage npm ERR! node:internal/modules/cjs/loader:936 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module 'node-linux-arm64/package.json' npm ERR! Require stack: npm ERR! - /var/app/staging/node_modules/node/installArchSpecificPackage.js npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:108:19) npm ERR! at ChildProcess.<anonymous> (/var/app/staging/node_modules/node-bin-setup/index.js:19:27) npm ERR! at ChildProcess.emit (node:events:527:28) npm ERR! at maybeClose (node:internal/child_process:1092:16) npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { npm ERR! code: 'MODULE_NOT_FOUND', npm ERR! requireStack: [ npm ERR! '/var/app/staging/node_modules/node/installArchSpecificPackage.js' npm ERR! ] npm ERR! } ``` This is using the "Node.js 16 running on 64bit Amazon Linux 2/5.6.3" platform. Any help would be greatly appreciated.
1
answers
0
votes
30
views
asked 23 days ago
Hi, If anyone can help me out with it'd be greatly appreciated! I'm currently creating a Splunk environment and I have all my instances configured to the same security group but when I try to discover my inputted TCP servers the receiving server isn't receiving anything from any server. I've ensured that my Linux instances have disabled firewalls, double-checked the security group rules, and also used telnet to verify but still no luck. Any tips or pointers would be greatly appreciated! Regards,
2
answers
0
votes
58
views
asked 25 days ago
upgraded to new servers with AWS Linux 2022 (php 8.1.7). No longer have php-zip module available. No matching package found when trying to install manually. Just tried installing Webmin and it failed looking for "perl-Encode-Detect". Tried installing this and it also seems to be missing from latest Linux 2022 distro.
2
answers
0
votes
30
views
asked a month ago
I'm trying to run an aws lightsail command, from within my Amazon Linux 1 instance, to update the caching settings on my distribution. When I first created the command it worked fine ... but after a while it stopped working and gave an "An HTTP Client raised an unhandled exception: 'module' object has no attribute 'raise_from'" error. I ran the command with the debug parm and got the output at the bottom of this post (partially, the full debug output won't fit in a post). Any suggestions? It seems I'm missing a python module, but don't know python at all (Java & RPG are my thing). Thanks! David 2022-12-09 07:44:33,646 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://lightsail.us-east-1.amazonaws.com/, headers={'Content-Length': '1118', 'X-Amz-Target': 'Lightsail_20161128.UpdateDistribution', 'X-Amz-Date': '20221209T134433Z', 'User-Agent': 'aws-cli/1.18.107 Python/2.7.18 Linux/4.14.248-129.473.amzn1.x86_64 botocore/1.17.31', 'Content-Type': 'application/x-amz-json-1.1', 'Authorization': 'AWS4-HMAC-SHA256 Credential=qqqqqqq/20221209/us-east-1/lightsail/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=xxxxxxxx'}> 2022-12-09 07:44:33,646 - MainThread - botocore.httpsession - DEBUG - Exception received when sending urllib3 HTTP request Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/botocore/httpsession.py", line 250, in send conn = manager.connection_from_url(request.url) File "/usr/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 290, in connection_from_url u = parse_url(url) File "/usr/lib/python2.7/dist-packages/urllib3/util/url.py", line 392, in parse_url return six.raise_from(LocationParseError(source_url), None) AttributeError: 'module' object has no attribute 'raise_from' 2022-12-09 07:44:33,653 - MainThread - botocore.hooks - DEBUG - Event needs-retry.lightsail.UpdateDistribution: calling handler <botocore.retryhandler.RetryHandler object at 0x7fa41e1f5c90> 2022-12-09 07:44:33,653 - MainThread - awscli.clidriver - DEBUG - Exception caught in main() Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 217, in main return command_table[parsed_args.command](remaining, parsed_args) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 358, in __call__ return command_table[parsed_args.operation](remaining, parsed_globals) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 530, in __call__ call_parameters, parsed_globals) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 650, in invoke client, operation_name, parameters, parsed_globals) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 662, in _make_client_call **parameters) File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 316, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 622, in _make_api_call operation_model, request_dict, request_context) File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 641, in _make_request return self._endpoint.make_request(operation_model, request_dict) File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 102, in make_request return self._send_request(request_dict, operation_model) File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 137, in _send_request success_response, exception): File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 256, in _needs_retry caught_exception=caught_exception, request_dict=request_dict) File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 356, in emit return self._emitter.emit(aliased_event_name, **kwargs) File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 228, in emit return self._emit(event_name, kwargs) File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 211, in _emit response = handler(**kwargs) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 183, in __call__ if self._checker(attempts, response, caught_exception): File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 251, in __call__ caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 269, in _should_retry return self._checker(attempt_number, response, caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in __call__ caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in __call__ attempt_number, caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in _check_caught_exception raise caught_exception HTTPClientError: An HTTP Client raised an unhandled exception: 'module' object has no attribute 'raise_from' 2022-12-09 07:44:33,660 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255 An HTTP Client raised an unhandled exception: 'module' object has no attribute 'raise_from'
1
answers
0
votes
23
views
David G
asked a month ago
Hello, communit guys! I have a simple test.py Python script (see below) inside EC2 (t2.xlarge, Amazon Linux 2). I'm using VSCode to connect to EC2 for testing/debuging. When I run this code through VSCode or through linux terminal (`sudo python3 /home/ec2-user/tmp/test.py`) , this code runs until the end **But when I use the lambda to send the same execution command, after exactly 1 hour this code stops running (no python3 task running)! And I want it to keep running longer than 1 hour!** My objective is to send a command line to run my python script through lambda to EC2 and ensure that script run untill the end test.py ``` import logging from time import sleep logging.basicConfig(filename="/home/ec2-user/tmp/test.log", format='%(asctime)s %(message)s', filemode='w') logger = logging.getLogger() logger.setLevel(logging.INFO) var= True count = 0 while var==True: logger.info('=)') sleep(1) count+=1 if count>100000: var=False ``` lambda function ``` import json import boto3 comand_shell = 'sudo python3 /home/ec2-user/tmp/test.py' instance_id_ec2 = 'my_ec2_instance_id' def lambda_handler(event, context): client = boto3.client("ec2") ssm = boto3.client("ssm") try: describeInstance = client.describe_instances() for r in describeInstance['Reservations']: for inst in r['Instances']: if inst['InstanceId'] == instance_id_ec2: status = inst['State']['Name'] if status == 'running': response = ssm.send_command( InstanceIds=[instance_id_ec2], DocumentName="AWS-RunShellScript", Parameters={"commands": [comand_shell]}, ) print(f'{comand_shell } has sent to {instance_id_ec2} successfuly') else: print(f'Failed') except Exception as e: print("Unexpected Exception: %s" % str(e)) return None ``` First/last 5 lines' log file ``` 2022-12-21 00:39:48,379 =) 2022-12-21 00:39:49,381 =) 2022-12-21 00:39:50,382 =) 2022-12-21 00:39:51,383 =) 2022-12-21 00:39:52,385 =) ... ... ... 2022-12-21 01:39:30,908 =) 2022-12-21 01:39:31,765 =) 2022-12-21 01:39:32,302 =) 2022-12-21 01:39:33,286 =) 2022-12-21 01:39:34,853 =) ``` Thanks
1
answers
0
votes
55
views
Arita
asked a month ago
Currently supported PHP versions within amazon-linux-extras are either out of support or have fewer than 11 months left before their end of life. In order to enable developers ample time to upgrade applications, test and deploy, can we please get PHP 8.2 supported added as soon as possible? For reference, here are PHP's current versions and their support timelines: https://www.php.net/supported-versions.php There are also 3rd party packages (such as Bref) which use the amazon-linux-extras repos for compiling Lambda layers to allow PHP applications to run on ARM/Graviton: https://github.com/brefphp/bref/tree/v2/docs/runtimes#arm-runtimes
0
answers
5
votes
51
views
asked a month ago