Blank page after configuring ec2 instance and installing tomcat7 - amazon-ec2

I created a new AWS account and started a new tier 2 instance. So I did following things afterward :
Created elastic IP and associated it with the instance.
Configured the inbound security groups for http, https and custom TCP rule:8080
Installed tomcat7 using "sudo yum install tomcat7"
Started tomcat using "sudo service tomcat7 start"
Finally, i tried to check the tomcat, by hitting http://elastic-ip:8080 from the browser but a blank page comes up.
I guess this is a 404 error. Please help me which part have i missed.

Related

How to setup Apache and Laravel in Centos Stream 9

I have a Centos Stream 9 server running Apache 2. I think it is mostly well configured since I never get error messages in my CLI when doing the sudo systemctl restart httpd.service command. But I'm getting a 503 error message trying to access my server with the IP or the domain name in a browser.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Unavailable</title>
</head><body>
<h1>Service Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>
The thing is I have Laravel installed there and I usually run composer to do the updates and I also pull from git. Those commands are ran by my default user centos:centos, while my web server is ran by apache:apache. I wanted to switch my webserver to the same user because I was getting write permission errors when doing the composer install command. The /storage and /bootstrap directories were owned by the apache user.
So, I still don't know if this is something that has to do with my Laravel install, or the server configuration. I was thinking it was a firewall thing, but I'm guessing there must be a way to run my httpd service with my centos user to fix this issue.
Looking into the Error log I found that it was actually getting a message about FastCGI.
(13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (*) failed
Doing some research into the error I understood that it had to do with the configuration of php-fpm
The following is a link to a post that contains good information to solve the problem althought the approved answer is not the correct answer for the problem and I had to dig a little bit into configuring the php-fpm module:
FPM with apache2 not working (Permission denied)
Lastly, I will share a link to the PHP-FPM installation instructions that also gave me an idea on how to fix it, but not exactly worked for my problem:
Configure Apache with PHP-FPM
If possible to you change current configuration?
if yes...
PHP-FPM is able to work using socket file or tcp socket, so you can:
1.Change to TCP configuration (/etc/php-fpm.d/www.conf by default)
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
2.Change your apache configuration
From:
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
To:
SetHandler "proxy:fcgi://127.0.0.1:9000"
3.Restart both services.

Deploy API REST IBM Hyperledger Composer Blockchain

I'm developing a POC over IBM HyperLedger Blockchain. I have a business network developed and deployed in IBM Cloud. I can generate a working local API REST, but cannot make it work on cloud, on the deployed IP.
I'm following this guide:
https://ibm-blockchain.github.io/interacting/
You just have to execute the following command:
./create/create_composer-rest-server.sh --business-network-card MY_BIZNET_CARD_NAME
But it doesn't deploy anything, and get the following (more related to kubernetes than blockchain).
Preparing yaml file for create composer-rest-server
Creating composer-rest-server pod
Running: kubectl create -f /Users/sm/jsblock/ibm-container-service/cs-offerings/scripts/../kube-configs/composer-rest-server.yaml
The connection to the server localhost:8080 was refused - did you specify the right host or port?
the server doesn't have a resource type "svc"
Creating composer-rest-server service
Running: kubectl create -f /Users/sm/jsblock/ibm-container-service/cs-offerings/scripts/../kube-configs/composer-rest-server-services-free.yaml
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Composer rest server created successfully
Any ideas? Thanks too much.
You need to ensure you have a correct kube config setup. Step 10 in https://ibm-blockchain.github.io/setup/ provides the details to set up KUBECONFIG as the error suggests that either it is not configured or not configured correctly.
The document you refer to https://ibm-blockchain.github.io/interacting/ is being updated and should be available soon.
When you run the command ./create/create_composer-rest-server.sh --business-network-card MY_BIZNET_CARD_NAME - should be the name of the Network Admin for the network you deployed, NOT the PeerAdmin card so it will be something like ./create/create_composer-rest-server.sh --business-network-card admin#perishable-network
Look like it's an issue of acceess control. You should make sure again you are running with Local Admin configuration.it will help you to run queries

graylog - server wont connect to port 9000

I am trying to set up a graylog-server by their docs
I installed everything , turned on elastic search , installed mongo , configurated files , added name / passwd hashed and yet when i visit localhost:9000 is still unable to connect.
I tried to start up everything again
sudo service elasticsearch start
sudo service mongodb start
sudo service graylog-server start
sudo service rsyslog start
sudo service apache2 start
but it didnt work
Has anyone met with similliar problem? I am trying to make it work for few hours but nothing works. Thanks
You also need to make port 12900 available, because this is the port of the REST API which the web interface uses to connect to. You can find more information about this here.

Connecting to ElasticSearch plugin under proxy settings

I have a problem with connecting to Elasticsearch under proxy settings. I have installed Bigdesk plugin manually with bin/plugin -DproxyHost=myproxy.proxy.com -DproxyPort=80 --install lukas-vlcek/bigdesk, everything went all right with it.
I run my Elasticsearch on docker, it generated some private IP.
After http://[GeneratedIP]:9200/_plugin/bigdesk/ I have error 504, Proxy Timeout in web browser console.
After running ElasticSearch locally with service elasticsearch start and then in browser http://localhost:9200/_plugin/bigdesk/ it stops loading and I can see just white screen, no output in inspect-console.
Any ideas?

Cannot access sinatra app on AWS Windows from remote machine

I have a simple sinatra app running on an AWS windows instance. Running the application from the localhost works fine (i.e. http://localhost:4567), but I am unable to run it remotely.
My AWS windows instance is available to me from remote as I am able to connect to it using RDP.
After reading some other similar issues, I have already applied the following:
My AWS security group is opened for port 4567 (I actually also opened it for any inbound connection just to see if that will solve the issue - it didn't)
I tried running: ruby my_sinatra_app.rb -o 0.0.0.0
I tried running: ruby my_sinatra_app.rb -e production
I tried adding to the application itself the following code: set :bind, '0.0.0.0'
I am still unable to run the application remotely. Any idea?
I was able to solve my issue, so for the sake of completeness I am publishing the answer.
This wasn't a Sinatra issue, but an AWS issue (maybe not really an issue, more like my misunderstanding). I was under the impression that updating the AWS security group for opening the 4567 port will do the trick.
However, it turns out that I needed also to open the port on the Windows Firewall on my Windows AWS instance. After opening the port on the Windows Firewall I was able to remotely connect to my Sinatra app.

Resources