Installing Laravel on EC2 Instance - amazon-web-services

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

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.

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

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

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.

Difference between /var/www/html directory and /www as root directory

I was setting up a website on a web hosting service.
When I was transferring the files using ssh, I had to put the files in the www folder in my root directory (I would use cd www to get there), but when I was using AWS server in the previous occasion, I had to go to /var/www/html directory to put the files in and get the website running.
Are there any differences to these two formats? The website works fine, but I was just worried that there may be a pitfall or something!
Thanks in advance!
You should be fine, different distributions of Linux have different default locations for the DocumentRoot directory, and on your hosting service the hosting company may have changed the location from the default. But as long as you and the Apache process have read / write permissions on the root directory, you shouldn't
have any problems.

What are the 'correct' permission setting for django site running on apache2 server

I am very new to apache and django, so execuse me if this question is simple. I am trying to deploy an existing site to an apache server. For the time being, the site is still in development so I am only deploying it as a virtualhost on my local machine.
I am using Django's WSGI module in the deployment. In my site's config file, I have the following aliases:
Alias /media/ /home/tester/Desktop/siteRootDir/media
Alias /content/ /home/tester/Desktop/siteRootDir/content
WSGIScriptAlias /c /home/tester/Desktop/siteRootDir/deploy/site.wsgi
When I run apache and go to localhost/c I was getting the (13)PermissionDenied error in the apache log. To get around that error, I (admitedly stupidly) ran
chmod -R 777 /home/tester/Desktop/siteRootDir
I know that is not the way to deal with the issue, but I just wanted the site to work so I can continue its development.
So my question is, what are the correct permission settings to the siteRootDir directory and its sub-directories such that the site will run and I do not expose unnecessary files in the directory.
Also, I realize that this is not an ideal set up and I will likely run into problems when I deploy the site in production. Can anyone please suggest a better organizational approach to this?
Thanks!
The tightest permissions possible would be 0600 for files and 0700 for dir's and as a owner the user owning the apache processes. This user differs per OS and flavor (e.g. for OSX it's www, for Debian/Ubuntu it's www-data).
This would probably too tight for a development server. At least would you like to be able to modify all your files through your IDE of text editor, so either you should add ACLs for yourself (i.e. the user that edits the Django files, templates and static files).
Also, in a production server you want the apache user to be able to write to directories that hold web uploaded content. That would be somewhere in your static files section (or on a different dedicated static files server).