Directory for Subdomain on Route53 - amazon-ec2

I've successfully created a subdomain on Route53 that is connected with EC2 Instances. When I access my subdomain subdomain.domain.com there appears Amazon Linux AMI Test page.
How to upload my website to subdomain.domain.com?
If usually add files to /var/www/html/ on primary domain, what about subdomain?
I also have checked the root server using WinSCP and there is no subdomain directory.
In this case my subdomain is "blog".
Hope to get the best answer.
Thanks.

"subdomain.domain.com" is a logical name (called hostname) for the IP of your EC2 instance. You should not expect any subdomain directory on your EC2 instance.
It looks like the directory /var/www/html/ does not have any landing page (index.html). Upload your website under the directory /var/www/html/ such that your index.html is placed directly under the directory /var/www/html/.

Related

verdaccio & aws ec2

I am trying to setup Private NPM registry using Verdaccio on ec2 instance (Linux). For this I have configured a CloudFront as well.
I am able to access the Registry using the Public EC2 IP but,
On visiting the CloudFront host, I keep getting
Mixed Content: The page at 'https://somedomain.com/' was loaded over HTTPS, but requested an insecure script 'http://somedomain.com/-/static/runtime.d4346a1621c9b92e2ba9.js'. This request has been blocked; the content must be served over HTTPS.
I have tried this config but doesn't seem to work
VERDACCIO_PUBLIC_URL='https://somedomain.org'; <- environment variable (bash_profile)
url_prefix: '/' <- in config.yaml file

How to set up /etc/hosts to access a subfolder like it's a root folder (on a Mac)

I am setting up a new machine. I have it configured to use a Sites folder and localhost to access it. Using Apache, everything installed via Homebrew.
Sites folder
site1
site2
In the browser
localhost/site1/index.html
localhost/site2/index.html
That part works fine.
The problem is that site1 and site2 think localhost is the root folder (which it is) but I want them to think localhost/site1 and localhost/site2 are the root folders for those sites.
Is this something I can do with /etc/hosts or some other trickery?
It turns out this is a combination of /etc/hosts and Apache VirtualHosts. Here are the steps I took:
Establish the directories where you want to serve them from (this will become your DocumentRoot). In my case /Users/myusername/Sites/site1
Edit your /etc/hosts file to include your new "domain name" (this will become your ServerName). In my case site1.com
127.0.0.1 site1.com
::site1.com
Create an Apache Virtual Host ... there are different ways to go about this, but I used Homebrew to install Apache, so for me, there is a file here: /opt/homebrew/etc/httpd/extra/httpd-vhosts.conf. I copied the examples provided using DocumentRoot and ServerName as noted above.
Update this file /opt/homebrew/etc/httpd/httpd.conf to uncomment this line
Include /opt/homebrew/etc/httpd/extra/httpd-vhosts.conf
Restart Apache

ec2 aws only index page is routing, further is error as - URL NOT FOUND

Only index page of aws ec2 instance is routing fine. further pages are not routing at all. I get an error as - URL NOT FOUND
It happened after i upgraded from php56 to php70.
I did restart httpd service
I got this fixed.
I needed to edit and modify below in httpd.conf inside etc/conf
AllowOverride All
for Directory /var/www and Directory /var/www/html

Laradock - Localhost refused to connect on Windows 10 using Nginx

I have setup a laradock app on my local machine. I have followed the instructions as provided:
http://laradock.io/
In addition to that as I am on Windows 10, and using Docker toolbox, I have shared my folder with the laradock's workspace. That's working fine as I can see my app's folders inside the workspace when I run the following command
docker-compose exec workspace bash
I have also added a host entry inside my hosts file on windows.
127.0.0.1 localhost
But nothing works. I get a response 'localhost refused to connect'. Even css files inside public folder are not accessible
You should checkout the nginx/sites folder inside your laradock folder. Check the root path inside default.conf - root /var/www/public; should correspond to where your project /public folder actually is inside workspace.
I personally use laradock for many projects and create multiple .conf files that correspond to my sites name like myproject1.test - myproject1.conf and my file structure is like that:
/laradock
/myproject1
/myproject2
hosts file:
127.0.0.1 myproject1.test
127.0.0.1 myproject2.test
myproject1.conf inside nginx/sites:
...
server_name myproject1.test;
root /var/www/myproject1/public;
...
Hope that helps

ssh login in ec2 to change file permission

I need to login in the ec2 aws server to change the file permission. I've .pem and .ppk file on my server and gitbash installed.
Please guide me how can I login to the server and change the file permission.
Here the official documentation from Amazon with SSH/Putty tutorials to connect to your instance: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html
(But assuming you are using Unix/Linux OS)
You could log in to the ec2 instance with the command:
ssh -i /route/to/your/file.pem user#serverUrl.com
(if you have public Url or in your /etc/hosts file or with your IP)
Then, you are logged in the EC2, you could cd to the desired folder and change the permisions with a chmod.
In the /etc/hosts file, you could change the IP of your instance for the serverUrl.com like:
XX.XX.XX.XX serverUrl.com
Hope this helps!

Resources