Jump to content

apacheguy

Members
  • Posts

    108
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://eric.praske.com

Profile Information

  • Gender
    Not Telling

apacheguy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I recently transitioned to Apache 2.4 from 2.2. I'm looking to take advantage of mod_authz_dbd to replace my Basic Auth scheme I had in place before. Per the docs on this module (http://httpd.apache.org/docs/trunk/mod/mod_authz_dbd.html), I can execute a custom statement to log a user in like this: Trouble is, I want it to log the user IP address. Apache supposedly supports calling ENV VARS from with httpd.conf, but for some reason the following code does not work: It inserts %{REMOTE_ADDR} instead of the actual ip address value. Any idea how I can get this to work?
  2. Brilliant! I just made a few minor changes to your code, but it is finally where I want it to be. Your code had the images in 1 column with 3 rows, but I wanted that switched to 3 columns and 1 row. Here is the resulting CSS: <style media="screen" type="text/css"> /* <!-- */ body{ margin: auto; width: 100%; padding: auto; } #container{ width: 100%; height: auto; margin: auto; } #grid{ padding: 100px; margin: auto; } .grid-element{ width: 33%; display: inline-block; margin: auto; } a.clickable-div { display: block; height: 100%; width: 100%; text-decoration: none; } .img { height:auto; width:inherit; max-height:50%; max-width:50%; } .button { color: #900; font-weight: bold; font-size: 150%; text-transform: uppercase; display: block; width: 50%; } /* --> */ </style>
  3. Ok, first off CSS is definitely not my strong suit so bear with me here. This is my code: <style media="screen" type="text/css"> /* <!-- */ .clear{ clear:both; } #grid{ width: 100%; } .grid-element{ width:33%; float:left; } a.clickable-div { display: block; height: 100%; width: 100%; text-decoration: none; } .img { height:auto; width:inherit; max-height:100%; max-width:100%; } .button { color: #900; font-weight: bold; font-size: 150%; text-transform: uppercase; display: block; width: 50%; } /* --> */ </style> <div id="grid"><div class="grid-element" align="center"> <img src="images/light_offline.png" class="img"> <p><h1>Hue Lamp 1 </h1></div><div class="grid-element" align="center"> <a href="action.php?light=2&state=false"> <img src="images/light_off.png" class="img"></a> <p><h1>Hue Lamp 2 </h1></div><div class="grid-element" align="center"> <a href="action.php?light=3&state=false"> <img src="images/light_off.png" class="img"></a> <p><h1>Hue Lamp 3 </h1></div></div><p> <div align="center"> <form method="POST" action="action.php"> <input type="hidden" name="scene" value="02b12e930-off-0"> <input type="submit" value="Scene 1" class="button"> </form> <p><form method="POST" action="action.php"> <input type="hidden" name="off"> <input type="submit" value="All Off" class="button"> </form> </div> This is the browser output. A couple things are wrong: 1. Why aren't the images scaling so they are all the same size? I assigned the same CSS class to each of the images but they are all appearing differently. The original images are all the same size. 2. Why are my buttons in the far right corner? I want to have them centered below the images so as to prevent the horizontal scroll bar, which I hate.
  4. Yep, the range column was the problem all along. Thanks! Shouldn't the error message engine be smart enough to have pointed out that I was using a reserved keyword? The lack of description in MySQL errors is frustrating, as there was no hint to what was causing the problem.
  5. Thanks for those replies. I removed $date from my query since it is already the default value for that column. No luck. Same error: Putting quotes around the values does not help either. Same error. Ugh
  6. I've banged my head enough trying to figure out this problem and have given up. I've inserted data into an SQL DB before without any problems. Not sure what's going on here. This is my code: $charge = function_read("vehicles/" . $status[0]['id'] . "/command/charge_state"); $miles = mysqli_real_escape_string($con, $charge['battery_range']); $battery_level = mysqli_real_escape_string($con, $charge['battery_level']); mysqli_query($con,"INSERT INTO battery (Date, Range, Percent, Sleep) VALUES ($date, $miles, $battery_level, 1)"); echo $con->error; This is the error message (completely worthless, IMHO). Could it be any less descriptive? MySQL table is configured as follows: Date timestamp CURRENT_TIMESTAMP Range decimal(5,2) Percent tinyint(3) Sleep tinyint(1) 0 Any ideas?
  7. Yeah, I was afraid of that. No, unfortunately I need to implement server-side Basic Auth (ie. not through a php script). The reason I wrote login.php was not to authenticate the users, but instead set a cookie and log the login to a database. Good idea, though!
  8. Hello, I am running Apache 2.2.24 and I want to configure the server to route all HTTP Basic Auth through a single php script. Take the directory structure below as an example: /htdocs/protected /htdocs/protected/image1.gif /htdocs/protected/index.html /htdocs/protected/login.php So, if the user tries to access image1.gif, they would be presented with a login prompt and, upon successful login, would be redirected through login.php, before being allowed to access image1. Is this possible? Thanks very much!
  9. Ok, I see what you're saying. When I include the code in your previous post inside of my virtual host, apache returns the following error: DOSHashTableSize not allowed here I'm assuming this means that you can't configure modules inside of <Directory />
  10. thorpe, thanks for your reply. The module I am attempting to implement is mod_dosevasive, which can be download at apachelounge. I can enable to module by adding this line to httpd.conf: LoadModule dosevasive22_module modules/mod_dosevasive22.dll Simply enabling this module without any additional configuration seems to kick in default protection values. What I have attempted to do is configure the module within a virtual host. ex: <VirtualHost *:80> ... <IfModule dosevasive22_module> DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 </IfModule> </VirtualHost> The idea being that dosevasive only remain active for this virtual host. The reason is we have scripts that generate legitimate queries on another virtual host, however the queries are tripping the dosevasive counter. So the question now is how to enable dosevasive for vhost 1 but not vhost 2.
  11. Hello folks, My question concerns the implementation of modules using virtual hosts. Is there a way to make a module apply to a specific virutal host and not the others? Simply placing the code inside the virtual host doesn't seem to work. Maybe I'm missing something. So just to clarify I'll provide an example. Let's say I want mod_xyz to be enabled for www.server.com but not ftp.server.com. Thanks for your help.
  12. Either look in the programs, config, or query it using a tool like IDserve.
  13. I run my site on Windows so I can't give you much advice, but you may want to look at this site: http://www.linuxsecurity.com/content/view/133913/171/
  14. Problem Solved! It turned out that the script was not placed in a protected directory. Thus, it was not able to call remote_user.
  15. Upon further analysis of the problem I discovered that perl is having problems just called the remote_user variable. I got this script from the apache documentation to test it: #!/perl/bin/perl.exe my $REMOTE_USER = $ENV{'REMOTE_USER'}; print "Content-Type: text/html\n\n"; print "The authenticated user is $REMOTE_USER\n"; No luck printing the remote_user!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.