apache - Redirecting to Amazon EC2 AMI Instance -


i'm trying redirect router php page stored on think centos on ami (amazon machine image). i've done bit of research , have found other people having same problem: i've looked here, , here , got need elastic ip instance has page want redirect to, have that.

i've tried ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/root/path/to/page, (just ip) xx.xxx.xxx.xxx/root/path/to/page , nothing seems work. i'm confused. don't need particular domain redirect ami don't need map domain's dns elastic ip.

okay, figured out problem redirection. essentially, have apache running on centos ami. apache, think, handles if not http requests, request particular page on ami being handled apache. did looked in configuration files of apache on ami under etc/httpd/conf on centos @ least (i don't know other distributions), , opened httpd.conf (full path: /etc/httpd/conf/httpd.conf).

i looked particular line had documentroot (this line sets directory apache serve files) directive , saw had "documentroot "/var/www/html".

what doing wrong redirection url set ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/root/path/to/page instead of ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/page because didn't know apache automatically appending /var/www/html before /page.

so since redirection url set ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/var/www/html/page, when apache getting request append /var/www/html , in ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/var/www/html/var/www/html/page.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -