Send file to Jenkins from web server - amazon-web-services

I have a web server is running in Ubuntu (AWS EC2) and I would like to send a file on it. To do that I would like to use Jenkins but I didn't find a plugin or a good configuration to do it.
The problem when I configure a plugin or something else in Jenkins they ask a password, so my password to the server is encrypted by ssh and they cannot read it.
I tried with :
FTP repository hosts
Publish over FTP
Publish over SSH
Is there someone can help me please ?
Thank you in advance.

I found the solution. In fact it was a problem with the access. I used this command : sudo chown -R ubuntu:ubuntu [Directory] where I have my files. Then when I launched the build it was succeed.
Hope this help.
Thank you

Related

AWS EC2 default password

I'm following this tutorial to host a website with an apache server. The thing is that the last step tells my to do
service apache2 reload
But it asks me for a password. I don't remember inserting a password for this VM, just the .pem I used to log in.
Is there a default password? Or how can I solve this? Sorry if this is basic, but the most complex thing I've done with servers is with wamp and xamp
Thanks!
Based on the comments, the solution was to use sudo:
sudo service apache2 reload

AWS/EC2/Ubuntu/Nginx - Where is web root?

I can't seem to find the web root location on a AWS EC2 Ubuntu instance with Nginx web server. I've tried searching via SSH in terminal and SFTP using FileZilla (pem). I've seen a lot of comments that suggest looking in these directories, but I don't see anything.
/var/www/
/etc/apache/
/home/ubuntu/
I didn't create this instance so I'm a bit lost. Any advice for an AWS newbie?
I ended up finding the location by switching to root shell with:
sudo -i
find / -name "filename.php"
For me, the files were in:
/srv/users/mywebsitename/apps/mywebsitename/public
Also, I wasn't aware that my question was off-topic. Maybe it can still help someone...

How do I edit .sql file in phpmyadmin via ssh terminal on MAC

I am currently using Amazon Lighsail for my Wordpress site. I have a fresh Wordpress install on my Lightsail account but would like to upload my old mysql tables from my current site to phpmyadmin.
I have ssh-ed into the terminal and have done cd apps/phpmyadmin/ but I am not seeing my wp_ tables that I need to replace. How do I access this?
I tried the following command to do ssh port forwarding but it didnt work:
ssh bitnami#xx.xxx.xx.xxx -R 8080:127.0.0.1:80 (with the x's being real numbers)
Any idea on how I can upload my current .sql.zip file to Wordpress AWS Lighsail using SSH?
Thanks in advance!

Installed cPanel -amp- WHM- AMI on AWS - Can't Login to WHM or cPanel

I installed the cPanel & WHM: The Hosting Platform of Choice AMI on AWS last night on a ec2 instance.
It seems to have set it all up and I can get to the login pages of cPanel and WHM but can not log in.
I used the 1-click install and never entered, or was given a user/password combination.
Where can I find or set this information?
I can login through ssh from the aws portal and there is definitely a password set. I tried using
sudo mysql_secure_installation
to reset it but failed to login because I did not have a password. It is not blank.
I am not very familiar with doing things through SSH so please be specific on how to fix this if I need to do it through SSH.
Thank you so much for your help.
Any advice or suggestions about AWS is greatly appreciated.
I think there is an issues with the port/firewall setting. Please enable all cPanel require ports for your AWS and try to login cPanel/WHM.
Here are the all port lists which you need to enable for your server.
https://documentation.cpanel.net/pages/viewpage.action?pageId=7536715#HowtoConfigureYourFirewallforcPanel&WHM%27sServices-Ports
Amazon doesn't allow you to connect through the dashboard as root, you have to login as the user type. In this case, ec2-user. Logged in as this user doesn't allow you use the "passwd" command without the old password. However, you can authenticate as root, then use the passwd command to change the password without having to know the old one/default install. Here's how.
Log into SSH in as the ec2-user.
Run "sudo -i" to authenticate as root.
Once you're "root", you can reset the root password using "passwd".
Then login to WHM.
Looks like you've missed some step before
wget -N http://httpupdate.cpanel.net/latest
I've got the same issue and ended with deleting the instance and staring over.
The only setup guide that worked for me without any issues: https://5best.cloud/build-cpanel-cloud-hosting-amazon-aws-1/

How do you restart logstash on an AWS server?

This is a pretty basic question, but I coiuld nto for the life of me find a straight answer about it on google.
I have logstash/Kibana/Elastisearch installed and working on an AWS server. Due to some complications, logstash stopped sending files to Kibana, and I wanted to restart it to see if it would fix the issue. (This is on an Ubuntu 14.04.2).
All of the commands I looked up on google would not restart the service properly. If I check the services running, logstash is on that list and has a -.
restart logstash gives the error "Unknown job: logstash", and some of the others I found gave a similar kind of error.
What is the proper command to run in order to restart logstash?
if you installed .deb or .rpm package then you can restart using command
sudo service logstash restart
or
sudo /etc/init.d/logstash restart
or
sudo service logstash stop
sudo service logstash start
if you logstash creating problem to starting or stoping then you can start it manually also
go to /opt/logstash/bin and run logstash script (logstash.bat for window)
cd /opt/logstash/bin
./logstash -f logstash-simple.conf
logstash-simple.conf is your logstash config file you can change it to any name
or
if you downloaded .zip or any other compressed file then go that path and run same way.