0

I've tried searching google for an answer to this but could not find one. My server is running Debian 8 with apache2 and shellinabox. I am trying to redirect my shellinabox port to a directory by using ProxyPass.

I got the port (4200) to redirect to /shell fine, but when I go to http://example.com/shell, chrome tells me "This site can't be reached. example.com refused to connect. Try: • Checking the connection. • Checking the proxy and firewall"

I have a .htpasswd file to make access to /shell password protected, but I removed that to test if it was an issue, it wasn't and just did the same as normal.

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    ErrorDocument 404 /error404/index.html

    <Location /shell>
    ProxyPass http://localhost:4200/
    ProxyPassReverse http://localhost:4200/
    Order allow,deny
    Allow from all
    AuthUserFile /etc/apache2/.htpasswd
    AuthName "Protected Area"
    AuthType Basic
    require valid-user
    </Location>

2 Answers 2

0

add listen 4200 in configuration file

5
  • Not sure what you mean my that, can you explain?
    – Alex Kidd
    Sep 7, 2016 at 14:36
  • open the file /etc/apache2/ports.conf and add the line listen 4200. You see listen 80 already there
    – gloom700
    Sep 7, 2016 at 14:39
  • I've done that, still doesn't work
    – Alex Kidd
    Sep 7, 2016 at 14:42
  • did you restart apache service ?
    – gloom700
    Sep 7, 2016 at 14:47
  • Yes, I restarted apache2 service
    – Alex Kidd
    Sep 7, 2016 at 14:54
0

Don't forget the reverse proxy pass as well, eg:

<VirtualHost *:80>

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

ErrorDocument 404 /error404/index.html

<Location /shell>
ProxyPass http://localhost:4200/
ProxyPassReverse http://localhost:4200/
Order allow,deny
Allow from all
AuthUserFile /etc/apache2/.htpasswd
AuthName "Protected Area"
AuthType Basic
require valid-user
</Location>
1
  • I added that, but it didn't help the issue
    – Alex Kidd
    Sep 7, 2016 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .