Redirecting a port to a web page.


Recommended Posts

hi,

I recently set up my first server and I would like to know how I can redirect a localhost:8022 to my Ip/domain name address such as

192.168.1/ajaxterm or domain.com/term

I'm using the latest version of debian and on a ppc if thats any help?

also if not any hassle can i be told in a step by step way please im a linux newb so i need to simpleton stuff :p

Link to comment
https://www.neowin.net/forum/topic/643463-redirecting-a-port-to-a-web-page/
Share on other sites

hi,

I recently set up my first server and I would like to know how I can redirect a localhost:8022 to my Ip/domain name address such as

192.168.1/ajaxterm or domain.com/term

I'm using the latest version of debian and on a ppc if thats any help?

also if not any hassle can i be told in a step by step way please im a linux newb so i need to simpleton stuff :p

This is what I would do:

Install and configure Apache web server.

Open firewall port.

Create an index page to redirect users to the new website.

Okay, I don't normally use debian, so I am not extremely familiar with the structure, and I don't know if this is the "best" way to do this, but I would do it like this:

1) Login as root:

su -

2) Download the source code for Apache web server from:

http://download.filehat.com/apache/httpd/httpd-2.2.9.tar.gz

wget http://download.filehat.com/apache/httpd/httpd-2.2.9.tar.gz

3) Decompress and extract source:

gzip -d httpd-2.2.9.tar.gz

tar -xvf httpd-2.2.9.tar

4) Configure, make, make install (build the source for your environment)

cd httpd-2.2.9

./configure

make

make install

5) Apache web server is now installed, we need to configure the port.

cd /etc/httpd/conf/

vi httpd.conf

Here you must edit Apache's configuration file, and set it to listen on the correct port.

Change the line that reads: "Listen 80" to "Listen 8022" or whatever port you want.

You can make changes to the file by first pressing "i" to enter into VI's edit mode.

To save, hit ESC to return to command mode and type "wq".

6) Create a new index.html page.

vi /var/www/html/index.html

Edit the page to have this HTML:

<html>
<head>
<meta http-equiv="refresh" content="0;url=https://www.neowin.net/">
</head>
<body>
This page has moved to <a href="http://neowin.net/">http://neowin.net/</a>
</body>
</html>

Save the file the same way as before.

7) Alter your firewall rules.

This step is platform and install specific.

If your using gnome and iptables click on System -> Administration -> Firewall.

Open up port 8022.

8) Start/Restart Apache web server.

/etc/init.d/httpd restart

Thats it.

Hope it works for you.

This is what I would do:

Install and configure Apache web server.

Open firewall port.

Create an index page to redirect users to the new website.

Okay, I don't normally use debian, so I am not extremely familiar with the structure, and I don't know if this is the "best" way to do this, but I would do it like this:

1) Install Apache2

sudo apt-get install apache2

2) Apache web server is now installed, we need to configure the port.

cd /etc/apache2

vi apache2.conf

Here you must edit Apache's configuration file, and set it to listen on the correct port.

Change the line that reads: "Listen 80" to "Listen 8022" or whatever port you want.

You can make changes to the file by first pressing "i" to enter into VI's edit mode.

To save, hit ESC to return to command mode and type "wq".

3) Create a new index.html page.

vi /var/www/index.html

Edit the page to have this HTML:

<html>
<head>
<meta http-equiv="refresh" content="0;url=https://www.neowin.net/">
</head>
<body>
This page has moved to <a href="http://neowin.net/">http://neowin.net/</a>
</body>
</html>

Save the file the same way as before.

4) Alter your firewall rules.

This step is platform and install specific.

If your using gnome and iptables click on System -> Administration -> Firewall.

Open up port 8022.

5) Start/Restart Apache web server.

/etc/init.d/apache2 restart

Thats it.

Hope it works for you.

Save yourself the trouble of compiling :)

Save yourself the trouble of compiling :)

I wasn't sure if aptitude was installed by default on Debian systems so I went with the compiler.

Thanks, that certainly makes it a lot easier.

Just a quick question about it though.

Without using sudo for each step he won't be able too:

1) Edit apache's configuration file: /etc/apache2/apache2.conf

2) Change anything in /var/www/

3) Restart the apache2 daemon

...right?

Why not just use 'su -'?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Why was it necessary to use AI to help write this article? Can we no longer do our own research or our own writing?
    • The auto industry really needs to update it's terminology so a software update isn't called a recall.
    • Anybody that thinks flying cars were possible are idiots. Everyone would basically need a pilot licence, can you imagine how insane and dangerous that would be, people can barely handle driving on land safely right now.
    • Microsoft Edge 149.0.4022.80 by Razvan Serea Microsoft Edge is a super fast and secure web browser from Microsoft. It works on almost any device, including PCs, iPhones and Androids. It keeps you safe online, protects your privacy, and lets you browse the web quickly. You can even use it on all your devices and keep your browsing history and favorites synced up. Built on the same technology as Chrome, Microsoft Edge has additional built-in features like Startup boost and Sleeping tabs, which boost your browsing experience with world class performance and speed that are optimized to work best with Windows. Microsoft Edge security and privacy features such as Microsoft Defender SmartScreen, Password Monitor, InPrivate search, and Kids Mode help keep you and your loved ones protected and secure online. Microsoft Edge has features to keep both you and your family protected. Enable content filters and access activity reports with your Microsoft Family Safety account and experience a kid-friendly web with Kids Mode. The new Microsoft Edge is now compatible with your favorite extensions, so it’s easy to personalize your browsing experience. Microsoft Edge 149.0.4022.80 changelog: Fixes Fixed an issue that prevented QR code generation from working. Feature updates Intune MAM Protected Downloads. The protected downloads feature for Intune MAM will now save downloaded files to the Documents > Microsoft Edge > Downloads folder in OneDrive. Extensions monitoring in the Edge management service. The Microsoft Edge management service now allows admins to gain visibility into extensions installed across their managed users. From the extensions monitoring page, admins can see which extensions have been installed as well as manage user requests for blocked extensions. For more information, see Microsoft Edge Extensions Monitoring. Validate Edge builds early with enterprise preview. Enterprise preview provides a simpler way for admins to flight pre-release Edge builds to their users. To reduce friction and bolster usage, users will receive pre-release builds directly inside of their Stable Edge application. Admins can allow users to easily opt-out of the preview experience, using built-in rollback to switch between their pre-release and stable channels with ease. Microsoft 365 admin center users can configure the feature, view their flighting population, and receive personalized recommendations all in one place. For more information, see Get started with Enterprise Preview in Microsoft Edge. Download: Microsoft Edge (64-bit) | 193.0 MB (Freeware) Download: Microsoft Edge (32-bit) | 170.0 MB Download: Microsoft Edge (ARM64) | 188.0 MB View: Microsoft Edge Website | Release History Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • The machines are starting to fight back any way they can.
  • Recent Achievements

    • Week One Done
      Eurosoft10 earned a badge
      Week One Done
    • One Month Later
      Eurosoft10 earned a badge
      One Month Later
    • One Year In
      Skeet Campbell earned a badge
      One Year In
    • One Month Later
      Sharbel earned a badge
      One Month Later
    • First Post
      BizSAR earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      598
    2. 2
      +Edouard
      189
    3. 3
      PsYcHoKiLLa
      78
    4. 4
      Michael Scrip
      76
    5. 5
      Steven P.
      69
  • Tell a friend

    Love Neowin? Tell a friend!