Jump to content



Photo

Apache Config for Anti-SOPA Blackout

apache sopa config httpd.conf httpd

  • Please log in to reply
8 replies to this topic

#1 cybertimber2008

cybertimber2008

    Neowinian Senior

  • Joined: 02-December 08

Posted 15 January 2012 - 21:11

For anyone that might be helped by this, I've googled it and tried to make it as drop-dead easy as it can be.
Good for Apache Servers (likely 1.3 and higher)

1. Create a page "antisopa.html" and place it in the root of your web directory (eg, /var/www/html/antisopa.html)
2. Insert the following at the end of your httpd.conf
RewriteEngine On
#RewriteCond %{REQUEST_URI} !^/omit.*
RewriteRule /.* http://www.yourdomain.com/antisopa.html
3. Save your config and restart your apache server service and test.

On the second line (RewriteCond...), you can add directories to omit or select directories to only redirect for. Currently it's set to not redirect any request to the "omit" directory. Uncomment and change it if you need.

For today:
Recomment the last 3 lines, save the config file and restart your apache service and your site will be back to normal.
Then, uncomment the relevant lines and save the config. All you'll need to do on the 17th is restart apache for it to take effect.

Open to any suggestions on how to improve this.
Edit: I have uploaded a"antisopa.html" document that I'm using, just incase it's helpful for anyone else. It's XHTML 1.0 Strict compliant.

Attached Files


Edited by cybertimber2008, 15 January 2012 - 21:47.



#2 c3ntury

c3ntury

    Say whaa?

  • Joined: 24-December 09
  • Location: irc.neowin.net

Posted 15 January 2012 - 21:18

Thanks for sharing this! Brilliant idea to allow anyone to do it!

#3 OP cybertimber2008

cybertimber2008

    Neowinian Senior

  • Joined: 02-December 08

Posted 15 January 2012 - 21:48

Also added a sample antisopa.html page for those who might need it.

#4 Raa

Raa

    Resident something-or-rather

  • Tech Issues Solved: 2
  • Joined: 03-April 02
  • Location: NSW, Australia

Posted 15 January 2012 - 21:54

I'd need one for IIS :p

#5 Farchord

Farchord

    Life is but a sum of your achievements

  • Joined: 06-November 01
  • Location: Shawinigan, Quebec, Canada
  • Phone: iPhone 5

Posted 15 January 2012 - 22:18

I'd need one for IIS :p


Simple, create an empty folder, make your html, and change the IIS bindnig to point to the folder :)

#6 MattehCarter

MattehCarter

    Neowinian

  • Joined: 14-January 12
  • Location: England, UK
  • OS: Windows 7, XP

Posted 16 January 2012 - 18:15

Why do you need an anti SOPA page? It was overruled today?

#7 +SOOPRcow

SOOPRcow

    Neowinian

  • Joined: 18-April 02

Posted 16 January 2012 - 18:21

It was put on hold. It, parts of it, or something very much like it will be back soon enough.

#8 OP cybertimber2008

cybertimber2008

    Neowinian Senior

  • Joined: 02-December 08

Posted 16 January 2012 - 18:50

Why do you need an anti SOPA page? It was overruled today?

And this was posted before it was shelved. Shelved != overruled by the way.
And there is still PIPA which is just as bad as SOPA.

#9 MattehCarter

MattehCarter

    Neowinian

  • Joined: 14-January 12
  • Location: England, UK
  • OS: Windows 7, XP

Posted 16 January 2012 - 19:01

And this was posted before it was shelved. Shelved != overruled by the way.
And there is still PIPA which is just as bad as SOPA.


Ahh okay, fair enough!
I got told they were both overruled, I think I'll read up on them now :p

Useful code by the way, I'm using it to redirect my main website to my business page :)



Click here to login or here to register to remove this ad, it's free!