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

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...

Related

How do I remove the Bitnami banner from joomla website on AWS? [duplicate]

This question already has answers here:
How can I remove bitnami banner on WordPress site?
(13 answers)
Closed 2 years ago.
I am new to AWS and am struggling to find my way around their services. That being said I have a Joomla instance in a lightsail package. The site is ready to launch so I need to remove the Bitnami banner. The instructions seem very simple but I don't understand this line:
Log in to into your server console using SSH and execute the following command. Remember to replace APPNAME with the actual name or directory location of your application.
I'm logged in using SSH but can't figure out what they mean by the "actual name" or "directory location" of my application. Where is that listed? I used the name of my joomla instance, but got the response:
/opt/bitnami/apps/Joomla-1/bnconfig: command not found
Can someone please help me with identifying the actual name or directory location of my application?
Thanks for any help.
Using the default path
By default Joomla is setup in the /opt/bitnami/apps/joomla directory so you can simply run the following command
sudo /opt/bitnami/apps/joomla/bnconfig --disable_banner 1
If you have changed the default path
If you have modified the joomla installation path on the server you will need to identify the installation folder.
If you login to your server via SSH perform the following:
ls -lah /opt/bitnami/apps - Identify the folders in the apps directory(one of them will be for your joomla site)
sudo /opt/bitnami/apps/$SUBFOLDER/bnconfig --disable_banner 1 - Run the command using the output of the subfolder from the previous command

Port forward webserver with SSH thru python 3.6

I have a webserver running which is built with python flask but the the problem is that the server is only running locally.
The solution that I managed to execute was to use the website https://serveo.net which gave me the posibility to broadcast it out on the web. I am running ”ssh -R 80:127.0.0.1:8080 serveo.net” thru subprocess.Popopen() which works great.
But is there any options to use this in native python?
I was thinking about the modules paramiko or sshtunnel but no luck to figure it out.
So, any help would be appreciated about how to run ”ssh -R 80:127.0.0.1:8080 serveo.net” without the shell.
Thanks
I am for now going to keep on using subprocess for this purpose and I do have a SSH.exe in my project directory which is what I am going to run to make sure that it is cross windows machine compatable.
But give me a headsup for better solutions.

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!

Hyperledger: get "/bin/bash: ./scripts/script.sh: No such file or directory" when running "./byfn -m up"

I'm a newer for the hyperledger and just studying it by following the tutorials on http://hyperledger-fabric.readthedocs.io. I am trying to build the first network using "first-network" in the fabric-samples. The ./byfn -m generate is OK. But after typing ./byfn -m up, I meet
/bin/bash: ./scripts/script.sh: No such file or directory
error and the process hangs.
What is going wrong?
PS: The OS is Windows 10.
Check to see if you have a local firewall enabled. Depending on your docker configuration, a firewall may prohibit the docker daemon from accessing share drives as specified in docker setup (windows).
Restart the Docker daemon after applying local firewall changes.
I was facing the same issue and could resolve it.
The shared network drive needs to be working for any directory on the local machine to be identified from the container.
Docker for example has the "Shared drive" usually c:\ under which all your byfn.sh paths shall be present. Second condition is you need to be running the byfn.sh script with the same user who was authenticated to share the drives on the container. Your password change on the windows environment could break the already existing shared drives with the containers, hence creating problems in starting them.
Follow these steps :
In your docker terminal check the path $HOME. Type the command echo $HOME.
Make sure that your fabric-samples folder is the same path as of the variable $HOME.
Follow the steps for generating your first network.
or try the below solution.
Follow these steps :
Go to settings of docker.
Click on reset credentials.
Now check if the shared drives include the required drives or not.
If not, then include them apply your changes and restart your docker and your bash where you were trying to start your network.
I know the question is old but i have faced the similar issue so i did the following
./byfn.sh -m generate
./byfn.sh -m up
i was missing .sh in both commands.

Send file to Jenkins from web server

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