How to host two websites on AWS on Windows and Apache but only one site works - amazon-web-services

I have two sites we'll call Site1.com and Site2.com.
I recently converted my VPS with another host to an image and imported the image into AWS. On the VPS, I was able to serve up both sites. Under AWS, whichever URL is accessed first, the second site will display the content and the URL will change to the first accessed site.
The setup is unique in that it is Windows running an apache web server (very old application). No changes to the conf files have been made since the conversion so I can only assume that it's something unique with the AWS setup.
Why is it doing this and more importantly how can I fix this so that I don't have to spin up a second instance.

Turns out the issue is with the instance type. When I bumped it up to medium (from small), the issue resolved itself. Go figure.

Related

Two flask Apps same domain IIS

I want to deploy same flask application as two different instances lets say sandbox instance and testing instance on the same iis server and same machine. having two folders with different configurations (one for testing and one for sandbox) IIS runs whichever is requested first. for example I want to deploy one under www.example.com/test and the other under www.example.com/sandbox. if I requested www.example.com/test first then this app keeps working correctly but whenever I request www.example.com/sandbox it returns 404 and vice versa!
question bottom line:
how can I make both apps run under the same domain with such URLs?
would using app factory pattern solve this issue?
what blocks both apps from running side by side as I am trying to do?
thanks a lot in advance
been stuck for a week before asking this question and the neatest way I found was to assign each app a different app pool and now they are working together side by side happily ever after.

Connect two apps via custom subdomain on heroku

I have two separate rails apps. I'd like to connect them by simply linking them in the header. One is, for example, http://example.com and I'd like the other to be, for example http://different.example.com.
I added the relevant domain to the first heroku app and it's working. I created a subdomain with my domain host, setting the host CNAME to the previously referenced "different." I then attempted to add the subdomain to the heroku app by running the command:
$ heroku domains:add different.example.com
Despite that, it's not working. Any thoughts on what I've done wrong? I followed the instructions from my domain host and on heroku's documentation.
If you made a recent change, it's possible that your connection to the Internet or ISP might be serving you a cached, old version of where you want to go.
Try accessing the site from another entry point such as through a third party like https://crossbrowsertesting.com and then you can rule out this possibility.

Setting up LAMP Web Server on AWS EC2 t1 Micro

I'm sorry for being dumb, but I am really stuck for few days. This is my first time using AWS. I have successfully installed LAMP web server under t1.micro on my customer's AWS account http://54.72.132.215/ following this tutorial . But I don't know what to do next after the installation. My goal is:
Setup a Domain
Run a Prestashop.
I hope you can guide me to the right path, I am totally lost. Thanks.
You need to register a domain with someone, this is outside of Amazon. Just google domain name registrars:
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=domain%20name%20registrar
Then you'll need to point your domain to your Amazon EC2 instance. I would suggest using Route 53 to do this, another Amazon AWS service that makes it easier to setup and control your domains:
http://aws.amazon.com/route53/
Once you have that setup, visiting your name domain should show the default apache It works! page, if you've correctly setup your LAMP server. It'll look something like these:
https://www.google.co.uk/search?q=default+apache+web+page&espv=2&source=lnms&tbm=isch&sa=X&ei=yRfWU_v8OeHe7Abp1ICICw&ved=0CAYQ_AUoAQ&biw=1457&bih=881#imgdii=_
You'll want to add a new vhost for your new PrestaShop site, this will allow you to setup a specific set of files to serve for your new URL, and means you can add other sites to the server later on. Just a quick google shows multiple tutorials on doing this, here's one of them:
http://calebogden.com/multiple-websites-amazon-ec2-linux-virtual-hosts/
Then follow the tutorial in the PrestaShop documentation about installing PrestaShop via the command line:
http://doc.prestashop.com/display/PS16/Installing+PrestaShop+using+the+command-line+script
Now I'm guessing that all those steps in one go is a little overwhelming, so I would suggest you break this task down into chunks and work on them one at a time, and post a few different questions on StackOverflow and probably ServerFault: https://serverfault.com/, as that is better suited to setting up servers.
To summarise you need to:
register a domain name and point it to your EC2 server, you should see the default apache page
create a new vhost to server web pages for your new domain
follow the guide on PrestaShop about installing the software
Treat each of those a separate task. This question covers lots of topics in one very general idea, the full answer to your problem wouldn't really fit in a single post.
ServerFault will probably have a lot of your answers already, regarding setting up domains and vhosts at least.

Proxying external images for SSL compliance

I've got a little Django site in which users can link to images on other sites in their comments. It's by no means a core feature.
I've just moved the entire site to SSL. That has worked fine for the most part but remote images are obviously not always going to be available over SSL. Only the slightest number of domains have valid certificates.
What's the best way to funnel images through then?
Download them when the user posts and alter the URL to a local one?
Make a proxy that just proxies another URL?
The second seems like less work (I feel like it would be possible just with NGINX rules) but that it would also open the site up to people using my proxy for their own nefarious gain... Which I'd like to avoid.
What's the best compromise here?
Github ran into this same issue when they moved to HTTPS everywhere and detailed it in their blog: https://github.com/blog/743-sidejack-prevention-phase-3-ssl-proxied-assets
Their solution was to create a proxy server which they open sourced as https://github.com/atmos/camo To address the same concerns about abuse of the proxy it is deployed with a shared secret with the application server. Integrating this would a Django project would be straight forward as you would just need to generate the digest from the shared key for the given image url.

Sitecore Can Publish Home But Not Other Content Tree

I have a setup with one authoring site and two remote publishing sites.
If I publish from the /Home/ content tree from authoring that is reflected in all remote targets.
If I publish from any other content tree, say /Quotations/, that is not reflected in any of the remote targets. It is, however, reflected on the authoring machine's "Internet" site so the changes are being published locally.
The log file on the authoring site says that the publish of the Quotations content tree worked correctly and that N number of items were published (varies depending on how much I change and/or if I do a full or incremental publish but N is about what I expect it to be).
I'm feeling I've missed something in configuration but not sure where to look.
Many thanks!
rjsjr
A couple of ideas:
Are the templates and other items needed on the remote targets there to properly store the content? If "Quotations" is using different templates that aren't published onto the remote target then you may be publishing empty content items.
Are the remote targets configured within Sitecore's config files to be the proper databases to be pushing the content?
Time for another approach, could we isolate the problem to being one of the following:
DB server. This would be taking the database for the remote target and running it on another web server to ensure that the DB is doing everything correctly in terms of serving up the data.
Web server. This would be taking the web server that hosts the remote target and pointing it at another server to see that there isn't anything wrong with the web server like a misconfiguration in IIS or something like that.
Connectivity between the two. This is what is left if the DB works with another web server and the web server works with another DB server as each part can be eliminated as the problem being solely in one area.
Or do we know it is that last one that is the ugliest one to try to debug?
Are Home and Quotations siblings of each other? If not, then there may be something above Quotations that is the source of the problem.
That I don't know. I'd be tempted to ask this on the Sitecore forms on their site if you are certified in Sitecore you should be able to access it.