LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   Simple Apache/port-forwarding question (http://www.linuxquestions.org/questions/linux-security-4/simple-apache-port-forwarding-question-4175441705/)

nobuntu 12-16-2012 05:36 PM

Simple Apache/port-forwarding question
 
Good afternoon,

I am trying to set up a functional LAMP server using CrunchBang 11. My ISP (Cox Communications) seems to have blocked port 80, so I want to run the server on a different port: 8090.

My Linksys router is set up to forward like this: image.

I am wondering which Apache configuration files I need to edit in order to get Apache to let me access http://my-ip-address:8090/, and specifically what to change them to.

I know almost nothing about networking/port-forwarding/Apache, so this project has been very educational. This is the only remaining stumbling-block until I have a functioning LAMP server in my bedroom! :)

Regards,

/R3nCi/

Z038 12-16-2012 08:04 PM

You need to locate your httpd.conf file and add a Listen statement to it for the port you want Apache to listen on. There will probably be some commented out examples in it. My httpd.conf is located in /etc/httpd/ directory.

I guess, from your image, that Linksys is referring to the incoming port from the WAN side as the "Externet" port. If so, it looks like you have it forwarded to port 80 on your system. If that is true, then you don't want to tell Apache to listen on 8090. It should listen on 80 since your router is translating it from 8090 to port 80 on your system. If you were to forward an incoming connection on WAN port 8090 to port 8090 on your system, then you'd want Apache to listen on 8090.

After you update httpd.conf, you need to restart Apache. The command is "apachectl -k restart".

BTW, the Linux - Security forum is not really the best place for this question. A moderator may end up moving it.

frankbell 12-16-2012 09:16 PM

In a default XAMPP installation, the httpd.conf file is in /opt/lampp/etc.

The XAMPP stop and start commands, to be issued after cd-ing to /opt/lampp (at least on my system) are

Code:

./lampp stop
./lampp start

as root.

Z038 12-17-2012 11:40 PM

OP, was the information you were provided helpful? Do you have more questions?

nobuntu 12-18-2012 07:10 PM

Quote:

Originally Posted by Z038 (Post 4851434)
OP, was the information you were provided helpful? Do you have more questions?

I have no further questions. Thank you to everyone who has helped me.

Secondarily: my apologies for posting this in the Security forum. I meant topost it inLinux - Server, but must have selected the wrong subforum accidentally. I was very tired at the time... ;)


All times are GMT -5. The time now is 02:51 AM.