homepage Welcome to WebmasterWorld Guest from 54.205.144.54
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
trying to create a secure "wake on lan" function
hydra3333




msg:4619281
 1:14 am on Oct 27, 2013 (gmt 0)


System: The following 4 messages were cut out of thread at: http://www.webmasterworld.com/apache/4618858.htm [webmasterworld.com] by incredibill - 10:46 pm on Oct 26, 2013 (PST -8)


I'm a raw newbie. I guess my query belongs in this thread.

I am trying to create a secure "wake on lan" function, invoked from a publicly exposed reverse proxy connection into a virtualhost/port on the same server (a Raspberry Pi) as the reverse proxy. All paths should end up invoking only one php page regardless of the incoming paths an external user has specified.

Will this code (mostly copied from other places) do that ?


<VirtualHost 127.0.0.1:12345>
ErrorDocument 400 "unauthorised"
ServerName 127.0.0.1 wol.example.org
ServerAdmin example@admin.org
DocumentRoot /var/www/wol/

<Location />
ErrorDocument 400 "."
Order allow,deny
Allow from all
AuthType Basic
AuthName "Restricted - Authorised use ONLY"
AuthBasicProvider file
AuthUserFile "/etc/apache2/passwd.dat"
Require user userA
</Location>

# redirect everything to /wol.php
#http://moz.com/learn/seo/redirection
#http://serverfault.com/questions/32513/url-redirect-to-another-page-on-the-same-site
#RewriteEngine On
#RewriteCond %{REQUEST_URI} !=/wol.php
#RewriteRule ^ /wol.php [R=301]
#RedirectMatch permanent !^/wol.php https://127.0.0.1:10013/wol.php
#Im unsure about regex expressions, I hope this is correct to prevent looping
RedirectMatch permanent !https://127.0.0.1:12345/wol.php https://127.0.0.1:123456/wol.php

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order deny,allow
Deny from all
</Directory>

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

SSLEngine on
SSLCertificateFile /etc/ssl/localcerts/server.side.SSL.certificate.crt
SSLCertificateKeyFile /etc/ssl/localcerts/server.side.SSL.certificatekey.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>

#MSIE 6 and older cannot use keepalive
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>

 

hydra3333




msg:4619282
 1:24 am on Oct 27, 2013 (gmt 0)

I should have added, this is part of the reverse proxy code to invoke it

ProxyRequests Off
ProxyVia Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /wol https://127.0.0.1:12345/
ProxyPassReverse /wol https://127.0.0.1:12345/
<Location /wol>
ErrorDocument 400 "."
Order allow,deny
Allow from all
AuthType Basic
AuthName "Restricted - Authorised use ONLY"
AuthBasicProvider file
AuthUserFile "/etc/apache2/passwd.dat"
Require user userA
</Location>

hydra3333




msg:4619283
 1:27 am on Oct 27, 2013 (gmt 0)

ps I only have one port open for the reverse proxy, which links to other things, hence this roundabout way of doing it.

hydra3333




msg:4619284
 1:30 am on Oct 27, 2013 (gmt 0)

Apologies for the typos :(
ports are all 12345
ServerAdmin admin@example.org

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved