How can I view image through URL from remote Ubuntu server? Python - python-2.7

I have a picture on my remote ubuntu(16.04) server, so I want to paste it to my Github Readme.md file.
So how can I view (not download, not copy) that image through URL, for instance, server_ip_address/img.png
Thanks for any help or idea!)

If you want to host resources on your ubuntu server you should install a webserver (apache / nginx) if ones not installed already. Heres docs for ubuntu apache: https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-16-04.
Move the image to the webserver's document root (likely /var/www/html) so that you can access it via a url. If you have a static ip on the host then you should be able to access it via http://static_ip/img.png and add that url to Readme.md

Related

Copy PHP application from Jenkins to /var/www/html

I have installed Jenkins and Apache to one instance of CentOS in aws. I have connected Jenkins with github but I am not able to access the application through url as it shows the following error.
You should add your website content to the directory /var/www/html/.
I need to copy files from jenkins directory to the mentioned one can you please help me how to copy app so that I can use it on browser.

Installing beaker server

I have been trying to install Beaker server on Fedora 26 following the instructions in https://beaker-project.org/docs/admin-guide/installation.html#installing-the-beaker-server.I've done setting up Beaker database and enabling beakerd scheduler, but I'm stuck when I come to the step of configuring the URL for beaker server on Apache (as provided in the link and the image).the instruction i'm stuck on
I'm not sure what is the URL of my Beaker server (where to find it in the config file?). Should I config that URL in /etc/httpd/conf/httpd.conf or /etc/httpd/conf.d/beaker-server.conf? I gave a try on both but all I can manage is displaying the index.html file of the server, not the Beaker server UI as expected. I configured the server name to be the IP of the server since I want to test first before contacting the DNS provider.
Thank you for your help on the matter.
The default /etc/httpd/conf.d/beaker-server.conf file configures the Beaker web application to be served under the path /bkr/. That's this line (and all the related settings):
WSGIScriptAlias /bkr/ /usr/share/bkr/beaker-server.wsgi/bkr/
So you should find Beaker accessible at http://$YOURSERVER/bkr/. That's what the documentation means when it says "the URL configured in Apache".
If you just visit http://$YOURSERVER/ you will indeed see the Apache welcome page because nothing else is configured to be served at the root.

Unable to setup Django in production on EC2 instance running Ubuntu 14.04

I have set up an EC2 instance with Ubuntu and able to login via ssh.
Now I have installed Apache, MySQL (worked fine) and Django also tried to configure it to run with apache. I have tried doing so with mod-wsgi but it still shows a apache default page instead of django (Congratulation ! It works) page. Can someone please provide me instructions for how to setup all this after login into EC2 via SSH.
Here is a tutorial provided by Django.
You need to make sure the apache config file is in /etc/apache2/sites-enabled/ or wherever your apache configuration files rest.
Another silly problem and this might be your issue is whenever I start a new instance of EC2 there is always a config called "000-default" already in the apache sites-enabled. This needs to be DELETED or DISABLED for apache to read from your config instead.
Hopefully this helps!
For a example check the Step 2 of this link. yum + git + pip + python requirements

Installing Laravel on EC2 Instance

I'm brand new to AWS and this has got me stumped. I'm trying to install Laravel 4 on an instance I have on EC2 running the AMI Linux package. I don't have a domain for this, just using the free tier and trying it out.
Laravel needs to have the laravel/public folder as the document root but I can't work out how to do this. I've read loads of things about the conf.d folder vhosts file httpd.conf file and I don't really understand how it all fits together.
Can someone help me and tell me how I can set my documnent root so that when i visit my Elastic IP address it loads up correctly?
Thanks
If you want to access your laravel app by server ip you need to edit your httpd.conf file (usually in /etc/apache2 or /etc/httpd) and set the DocumentRoot option to the right directory.
DocumentRoot /var/www/laravel/public
and then restart apache

Cannot view PHP page in browser

I've set up my ec2 instance, uploaded a test php file to var/www/html and updated the httpd.conf file successfully as mentioned in blogs/documentation.
Now I want to view my php file in my browser. I am trying to open my Public DNS in web browser but the browser cannot open it. Google chrome says:
Oops! Google Chrome could not connect to ec2-54-218-xxx-xx.us-west-2.compute.amazonaws.com
Did I miss something?
Once you get into the server through terminal, I modified this file httpd.conf by terminal command "sudo vi /etc/httpd/conf/httpd.conf" by uncommenting VirtualHost in the last few lines of the document (it is a really long document).
Under VirtualHost I also uncommented the DocumentRoot and changed its field to /var/www/html/ Now I can access this php file from the web browser by this url "myPublicDNSFromElasticIP"+/myPHPfileName. (YOU have to transfer your php file to /var/www/html/HERE in order to display it in the web or gain access from your mobile applications. You can do this by scp command in terminal)
You need to make a new PublicDNS by going into Elastic IP in the amazon Web EC2 console. so this myPublicDNSFromElasticIP is that new Public DNS from Elastic IP.
Also after you modify the file httpd.conf, you need to restart httpd I used this command in the terminal.
sudo /etc/init.d/httpd restart
And of course you need to download php from terminal using command sudo yum install php in order to get php to work
I used two websites. First website was a bit more helpful but the second from Adil was also helpful
http://www.alexkorn.com/blog/2011/03/getting-php-mysql-running-amazon-ec2/
http://www.rndmr.com/amazon-aws-ec2-easy-web-serverset-up-guide-with-a-mac-and-coda-2-256/