Solved

programming languages on linux server

Posted on 2006-06-26
15
252 Views
Last Modified: 2010-04-21
i am new to linux and i would like to write a simple script to redirect the page to another server. In an Microsft platform i would use asp, what would i write in a linux server?
0
Comment
Question by:lytung818
  • 6
  • 4
  • 2
  • +2
15 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> .. write a simple script to redirect the page to another server ..
are you talking about web servers?
What do you mean by "redirekt"? could you please explain.

As it is Linux, assuming apache as webserver and you mean redirect a HTTP request:
then simply add to you /etc/httpd.conf and restart apache:

  Redirect  permanent /whateverfolderorfile http://new.other.tld/path/file
0
 
LVL 24

Accepted Solution

by:
fridom earned 100 total points
Comment Utility
Everything you can dream of ;-)

No, getting serious. Redirect is just a simply form in an HTML file. So just open an editor and write the code. I doubt very much that you would use ASP for such a task, that would be overkill.

In the end the only that you write is something along the following lines:
<a href="http://www.q-software-solutions.com/aserve/store/index.html">Store</a>.
</p>
    <meta http-equiv="Refresh" Content="10
    URL=http://www.q-software-solutions.com/aserve/store/index.html">
Or somethong like that.


Regards
Friedrich
0
 

Author Comment

by:lytung818
Comment Utility
okay. In microsoft asp, i would create an asp file, then put:

<%

response.redirect "http://www.yahoo.com"

%>

I want to redirect the page to another server. I have never used a linux server so i dont know how to redirect at all...can i still use asp pages on linux ? or should i be using jsp? i have no clue!  please help!
0
 

Author Comment

by:lytung818
Comment Utility
i wrote

  <meta http-equiv="Refresh" Content="10
    URL=http://www.q-software-solutions.com/aserve/store/index.html">

on the top of the page. It did work but it took a while. can this be faster? Thanks!!!
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 50 total points
Comment Utility
> can this be faster?

replace 10 by 0
;-)

0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 50 total points
Comment Utility
Relying on HTML metaredirects is not reliable.  You are much better to server HTTP redirects.  This can be acheived by:

1.  Adding a redirect in the web server configuration (as ahoffman mentioned)
2.  Generating a HTTP redirect from a SSI, CGI, JSP or ASP page (yes, you can do ASP on Linux, but probably not worth the effort).
0
 

Author Comment

by:lytung818
Comment Utility
well i tried with the metadirects, still very slow.

how do i do #1 that you suggested, tintin?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:lytung818
Comment Utility
sorry for asking stupid questions. I have no idea what this means:


from ahoffman:

then simply add to you /etc/httpd.conf and restart apache:

  Redirect  permanent /whateverfolderorfile http://new.other.tld/path/file
0
 
LVL 48

Expert Comment

by:Tintin
Comment Utility
ahoffman's description is a bit brief as we don't know for sure if you have Apache, but I think we can be 99.99% certain you do.  Unfortunately, you didn't mention which Linux distribution you are running, so the Apache configuration file maybe elsewhere like /etc/httpd/conf/httpd.conf


See http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect for specific details.
0
 

Author Comment

by:lytung818
Comment Utility
i see how do i know where the .conf file is? i am hosting the website somewhere else. I looked at the directory of the files , no .conf file

this is the package i have

http://order.1and1.com/xml/order/HostingBeginner;jsessionid=0D663B24589C990ACB5872D23428EF67.TC61a
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> Relying on HTML metaredirects is not reliable.  You are much better to server HTTP redirects.
meta tags are as unreliable as the HTTP location header 'cause both are done by the client

> ahoffman's description is a bit brief  ..
for sure, but I wrote down all my assumtions (Linux, apache, ...), very unusual for my comments ;-)

> .. how do i know where the .conf file is?
sorry, do you have problems in reading? --> http:#16990132 tells you /etc/httpd.conf
depending on your distribution it might be somewhere else, there're dozent of usual places (unfortunatelly)
0
 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 50 total points
Comment Utility
I'm a 1and1 user, and unless you've got a dedicated server, you will not have access to the http.conf file.

The only option that you really have available is the:

  <meta http-equiv="Refresh" Content="0
    URL=http://www.q-software-solutions.com/aserve/store/index.html">

approach.

However, from the 'elegance' perspective, using the server to issue the redirect is preferred. Look here for an explaination of the reason:

http://www.w3.org/QA/Tips/reback
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> I'm a 1and1 user, ..
bad luck ;-)

Redirect can only be used in httpd.conf, IIRC
but mod_rewrite can be used in .htaccess too (but it's a performance penulty for obvious reason)
0
 

Author Comment

by:lytung818
Comment Utility
wow, thank you. i think it would be better to host it on ms hosting server...i just switch from that.
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
>i think it would be better to host it on ms hosting server

Depends. You've got all sorts of differences things to weigh up.

Reliability
Security
Performance
Compatability
etc
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now