Amazon Linux AMI Test Page appears every time - html

I have a EC2 with apache2 and static web site in /var/www/html.
I changed one html file there and after that I can't access my web page with url - Amazon Linux AMI Test Page opens.
After sudo service apache2 restartit becomes to work normally, but switched to the Amazon Linux AMI Test Page after some minutes.
I changed owner for html folder to user sudo chown ubuntu /html and it became works normally again, but every time I exit from ssh session it immediately starts to display Amazon test page.
I checked apache2 Document root in .conf and +r rights for files in html folder, they are normal. Why this issue happens?
Sometimes all pages working normally, but index.html returns 404 error

It looks like there are two elastic IPs assigned for the site. One of them is not working, while the other one works. EC2 is randomly picking one of the IPs (I found this after doing a wget request)
You will have to remove the one IP that is not related to your site.

Related

MAMP localhost cannot connect

I'm a complete novice at web deving (literally just started yesterday so please explain your answers like you were talking to a 5 year old haha) and I'm setting up MAMP following along the steps on this site: https://skillcrush.com/2015/04/14/install-wordpress-mac/
I followed everything to a tee till I got to step 10. When I search localhost:8888/(insert folder name in my root folder) on my URL bar. I get "cannot connect to server."
I've googled this problem and tried all the solutions I found (here on stack overflow and others) but still nothing works. Can anyone help me?
I'm using macOS Sierra and MAMP ver 4.0.6
Try visiting http://localhost:8888/ and see what happens ... if there is nothing there then there is a problem with your apache configuration. Make sure the apache service was started from within the MAMP app.
if you type the following in your terminal app:
sudo /Applications/MAMP/Library/bin/apachectl restart
it will output any issues or misconfiguration you may have.
Also, if you want you can give PilotKit a try, PilotKit is a
Super-easy local site development app, it launches and creates sites locally with one click, it support Wordpress, Joomla, Drupal and static sites generator plus it comes with a lot of functionalities.
Installation step of wordpress:
Step - 1 : download a wordpress from wordpress website.
Step - 2 : Extract wordpress and move this extracted folder into a MAMP/htdocs folder.
Step - 3 : Next we’ll go into our MAMP start page, PHPMyAdmin, then Databases and create a database (I’ll name it “database”). Go to “localhost:8888/database/installer.php and fill in the following information.
Step - 4 : After selecting “Run Deployment”, on the following page select “Run Update”. At last, we can go to our local website at “localhost:8888/site”!
Some cases that makes your site is not reachable
If you are not sure with port.It's better to check url with open a start page.
Check you server and database working properly by creating simple file.for example.
make sure you have database before install wordpress.If any then goto database and check wp_option table.Cross verify your home_url and site_url.

apache web server doesnt read html in htdocs

I'm using linux mint and I'm install Apache web server. When I'm testing him in web browser I can see
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
But if I'm trying to added one more html docs in the htdocs directory. I;m restart the server, but I have an 404 error:
Not Found
The requested URL /test.html was not found on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80
Now I'm open index.html which located in htdocs just after installation the server. It contains the following:
<html><body><h1>It works!</h1></body></html>
Now I'm trying to change it, but there is no effect when I'm trying to view it in browser http://localhost/index.html.
Question: What is a possible reason of this trouble?
DocumentRoot for apache2 on Linux Mint is /var/www/.
To change the default message, edit /var/www/index.html.
Put new files in /var/www/
You don't need to restart apache after updating or adding files, changes are seen immediately.

How can I have apache load and display folders stored in a shared folder on another machine?

I am running an apache server on computer A. I use computer B with ubuntu desktop and A lamp server to develop code because it's more portable. I use ftp to put html files on computer A and they can be opened by connecting to computer A's ip via the browser, all simple enough. Now I would like via a link on my default page index.html to be redirected to an html file stored in a shared folder on computer B. Is such a thing possible and if so how can I make apache render the html page at such a location as smb://<network location>/var/www?
mkdir /var/www/remote # assuming your current document root is /var/www/
mount smb://network.host/var/www /var/www/remote/
Once you have it working you can edit /etc/fstab to make it permanent, or script step 2.
This will keep your current local server working, and allow you to access the remote path at http://127.0.0.1/remote/

How do I debug 503 errors in Openshift?

I have a scalable EAP 6.0 web app hosted on Openshift, and I get HTTP 503 error messages whenever I attempt to access the app. How do I fix this.
In my case this was an issue with the HAProxy cartridge, and not my web cartridge. I found this out by attempting to view the HAProxy status page at http://app-domain.rhcloud.com/haproxy-status/ (obviously you'll have to replace app and domain in that URL to match your own Openshift settings). That page was displaying a 503 error.
To fix it, ssh into the HAProxy session using
ssh 1234567890abcdef1234567890abcdef#app-domain.rhcloud.com
You'll get your actual username and hostname from your OpenShift web admin console. Then run
ctl_app restart
This will restart the HAProxy. And for me, that fixed the issue.
Another handy tip I found while debugging this was that you can browse to a specific instance of your web cartridge, bypassing the HAProxy.
In the HAProxy status page, you can see that the web cartridge instance is called gear-1234567890ab-domain. Drop the "gear-" prefix, and then use the remaining hex characters and domain name to form a URL like:
1234567890ab-domain.rhcloud.com
This will take you straight to the specific web cartridge, bypassing any HAProxy issues.
Thanks Phyxx,
Its working for me let elaborate your suggestion so that others can also benefit.
Step 1: cd /var/lib/openshift/your server/haproxy/conf
Step 2: vi haproxy.cfg
step 3: remove " option httpchk GET /"
step 4: save
step 5: ctl_app restart

EC2 Server troubleshooting

I have an instance running that points to an elastic IP. I also have the A record on GoDaddy pointing to that same elastic IP. I created a key, installed php, httpd, etc... through putty, gave ec2-user chown permissions in var/www/html and sub directories and plopped a simple index.html in that folder.
The problem is, I still get the 404 - so the site is completely unresponsive. I can nav into the site with WinSCP fine and the directories are all there. Is there something I am completely overlooking that is just an oversight on my part or do I have deeper issues?
Much thanks!
EDIT:
I did a simple service httpd status to check if Apache is running, and sure enough it is.
If you recently updated the dns on GoDaddy it may just be that you have to wait for the dns to propagate to the right nameservers. Have you checked that you are getting a 404 from the right ip address?